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

Fix setOptions() to properly handle modelOptions (#975)

jordantghd13a7b1a74c5
diff --git a/api/app/clients/OpenAIClient.js b/api/app/clients/OpenAIClient.js
index 9a6c61a3a4..866891ea38 100644
--- a/api/app/clients/OpenAIClient.js
+++ b/api/app/clients/OpenAIClient.js
@@ -59,6 +59,12 @@ class OpenAIClient extends BaseClient {
typeof modelOptions.presence_penalty === 'undefined' ? 1 : modelOptions.presence_penalty,
stop: modelOptions.stop,
};
+ } else {
+ // Update the modelOptions if it already exists
+ this.modelOptions = {
+ ...this.modelOptions,
+ ...modelOptions,
+ };
}
if (process.env.OPENROUTER_API_KEY) {