mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-04 22:23:50 +00:00
anthropic: update attribute name and alias (#22625)
update name to `stop_sequences` and alias to `stop` (instead of the other way around), since `stop_sequences` is the name used by anthropic.
This commit is contained in:
parent
05bf98b2f9
commit
c1ef731503
@ -492,7 +492,7 @@ class ChatAnthropic(BaseChatModel):
|
||||
max_retries: int = 2
|
||||
"""Number of retries allowed for requests sent to the Anthropic Completion API."""
|
||||
|
||||
stop: Optional[List[str]] = Field(None, alias="stop_sequences")
|
||||
stop_sequences: Optional[List[str]] = Field(None, alias="stop")
|
||||
"""Default stop sequences."""
|
||||
|
||||
anthropic_api_url: Optional[str] = Field(None, alias="base_url")
|
||||
@ -614,7 +614,7 @@ class ChatAnthropic(BaseChatModel):
|
||||
) -> Dict:
|
||||
# get system prompt if any
|
||||
system, formatted_messages = _format_messages(messages)
|
||||
stop_sequences = stop or self.stop
|
||||
stop_sequences = stop or self.stop_sequences
|
||||
rtn = {
|
||||
"model": self.model,
|
||||
"max_tokens": self.max_tokens,
|
||||
|
Loading…
Reference in New Issue
Block a user