Skip to content

Commit 679c6e6

Browse files
committed
🤖 fix: GoogleClient Context Handling & GenAI Parameters (#5503)
* fix: remove legacy code for GoogleClient and fix model parameters for GenAI * refactor: streamline client init logic * refactor: remove legacy vertex clients, WIP remote vertex token count * refactor: enhance GoogleClient with improved type definitions and streamline token count method * refactor: remove unused methods and consolidate methods * refactor: remove examples * refactor: improve input handling logic in DynamicInput component * refactor: enhance GoogleClient with token usage tracking and context handling improvements * refactor: update GoogleClient to support 'learnlm' model and streamline model checks * refactor: remove unused text model handling in GoogleClient * refactor: record token usage for GoogleClient titles and handle edge cases * chore: remove unused undici, addresses verbose version warning
1 parent b87f8fe commit 679c6e6

File tree

12 files changed

+274
-267
lines changed

12 files changed

+274
-267
lines changed

api/app/clients/ChatGPTClient.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const {
1313
const { extractBaseURL, constructAzureURL, genAzureChatCompletion } = require('~/utils');
1414
const { createContextHandlers } = require('./prompts');
1515
const { createCoherePayload } = require('./llm');
16-
const { Agent, ProxyAgent } = require('undici');
1716
const BaseClient = require('./BaseClient');
1817
const { logger } = require('~/config');
1918

@@ -186,10 +185,6 @@ class ChatGPTClient extends BaseClient {
186185
headers: {
187186
'Content-Type': 'application/json',
188187
},
189-
dispatcher: new Agent({
190-
bodyTimeout: 0,
191-
headersTimeout: 0,
192-
}),
193188
};
194189

195190
if (this.isVisionModel) {
@@ -275,10 +270,6 @@ class ChatGPTClient extends BaseClient {
275270
opts.headers['X-Title'] = 'LibreChat';
276271
}
277272

278-
if (this.options.proxy) {
279-
opts.dispatcher = new ProxyAgent(this.options.proxy);
280-
}
281-
282273
/* hacky fixes for Mistral AI API:
283274
- Re-orders system message to the top of the messages payload, as not allowed anywhere else
284275
- If there is only one message and it's a system message, change the role to user

0 commit comments

Comments
 (0)