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
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
fix: add proxy to titleConvo
Wentao Lyu4a39965b22d1
diff --git a/api/app/titleConvo.js b/api/app/titleConvo.jsindex e0461eabaf..52e35b841a 100644--- a/api/app/titleConvo.js+++ b/api/app/titleConvo.js@@ -1,5 +1,21 @@const { Configuration, OpenAIApi } = require('openai');+const proxyEnvToAxiosProxy = (proxyString) => {+ if (!proxyString) return null;++ const regex = /^([^:]+):\/\/(?:([^:@]*):?([^:@]*)@)?([^:]+)(?::(\d+))?/;+ const [, protocol, username, password, host, port] = proxyString.match(regex);+ const proxyConfig = {+ protocol,+ host,+ port: port ? parseInt(port) : undefined,+ auth: username && password ? { username, password } : undefined+ };++ return proxyConfig+}+console.log(proxyEnvToAxiosProxy(process.env.PROXY || null))+const titleConvo = async ({ message, response, model }) => {const configuration = new Configuration({apiKey: process.env.OPENAI_KEY@@ -15,7 +31,7 @@ const titleConvo = async ({ message, response, model }) => {},{ role: 'user', content: `In 5 words or less, summarize the conversation below with a title in title case using the language the user writes in. Don't refer to the participants of the conversation by name. Do not include punctuation or quotation marks. Your response should be in title case, exclusively containing the title. Conversation:\n\nUser: "${message}"\n\n${model}: "${response}"\n\nTitle: ` },]- });+ }, { proxy: proxyEnvToAxiosProxy(process.env.PROXY || null) });//eslint-disable-next-linereturn completion.data.choices[0].message.content.replace(/["\.]/g, '');