mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-03 02:06:33 +00:00
chore: claude-3-ops removed
This commit is contained in:
parent
1942939de9
commit
a82227d165
@ -1279,7 +1279,9 @@ class ChatAnthropic(BaseChatModel):
|
|||||||
@model_validator(mode="before")
|
@model_validator(mode="before")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_max_tokens(cls, values: dict[str, Any]) -> Any:
|
def validate_max_tokens(cls, values: dict[str, Any]) -> Any:
|
||||||
"""Validate max_tokens."""
|
"""Validate max_tokens.
|
||||||
|
Can find the Max Tokens limits here: https://docs.anthropic.com/en/docs/about-claude/models/overview#model-comparison-table
|
||||||
|
"""
|
||||||
if values.get("max_tokens") is None and values.get("model"):
|
if values.get("max_tokens") is None and values.get("model"):
|
||||||
if "claude-opus-4" in values.get("model", ""):
|
if "claude-opus-4" in values.get("model", ""):
|
||||||
values["max_tokens"] = 32000
|
values["max_tokens"] = 32000
|
||||||
@ -1291,9 +1293,9 @@ class ChatAnthropic(BaseChatModel):
|
|||||||
"model", ""
|
"model", ""
|
||||||
) or "claude-3-5-haiku" in values.get("model", ""):
|
) or "claude-3-5-haiku" in values.get("model", ""):
|
||||||
values["max_tokens"] = 8192
|
values["max_tokens"] = 8192
|
||||||
# leaves us with "claude-3-5-opus", "claude-3-haiku"
|
# leaves us with "claude-3-haiku"
|
||||||
else:
|
else:
|
||||||
values["max_tokens"] = 1024
|
values["max_tokens"] = 4096
|
||||||
return values
|
return values
|
||||||
|
|
||||||
@model_validator(mode="before")
|
@model_validator(mode="before")
|
||||||
|
Loading…
Reference in New Issue
Block a user