Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 10, 2025

Summary

  • Add toOpenAIResponses() method to BaseTool and Tools classes for converting tools to OpenAI's new Responses API format
  • Strict mode enabled by default (recommended by OpenAI)
  • Add example file demonstrating usage

Fixes #162

Test plan

  • Unit tests for BaseTool.toOpenAIResponses() with strict enabled/disabled
  • Unit tests for Tools.toOpenAIResponses() with strict enabled/disabled
  • Build passes
  • Lint passes

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 } }).
@ryoppippi ryoppippi requested a review from a team as a code owner December 10, 2025 17:29
Copilot AI review requested due to automatic review settings December 10, 2025 17:29
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@206

commit: c6a43ed

Copy link

Copilot AI left a 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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

Copy link
Contributor

@glebedel glebedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryoppippi ryoppippi merged commit 1e286cf into main Dec 11, 2025
9 checks passed
@ryoppippi ryoppippi deleted the feat/openai-responses-api branch December 11, 2025 16:13
This was referenced Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

response api integration

3 participants