-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anthropic prompt caching #924
Conversation
|
||
```js "ephemeral: true" | ||
def("FILE", env.files, { ephemeral: true }) | ||
``` | ||
|
||
Read more about [prompt caching](/genaiscript/reference/scripts/prompt-caching). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for prompt caching is duplicated between context.md
and a new file prompt-caching.mdx
. This redundancy can be avoided by linking to the existing content or consolidating it in one place.
generated by pr-docs-review-commit
content-structure
LGTM 🚀 The changes look good! These modifications appear to streamline the handling of cache control in prompt templates, making it more intuitive and flexible. The introduction of
|
|
||
### Anthropic | ||
|
||
- Anthropic: it is translated into a `'cache-control': { ... }` field in the message object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frontmatter in prompt-caching.mdx
is not necessary since it's a standalone document and does not need to be included in the sidebar or have a title. This can be removed to simplify the file.
generated by pr-docs-review-commit
frontmatter
|
||
### Anthropic | ||
|
||
- Anthropic: it is translated into a `'cache-control': { ... }` field in the message object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The section on LLM provider support is duplicated between context.md
and prompt-caching.mdx
. This redundancy can be avoided by linking to the existing content or consolidating it in one place.
generated by pr-docs-review-commit
content-structure
I love the API, I'll try it out |
Implement anthropic prompt caching
Description of Changes
cacheControl
that takes a cache control type ("ephemeral"
).PromptTemplateString
interface to include thecacheControl
method.