Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🌐 chore: Update tool type from `web_search_preview` to `web_search` for OpenAI (#10379)

Danny Avila8124344c51f0
diff --git a/packages/api/src/endpoints/openai/config.backward-compat.spec.ts b/packages/api/src/endpoints/openai/config.backward-compat.spec.ts
index 0411fe43d5..78b854b4b0 100644
--- a/packages/api/src/endpoints/openai/config.backward-compat.spec.ts
+++ b/packages/api/src/endpoints/openai/config.backward-compat.spec.ts
@@ -48,7 +48,7 @@ describe('getOpenAIConfig - Backward Compatibility', () => {
configOptions: {},
tools: [
{
- type: 'web_search_preview',
+ type: 'web_search',
},
],
});
diff --git a/packages/api/src/endpoints/openai/config.spec.ts b/packages/api/src/endpoints/openai/config.spec.ts
index b1faac9012..fcdf0fa83d 100644
--- a/packages/api/src/endpoints/openai/config.spec.ts
+++ b/packages/api/src/endpoints/openai/config.spec.ts
@@ -230,7 +230,7 @@ describe('getOpenAIConfig', () => {
const result = getOpenAIConfig(mockApiKey, { modelOptions });
expect(result.llmConfig.useResponsesApi).toBe(true);
- expect(result.tools).toEqual([{ type: 'web_search_preview' }]);
+ expect(result.tools).toEqual([{ type: 'web_search' }]);
});
it('should handle web_search from addParams overriding modelOptions', () => {
@@ -247,7 +247,7 @@ describe('getOpenAIConfig', () => {
const result = getOpenAIConfig(mockApiKey, { modelOptions, addParams });
expect(result.llmConfig.useResponsesApi).toBe(true);
- expect(result.tools).toEqual([{ type: 'web_search_preview' }]);
+ expect(result.tools).toEqual([{ type: 'web_search' }]);
// web_search should not be in modelKwargs or llmConfig
expect((result.llmConfig as Record<string, unknown>).web_search).toBeUndefined();
expect(result.llmConfig.modelKwargs).toEqual({ customParam: 'value' });
@@ -299,7 +299,7 @@ describe('getOpenAIConfig', () => {
// Should keep the original web_search from modelOptions since addParams value is not boolean
expect(result.llmConfig.useResponsesApi).toBe(true);
- expect(result.tools).toEqual([{ type: 'web_search_preview' }]);
+ expect(result.tools).toEqual([{ type: 'web_search' }]);
expect(result.llmConfig.temperature).toBe(0.7);
// web_search should not be added to modelKwargs
expect(result.llmConfig.modelKwargs).toBeUndefined();
@@ -335,7 +335,7 @@ describe('getOpenAIConfig', () => {
// web_search should trigger the tool but not appear in config
expect(result.llmConfig.useResponsesApi).toBe(true);
- expect(result.tools).toEqual([{ type: 'web_search_preview' }]);
+ expect(result.tools).toEqual([{ type: 'web_search' }]);
expect((result.llmConfig as Record<string, unknown>).web_search).toBeUndefined();
expect(result.llmConfig.temperature).toBe(0.5);
expect(result.llmConfig.modelKwargs).toEqual({ customParam1: 'value1' });
@@ -1164,7 +1164,7 @@ describe('getOpenAIConfig', () => {
text: { verbosity: Verbosity.medium },
customParam: 'custom-value',
});
- expect(result.tools).toEqual([{ type: 'web_search_preview' }]);
+ expect(result.tools).toEqual([{ type: 'web_search' }]);
expect(result.configOptions).toMatchObject({
baseURL: 'https://api.custom.com',
defaultHeaders: { 'X-Custom': 'value' },
diff --git a/packages/api/src/endpoints/openai/llm.ts b/packages/api/src/endpoints/openai/llm.ts
index 4ce896e291..ee2a3da330 100644
--- a/packages/api/src/endpoints/openai/llm.ts
+++ b/packages/api/src/endpoints/openai/llm.ts
@@ -190,7 +190,7 @@ export function getOpenAILLMConfig({
} else if (enableWebSearch) {
/** Standard OpenAI web search uses tools API */
llmConfig.useResponsesApi = true;
- tools.push({ type: 'web_search_preview' });
+ tools.push({ type: 'web_search' });
}
/**