mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 16:39:20 +00:00
anthropic[patch]: allow pop by field name (#16544)
allow `ChatAnthropicMessages(model=...)`
This commit is contained in:
parent
a91181fe6d
commit
5c2538b9f7
@ -88,6 +88,11 @@ class ChatAnthropicMessages(BaseChatModel):
|
|||||||
|
|
||||||
model_kwargs: Dict[str, Any] = Field(default_factory=dict)
|
model_kwargs: Dict[str, Any] = Field(default_factory=dict)
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
"""Configuration for this pydantic object."""
|
||||||
|
|
||||||
|
allow_population_by_field_name = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _llm_type(self) -> str:
|
def _llm_type(self) -> str:
|
||||||
"""Return type of chat model."""
|
"""Return type of chat model."""
|
||||||
|
@ -7,3 +7,4 @@ from langchain_anthropic.chat_models import ChatAnthropicMessages
|
|||||||
def test_initialization() -> None:
|
def test_initialization() -> None:
|
||||||
"""Test chat model initialization."""
|
"""Test chat model initialization."""
|
||||||
ChatAnthropicMessages(model_name="claude-instant-1.2", anthropic_api_key="xyz")
|
ChatAnthropicMessages(model_name="claude-instant-1.2", anthropic_api_key="xyz")
|
||||||
|
ChatAnthropicMessages(model="claude-instant-1.2", anthropic_api_key="xyz")
|
||||||
|
Loading…
Reference in New Issue
Block a user