feat: add provider-native hosted tool support#1430
Merged
joshua-mo-143 merged 4 commits into0xPlaygrounds:mainfrom Mar 13, 2026
Merged
feat: add provider-native hosted tool support#1430joshua-mo-143 merged 4 commits into0xPlaygrounds:mainfrom
joshua-mo-143 merged 4 commits into0xPlaygrounds:mainfrom
Conversation
joshua-mo-143
requested changes
Mar 4, 2026
Collaborator
joshua-mo-143
left a comment
There was a problem hiding this comment.
looks mostly good. please see comment
Collaborator
|
Manually resolving/merging this in now as I think this'll be useful but don't want to abandon the original PR 🙂 |
…r-native-hosted-tools Made-with: Cursor # Conflicts: # rig/rig-core/src/providers/gemini/completion.rs
joshua-mo-143
approved these changes
Mar 11, 2026
|
Definitely would like to see this - web_search in particular is pretty important for a well-rounded client capable of research. |
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.
Relates #1053
Summary
This PR adds provider-native hosted tool support to Rig’s completion request flow, with first-class support in OpenAI Responses API and compatible forwarding in other providers.
The issue was that hosted tools (for example
web_search,file_search,computer_use) could not be expressed through existing function-only tool plumbing inresponses_api.Scope
This PR is intentionally focused on one facet: tool definition/request serialization for hosted/provider-native tools in completion flows.
It does not change agent loop behavior, tool execution semantics, or unrelated provider APIs.
It is also not complete due to me being new to the projects source code but I hope it will help to accelerate adding this feature.
Implementation
1) Provider-agnostic request surface (
completion/request.rs)ProviderToolDefinition:type/kind fieldCompletionRequest::with_provider_tool(...)CompletionRequest::with_provider_tools(...)CompletionRequestBuilder::provider_tool(...)CompletionRequestBuilder::provider_tools(...)additional_params.tools.2) OpenAI Responses API hosted tools (
providers/openai/responses_api/mod.rs)ResponsesToolDefinitionto represent both:web_search,file_search,computer_use, plus generic hosted type)ResponsesToolDefinition::function(...)ResponsesToolDefinition::hosted(...)ResponsesToolDefinition::web_search()ResponsesToolDefinition::file_search()ResponsesToolDefinition::computer_use()req.toolsadditional_params.toolsCompletionRequest::with_tool(s)ResponsesCompletionModel::with_tool(s)3) Provider forwarding support (same abstraction path)
xai,gemini,anthropic(completion + streaming): now extractadditional_params.toolsand merge with function tools.groq: maps provider-native tools into Groq’s