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

📄 refactor: Add Provider Fallback for Media Encoding using Client Endpoint (#10656)

Zihao Zhou5b8f0cba0429
diff --git a/api/app/clients/BaseClient.js b/api/app/clients/BaseClient.js
index 149d331df1..c0d9169b51 100644
--- a/api/app/clients/BaseClient.js
+++ b/api/app/clients/BaseClient.js
@@ -1213,8 +1213,8 @@ class BaseClient {
this.options.req,
attachments,
{
- provider: this.options.agent?.provider,
- endpoint: this.options.agent?.endpoint,
+ provider: this.options.agent?.provider ?? this.options.endpoint,
+ endpoint: this.options.agent?.endpoint ?? this.options.endpoint,
useResponsesApi: this.options.agent?.model_parameters?.useResponsesApi,
},
getStrategyFunctions,
@@ -1231,8 +1231,8 @@ class BaseClient {
this.options.req,
attachments,
{
- provider: this.options.agent?.provider,
- endpoint: this.options.agent?.endpoint,
+ provider: this.options.agent?.provider ?? this.options.endpoint,
+ endpoint: this.options.agent?.endpoint ?? this.options.endpoint,
},
getStrategyFunctions,
);
@@ -1246,8 +1246,8 @@ class BaseClient {
this.options.req,
attachments,
{
- provider: this.options.agent?.provider,
- endpoint: this.options.agent?.endpoint,
+ provider: this.options.agent?.provider ?? this.options.endpoint,
+ endpoint: this.options.agent?.endpoint ?? this.options.endpoint,
},
getStrategyFunctions,
);