mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 04:07:54 +00:00
community[patch]: additional check for prompt caching support (#29008)
Prompt caching explicitly excludes `gpt-4o-2024-05-13`: https://platform.openai.com/docs/guides/prompt-caching Resolves https://github.com/langchain-ai/langchain/issues/28997
This commit is contained in:
parent
4de52e7891
commit
0185010b88
@ -204,8 +204,10 @@ def standardize_model_name(
|
|||||||
or ("finetuned" in model_name and "legacy" not in model_name)
|
or ("finetuned" in model_name and "legacy" not in model_name)
|
||||||
):
|
):
|
||||||
return model_name + "-completion"
|
return model_name + "-completion"
|
||||||
if token_type == TokenType.PROMPT_CACHED and (
|
if (
|
||||||
model_name.startswith("gpt-4o") or model_name.startswith("o1")
|
token_type == TokenType.PROMPT_CACHED
|
||||||
|
and (model_name.startswith("gpt-4o") or model_name.startswith("o1"))
|
||||||
|
and not (model_name.startswith("gpt-4o-2024-05-13"))
|
||||||
):
|
):
|
||||||
return model_name + "-cached"
|
return model_name + "-cached"
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user