mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
fix(anthropic): set max input tokens based on 1m context beta header (#35341)
This commit is contained in:
@@ -1024,6 +1024,12 @@ class ChatAnthropic(BaseChatModel):
|
||||
"""Set model profile if not overridden."""
|
||||
if self.profile is None:
|
||||
self.profile = _get_default_model_profile(self.model)
|
||||
if (
|
||||
self.profile is not None
|
||||
and self.betas
|
||||
and "context-1m-2025-08-07" in self.betas
|
||||
):
|
||||
self.profile["max_input_tokens"] = 1_000_000
|
||||
return self
|
||||
|
||||
@cached_property
|
||||
|
||||
Reference in New Issue
Block a user