-
Notifications
You must be signed in to change notification settings - Fork 104
feat(ContentToolResult): Add additional data and allow as tool return value #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ContentToolResult): Add additional data and allow as tool return value #423
Conversation
| result <- stream_merge_chunks(private$provider, result, chunk) | ||
| } | ||
| turn <- value_turn(private$provider, result, has_type = !is.null(type)) | ||
| turn <- private$match_tools(turn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Fixes #398
Fixes #399