-
Notifications
You must be signed in to change notification settings - Fork 3
feat(tool): add OpenAI Responses API integration #206
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
Add toOpenAIResponses() method to BaseTool and Tools classes for
converting tools to OpenAI's new Responses API format.
- Add FunctionTool type import from openai/resources/responses/responses
- Implement toOpenAIResponses() on BaseTool with strict mode (default: true)
- Implement toOpenAIResponses() on Tools class for batch conversion
- Add unit tests for both single tool and collection conversions
- Add example file demonstrating Responses API usage
The Responses API uses a flat structure ({ type, name, description,
strict, parameters }) unlike Chat Completions which uses nested
structure ({ type, function: { name, description, parameters } }).
commit: |
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No issues found across 3 files
glebedel
left a comment
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.
LGTM
Summary
toOpenAIResponses()method toBaseToolandToolsclasses for converting tools to OpenAI's new Responses API formatFixes #162
Test plan
BaseTool.toOpenAIResponses()with strict enabled/disabledTools.toOpenAIResponses()with strict enabled/disabled