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. |
||
---|---|---|
.. | ||
langchain_together | ||
scripts | ||
tests | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
poetry.lock | ||
pyproject.toml | ||
README.md |
langchain-together
This package contains the LangChain integrations for Together AI through their APIs.
Installation and Setup
- Install the LangChain partner package
pip install -U langchain-together
- Get your Together AI api key from the Together Dashboard and set it as an environment variable (
TOGETHER_API_KEY
)
Chat Completions
This package contains the ChatTogether
class, which is the recommended way to interface with Together AI chat models.
ADD USAGE EXAMPLE HERE. Can we add this in the langchain docs?
NEED to add image endpoint + completions endpoint as well
Embeddings
See a usage example
Use togethercomputer/m2-bert-80M-8k-retrieval
as the default model for embeddings.