Skip to content

🔍 feat: Web Search via OpenAI Responses API #8186

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

Merged
merged 3 commits into from
Jul 2, 2025

Conversation

dustinhealy
Copy link
Collaborator

Summary

This pull request introduces a new Web Search toggle to the OpenAI parameters panel, enabling OpenAI's built-in web search functionality for more accurate and up-to-date responses. It also includes UI and backend changes to support this feature, along with a minor UI adjustment to the DynamicSlider component.

New Feature: Web Search Functionality

  • Added a new web_search parameter to enable OpenAI's web search. This includes updates to schemas (tConversationSchema, openAIBaseSchema), types (IConversation), and configurations (openAIParams, openAICol2). [1] [2] [3] [4] [5] [6]
  • Updated the getOpenAIConfig function to handle the web_search parameter, enabling the Responses API and adding web search tools when the feature is active. [1] [2]
  • Enhanced the useSetIndexOptions hook to automatically enable the Responses API when web search is activated.
  • Added a new translation key for the web search feature in translation.json.

Backend Enhancements

  • Updated the LLMConfigResult type to include an optional tools array for web search tools.
  • Imported BindToolsInput in relevant files to support the new tools configuration. [1] [2]

UI Improvements

  • Adjusted the DynamicSlider component to improve input alignment and spacing.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Demonstration

cap-web-search.mp4

Testing

Manually tested in LibreChat with an OpenAI model by asking for the current date and other timely events to verify search was being used for responses.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes
  • A pull request for updating the documentation has been submitted.

@dustinhealy dustinhealy marked this pull request as ready for review July 2, 2025 06:43
@dustinhealy dustinhealy requested a review from danny-avila July 2, 2025 06:44
- Added a new web_search parameter to enable web search capabilities in the OpenAI configuration.
- Updated the DynamicSlider component for improved styling.
- Enhanced the useSetIndexOptions hook to auto-enable the Responses API when web search is activated.
- Modified relevant schemas, types, and translation files to support the new web search feature.
@danny-avila danny-avila force-pushed the feat/openai-web-search branch from 67cd9ce to c3a08f1 Compare July 2, 2025 13:41
@danny-avila danny-avila changed the title 🔍 feat: Introduce Web Search Functionality for OpenAI API 🔍 feat: Web Search via OpenAI Responses API Jul 2, 2025
) {
throw new Error(`{ "type": "${ErrorTypes.GOOGLE_TOOL_CONFLICT}"}`);
} else if (
Copy link
Owner

Choose a reason for hiding this comment

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

@dustinhealy edited here to reflect openai support for external tools along with builtin tools, unlike google.

@danny-avila danny-avila merged commit 8ba61a8 into dev Jul 2, 2025
7 checks passed
@danny-avila danny-avila deleted the feat/openai-web-search branch July 2, 2025 14:03
miguelwon pushed a commit to miguelwon/LibreChat that referenced this pull request Jul 9, 2025
* 🔍 feat: Introduce Web Search Functionality for OpenAI API

- Added a new web_search parameter to enable web search capabilities in the OpenAI configuration.
- Updated the DynamicSlider component for improved styling.
- Enhanced the useSetIndexOptions hook to auto-enable the Responses API when web search is activated.
- Modified relevant schemas, types, and translation files to support the new web search feature.

* chore: remove comments

* refactor: tool handling in initializeAgent for better clarity and functionality and reflection of openai features

---------

Co-authored-by: Danny Avila <[email protected]>
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Aug 4, 2025
* 🔍 feat: Introduce Web Search Functionality for OpenAI API

- Added a new web_search parameter to enable web search capabilities in the OpenAI configuration.
- Updated the DynamicSlider component for improved styling.
- Enhanced the useSetIndexOptions hook to auto-enable the Responses API when web search is activated.
- Modified relevant schemas, types, and translation files to support the new web search feature.

* chore: remove comments

* refactor: tool handling in initializeAgent for better clarity and functionality and reflection of openai features

---------

Co-authored-by: Danny Avila <[email protected]>
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.

2 participants