mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
74c7198906
resolves https://github.com/langchain-ai/langchain/issues/23911 When an AIMessageChunk is instantiated, we attempt to parse tool calls off of the tool_call_chunks. Here we add a special-case to this parsing, where `""` will be parsed as `{}`. This is a reaction to how Anthropic streams tool calls in the case where a function has no arguments: ``` {'id': 'toolu_01J8CgKcuUVrMqfTQWPYh64r', 'input': {}, 'name': 'magic_function', 'type': 'tool_use', 'index': 1} {'partial_json': '', 'type': 'tool_use', 'index': 1} ``` The `partial_json` does not accumulate to a valid json string-- most other providers tend to emit `"{}"` in this case. |
||
---|---|---|
.. | ||
ai21 | ||
airbyte | ||
anthropic | ||
azure-dynamic-sessions | ||
chroma | ||
couchbase | ||
exa | ||
fireworks | ||
groq | ||
huggingface | ||
ibm | ||
milvus | ||
mistralai | ||
mongodb | ||
nomic | ||
openai | ||
pinecone | ||
prompty | ||
qdrant | ||
robocorp | ||
together | ||
upstage | ||
voyageai |