mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
feat(llm): update prompt caching list to include new sonnet (#4552)
This commit is contained in:
parent
78eacc4489
commit
dcd4b04f57
@ -45,11 +45,9 @@ LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (
|
||||
# remove this when we gemini and deepseek are supported
|
||||
CACHE_PROMPT_SUPPORTED_MODELS = [
|
||||
'claude-3-5-sonnet-20240620',
|
||||
'claude-3-5-sonnet-20241022',
|
||||
'claude-3-haiku-20240307',
|
||||
'claude-3-opus-20240229',
|
||||
'anthropic/claude-3-opus-20240229',
|
||||
'anthropic/claude-3-haiku-20240307',
|
||||
'anthropic/claude-3-5-sonnet-20240620',
|
||||
]
|
||||
|
||||
|
||||
@ -259,7 +257,10 @@ class LLM(RetryMixin, DebugMixin):
|
||||
self.config.caching_prompt is True
|
||||
and self.model_info is not None
|
||||
and self.model_info.get('supports_prompt_caching', False)
|
||||
and self.config.model in CACHE_PROMPT_SUPPORTED_MODELS
|
||||
and (
|
||||
self.config.model in CACHE_PROMPT_SUPPORTED_MODELS
|
||||
or self.config.model.split('/')[-1] in CACHE_PROMPT_SUPPORTED_MODELS
|
||||
)
|
||||
)
|
||||
|
||||
def _post_completion(self, response: ModelResponse) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user