langchain/libs/partners
ccurme 74c7198906
core, anthropic[patch]: support streaming tool calls when function has no arguments (#23915)
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.
2024-07-05 18:57:41 +00:00
..
ai21 infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
airbyte infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
anthropic infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
azure-dynamic-sessions infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
chroma infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
couchbase infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
exa infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
fireworks infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
groq core, anthropic[patch]: support streaming tool calls when function has no arguments (#23915) 2024-07-05 18:57:41 +00:00
huggingface huggingface: Fix huggingface tei support (#22653) 2024-07-03 13:30:29 -07:00
ibm IBM: Added WatsonxChat passing params to invoke method (#23758) 2024-07-05 18:07:50 +00:00
milvus infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
mistralai infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
mongodb partners[patch]: MongoDB vectorstore to return and accept string IDs (#23818) 2024-07-03 14:14:08 -04:00
nomic infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
openai infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
pinecone infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
prompty prompty: docstring (#23152) 2024-06-19 12:50:58 -04:00
qdrant infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
robocorp infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
together core, anthropic[patch]: support streaming tool calls when function has no arguments (#23915) 2024-07-05 18:57:41 +00:00
upstage upstage: move to external repo (#22506) 2024-06-19 17:56:07 +00:00
voyageai infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00