langchain/libs
Jacob Lee c01467b1f4
core[patch]: RFC: Allow concatenation of messages with multi part content (#22002)
Anthropic's streaming treats tool calls as different content parts
(streamed back with a different index) from normal content in the
`content`.

This means that we need to update our chunk-merging logic to handle
chunks with multi-part content. The alternative is coerceing Anthropic's
responses into a string, but we generally like to preserve model
provider responses faithfully when we can. This will also likely be
useful for multimodal outputs in the future.

This current PR does unfortunately make `index` a magic field within
content parts, but Anthropic and OpenAI both use it at the moment to
determine order anyway. To avoid cases where we have content arrays with
holes and to simplify the logic, I've also restricted merging to chunks
in order.

TODO: tests

CC @baskaryan @ccurme @efriis
2024-06-03 09:46:40 -07:00
..
cli docs, cli[patch]: chat model template nit (#22294) 2024-05-29 20:53:58 +00:00
community community: fix AzureSearch delete documents (#22315) 2024-06-03 15:55:06 +00:00
core core[patch]: RFC: Allow concatenation of messages with multi part content (#22002) 2024-06-03 09:46:40 -07:00
experimental [experimental][llms][ollama_functions] Update OllamaFunctions to send tool_calls attribute (#21625) 2024-05-29 09:38:33 -04:00
langchain Update parent_document_retriever.py about **kwargs (#22219) 2024-05-28 11:35:38 -07:00
partners infra: bump anthropic mypy 1 (#22373) 2024-06-03 08:21:55 -07:00
standard-tests core, partners: add token usage attribute to AIMessage (#21944) 2024-05-23 14:21:58 -04:00
text-splitters fix error message (#22437) 2024-06-03 15:48:26 +00:00