mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
fix: add streamBuffer and streamRate to help prevent 'Overloaded' errors from Anthropic API
This commit is contained in:
parent
acd9088a6d
commit
f593de85b2
3 changed files with 21 additions and 14 deletions
|
|
@ -43,7 +43,7 @@
|
|||
"@langchain/core": "^0.2.18",
|
||||
"@langchain/google-genai": "^0.0.11",
|
||||
"@langchain/google-vertexai": "^0.0.17",
|
||||
"@librechat/agents": "^1.4.7",
|
||||
"@librechat/agents": "^1.4.9",
|
||||
"axios": "^1.3.4",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const { Run } = require('@librechat/agents');
|
||||
const { Run, Providers } = require('@librechat/agents');
|
||||
const { providerEndpointMap } = require('librechat-data-provider');
|
||||
|
||||
/**
|
||||
|
|
@ -43,15 +43,22 @@ async function createRun({
|
|||
modelOptions,
|
||||
);
|
||||
|
||||
return Run.create({
|
||||
graphConfig: {
|
||||
const graphConfig = {
|
||||
runId,
|
||||
llmConfig,
|
||||
tools,
|
||||
toolMap,
|
||||
instructions: agent.instructions,
|
||||
additional_instructions: agent.additional_instructions,
|
||||
},
|
||||
};
|
||||
|
||||
if (agent.provider === Providers.ANTHROPIC) {
|
||||
graphConfig.streamBuffer = 3000;
|
||||
graphConfig.streamRate = 30;
|
||||
}
|
||||
|
||||
return Run.create({
|
||||
graphConfig,
|
||||
customHandlers,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -52,7 +52,7 @@
|
|||
"@langchain/core": "^0.2.18",
|
||||
"@langchain/google-genai": "^0.0.11",
|
||||
"@langchain/google-vertexai": "^0.0.17",
|
||||
"@librechat/agents": "^1.4.7",
|
||||
"@librechat/agents": "^1.4.9",
|
||||
"axios": "^1.3.4",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
|
|
@ -10015,9 +10015,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@librechat/agents": {
|
||||
"version": "1.4.7",
|
||||
"resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.4.7.tgz",
|
||||
"integrity": "sha512-9HnotCsErbMG5TsOyePz5skiOsT/oF+XwXCcYm8oY1M/PbqiJI+xFib+ZkYzySUfi3f1KV75D6IB4PrFsbf2yw==",
|
||||
"version": "1.4.9",
|
||||
"resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.4.9.tgz",
|
||||
"integrity": "sha512-XHhQ/Pu0R8wwmXuQ+uSHXaCVVrGX08SnOSE1MHXLe14V6Litmyppd4dej9PVhVEOxfrWIwIGB84t9I3HGe9WZg==",
|
||||
"dependencies": {
|
||||
"@aws-crypto/sha256-js": "^5.2.0",
|
||||
"@aws-sdk/credential-provider-node": "^3.613.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue