mirror of
https://github.com/hwchase17/langchain
synced 2024-11-11 19:11:02 +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. |
||
---|---|---|
.. | ||
__init__.py | ||
test_chat_models_standard.py | ||
test_chat_models.py | ||
test_compile.py | ||
test_embeddings.py | ||
test_llms.py |