mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🔧 fix: Update maxContextTokens calculation to use correct model identifier for Azure (#5035)
This commit is contained in:
parent
e8bde332c2
commit
22a87b6162
1 changed files with 4 additions and 1 deletions
|
@ -122,13 +122,16 @@ const initializeAgentOptions = async ({
|
|||
agent.model_parameters.model = agent.model;
|
||||
}
|
||||
|
||||
const tokensModel =
|
||||
agent.provider === EModelEndpoint.azureOpenAI ? agent.model : agent.model_parameters.model;
|
||||
|
||||
return {
|
||||
...agent,
|
||||
tools,
|
||||
toolContextMap,
|
||||
maxContextTokens:
|
||||
agent.max_context_tokens ??
|
||||
getModelMaxTokens(agent.model_parameters.model, providerEndpointMap[provider]) ??
|
||||
getModelMaxTokens(tokensModel, providerEndpointMap[provider]) ??
|
||||
4000,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue