tmc / langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
https://tmc.github.io/langchaingo/
MIT License
5.03k stars 649 forks source link

anthropic: improve handling of multipart tool responses #1011

Open lonelycode opened 2 months ago

lonelycode commented 2 months ago

fixes #1010

PR Checklist

bloeys commented 1 week ago

Just wanted to note that while this (and related commits by @lonelycode) do solve the problem and give a proper tool response, I notice tool calls are not streamed. This can be extremely helpful when tool arguments are very long.

We can either include a new 'WithToolStreamingFunc' or send tool chunks into the existing streaming function with perhaps some prefix (risk of false-positive), or just update the existing function signature (breaking change, but should be fine as we are still v0.x)