mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 15:35:14 +00:00
General anthropic functions, steps towards experimental integration tests (#11727)
To match change in js here https://github.com/langchain-ai/langchainjs/pull/2892 Some integration tests need a bit more work in experimental:  Pretty sure the sqldatabase ones are an actual regression or change in interface because it's returning a placeholder. --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -124,11 +124,17 @@ def _destrip(tool_input: Any) -> Any:
|
||||
|
||||
|
||||
class AnthropicFunctions(BaseChatModel):
|
||||
model: ChatAnthropic
|
||||
llm: BaseChatModel
|
||||
|
||||
@root_validator(pre=True)
|
||||
def validate_environment(cls, values: Dict) -> Dict:
|
||||
return {"model": ChatAnthropic(**values)}
|
||||
values["llm"] = values.get("llm") or ChatAnthropic(**values)
|
||||
return values
|
||||
|
||||
@property
|
||||
def model(self) -> BaseChatModel:
|
||||
"""For backwards compatibility."""
|
||||
return self.llm
|
||||
|
||||
def _generate(
|
||||
self,
|
||||
|
Reference in New Issue
Block a user