-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add anthropic_cache_all in AnthropicModel #3442
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
base: main
Are you sure you want to change the base?
Conversation
| See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching for more information. | ||
| """ | ||
|
|
||
| anthropic_cache_all_ttl: Literal['5m', '1h'] |
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.
See #3450 for notes on how we could handle TTL
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.
Good, let's move forward with #3450 first
| model_settings=AnthropicModelSettings( | ||
| anthropic_cache_all=True, | ||
| anthropic_cache_instructions=True, | ||
| anthropic_cache_tool_definitions=True, |
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.
Do we still need these 2 if cache_all is used?
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.
I think with #3450, we should consider their priority.
For instructions and tool_definitions, first respect the string values of anthropic_cache_tool_definitions and anthropic_cache_instructions, then use the string value of anthropic_cache_all.
|
One more thing, if enable |
closes #3441
see #3441 for more details