Streamable tool calls with Anthropic Models#176
Open
ActuallyTaylor wants to merge 11 commits into
Open
Conversation
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Previously, tool use would cancel the response. This meant that the model would never get to use the result of its tools. This fix adds an infinite loop similair to the OpenAI implementation Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
This also brings tool support in the streaming endpoint for anthropic models Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a streaming transcript object that allows the streaming endpoints to stream tool calls back to the user as the model works.
Features
Session.transcriptautomatically updates as content is streamed.Thinking.initto take a specified type, budget tokens, and display type instead of a static type..adaptive(display:)and.enabled(budgetTokens:,display:)to easily create thinking structures configured to match the Anthropic APIs.Other Approaches
I first attempted to stream the transcript through a second API named
streamTranscript. I decided not to go down this route since it would require duplicated streaming code in the model, as well as the need to make every transcript structure conform toGenerableandPartiallyGenerated.Support
Currently only supported on the Anthropic Provider.