Skip to content

Add custom_tools support for OpenAI adapters#4248

Merged
kompfner merged 4 commits intopipecat-ai:mainfrom
omChauhanDev:add-openai-custom-tools-support
Apr 10, 2026
Merged

Add custom_tools support for OpenAI adapters#4248
kompfner merged 4 commits intopipecat-ai:mainfrom
omChauhanDev:add-openai-custom-tools-support

Conversation

@omChauhanDev
Copy link
Copy Markdown
Contributor

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

Fixes : #3971

Changes

  • Adds AdapterType.OPENAI to the ToolsSchema enum, following the existing AdapterType.GEMINI pattern for Gemini's google_search
  • Wires up custom_tools in all three OpenAI adapters (Chat Completions, Responses, Realtime) so provider-specific tools like tool_search from GPT 5.4 can be passed through
  • Fully opt-in : existing behavior is unchanged unless users explicitly set custom_tools={AdapterType.OPENAI: [...]}

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/pipecat/adapters/schemas/tools_schema.py 86.66% <100.00%> (+0.45%) ⬆️
src/pipecat/adapters/services/open_ai_adapter.py 72.41% <100.00%> (+2.04%) ⬆️
...ecat/adapters/services/open_ai_realtime_adapter.py 69.31% <100.00%> (+1.46%) ⬆️
...cat/adapters/services/open_ai_responses_adapter.py 85.85% <100.00%> (+0.44%) ⬆️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@omChauhanDev omChauhanDev force-pushed the add-openai-custom-tools-support branch from d67acfc to 1443dfb Compare April 8, 2026 03:18
Comment thread changelog/4248.added.md Outdated
Comment thread src/pipecat/adapters/services/open_ai_adapter.py Outdated
Comment thread src/pipecat/adapters/services/open_ai_responses_adapter.py Outdated
Copy link
Copy Markdown
Contributor

@kompfner kompfner left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the contributions! Happy to address the nitpicks myself before merging.

These are TypedDicts (plain dicts at runtime), so no behavioral change
— just more descriptive type hints for readers. Use ToolParam instead
of FunctionToolParam for the Responses adapter to reflect that custom
non-function tools are supported. Use ChatCompletionToolParam instead
of Any for the completions adapter return type. Update tests to use
typed params in expected values.
@kompfner kompfner merged commit d07eebf into pipecat-ai:main Apr 10, 2026
5 of 6 checks passed
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.

request to support tool_search introduced in gpt 5.4 in pipecat/pipecat-flows

2 participants