mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🤖 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
This commit is contained in:
parent
47b72e8159
commit
528ee62eb1
12 changed files with 277 additions and 270 deletions
|
|
@ -13,7 +13,6 @@ const {
|
|||
const { extractBaseURL, constructAzureURL, genAzureChatCompletion } = require('~/utils');
|
||||
const { createContextHandlers } = require('./prompts');
|
||||
const { createCoherePayload } = require('./llm');
|
||||
const { Agent, ProxyAgent } = require('undici');
|
||||
const BaseClient = require('./BaseClient');
|
||||
const { logger } = require('~/config');
|
||||
|
||||
|
|
@ -186,10 +185,6 @@ class ChatGPTClient extends BaseClient {
|
|||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
dispatcher: new Agent({
|
||||
bodyTimeout: 0,
|
||||
headersTimeout: 0,
|
||||
}),
|
||||
};
|
||||
|
||||
if (this.isVisionModel) {
|
||||
|
|
@ -275,10 +270,6 @@ class ChatGPTClient extends BaseClient {
|
|||
opts.headers['X-Title'] = 'LibreChat';
|
||||
}
|
||||
|
||||
if (this.options.proxy) {
|
||||
opts.dispatcher = new ProxyAgent(this.options.proxy);
|
||||
}
|
||||
|
||||
/* hacky fixes for Mistral AI API:
|
||||
- Re-orders system message to the top of the messages payload, as not allowed anywhere else
|
||||
- If there is only one message and it's a system message, change the role to user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue