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
|
|
@ -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,
|
||||
);
|
||||
|
||||
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: {
|
||||
runId,
|
||||
llmConfig,
|
||||
tools,
|
||||
toolMap,
|
||||
instructions: agent.instructions,
|
||||
additional_instructions: agent.additional_instructions,
|
||||
},
|
||||
graphConfig,
|
||||
customHandlers,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue