anthropic[patch]: fix format output args (#18816)

This commit is contained in:
Erick Friis 2024-03-08 12:34:11 -08:00 committed by GitHub
parent 2b0cbd65ba
commit 8c0b215c02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,7 +273,7 @@ class ChatAnthropic(BaseChatModel):
) -> ChatResult: ) -> ChatResult:
params = self._format_params(messages=messages, stop=stop, **kwargs) params = self._format_params(messages=messages, stop=stop, **kwargs)
data = self._client.messages.create(**params) data = self._client.messages.create(**params)
return self._format_output(data, **kwargs) return self._format_output(data)
async def _agenerate( async def _agenerate(
self, self,
@ -284,7 +284,7 @@ class ChatAnthropic(BaseChatModel):
) -> ChatResult: ) -> ChatResult:
params = self._format_params(messages=messages, stop=stop, **kwargs) params = self._format_params(messages=messages, stop=stop, **kwargs)
data = await self._async_client.messages.create(**params) data = await self._async_client.messages.create(**params)
return self._format_output(data, **kwargs) return self._format_output(data)
@deprecated(since="0.1.0", removal="0.2.0", alternative="ChatAnthropic") @deprecated(since="0.1.0", removal="0.2.0", alternative="ChatAnthropic")