feat(ContentToolResult): Add additional data and allow as tool return value#423
Merged
gadenbuie merged 14 commits intoApr 4, 2025
Merged
Conversation
hadley
reviewed
Apr 3, 2025
gadenbuie
commented
Apr 3, 2025
| result <- stream_merge_chunks(private$provider, result, chunk) | ||
| } | ||
| turn <- value_turn(private$provider, result, has_type = !is.null(type)) | ||
| turn <- private$match_tools(turn) |
Collaborator
Author
There was a problem hiding this comment.
The idea here is that we match requests to the tool definitions up-front, which allows ContentToolRequest to carry the tool definition.
With this in place, we don't need to pass the tools into invoke_tools(), we can instead pass the turn directly. This could also be helpful in the display of a tool request.
(It also ensures we have paired results/requests in the very unlikely event the LLM requests a tool even if there are no tools defined.)
gadenbuie
commented
Apr 3, 2025
cpsievert
reviewed
Apr 3, 2025
hadley
reviewed
Apr 3, 2025
hadley
left a comment
Member
There was a problem hiding this comment.
Looks like great progress. The API is really starting to come together.
| result <- stream_merge_chunks(private$provider, result, chunk) | ||
| } | ||
| turn <- value_turn(private$provider, result, has_type = !is.null(type)) | ||
| turn <- private$match_tools(turn) |
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.
Fixes #398
Fixes #399