-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: enable native tool calling for openai-native provider #9348
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
Conversation
- Update model definitions to support native tools - Implement tool calling using OpenAI Responses API (flat tool structure) - Fix conversation history format for tool calls and results - Add strict mode schema transformation - Handle streaming tool calls and result accumulation
Review complete. No new issues found. The latest commit simplifies tool call handling by removing redundant duplicate prevention logic. The change correctly uses the presence in Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Review complete. No issues were identified in this review. Native tool calling, strict tool schemas, and Responses API event handling all look consistent with the existing provider contracts.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Tool definitions already comply with OpenAI Structured Outputs spec: - All tools already have strict: true - All tools already have additionalProperties: false - All properties are already in required arrays - Optional properties already use union types with null The transformation adds unnecessary complexity and potential bugs without providing any benefit.
OpenAI's Structured Outputs requires all properties to be in the 'required' array, even optional ones (which use nullable types). The simplified transformation: - Only ensures all properties are listed in required array - Recursively processes nested objects and array items - Doesn't modify type definitions (already correct in our tools) - Much simpler than the original complex transformation
Simplified tool call handling by removing:
- yieldedCallIds Set for duplicate prevention
- Redundant checks before yielding tool calls
- Defensive default arguments ('|| "{}"')
Kept the completion event fallback as it's useful for handling
incomplete tool calls that didn't get a done event.
The implementation now more closely matches the cleaner roo.ts approach
while maintaining the completion fallback for reliability.
Important
Enables native tool calling for OpenAI-native provider by updating model configurations and handling tool call events in
OpenAiNativeHandler.supportsNativeTools: trueto multiple models inopenai.ts, enabling native tool calling.response.tool_call_arguments.delta,response.tool_call_arguments.done) inOpenAiNativeHandlerinopenai-native.ts.processEvent()inopenai-native.tsto accumulate and yield tool call data.handleResponsesApiMessage()andbuildRequestBody()to support tool metadata.currentToolCallsmap toOpenAiNativeHandlerto track tool call arguments.This description was created by
for c0cbde8. You can customize this summary. It will automatically update as commits are pushed.