mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01: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;
|
agent.model_parameters.model = agent.model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tokensModel =
|
||||||
|
agent.provider === EModelEndpoint.azureOpenAI ? agent.model : agent.model_parameters.model;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...agent,
|
...agent,
|
||||||
tools,
|
tools,
|
||||||
toolContextMap,
|
toolContextMap,
|
||||||
maxContextTokens:
|
maxContextTokens:
|
||||||
agent.max_context_tokens ??
|
agent.max_context_tokens ??
|
||||||
getModelMaxTokens(agent.model_parameters.model, providerEndpointMap[provider]) ??
|
getModelMaxTokens(tokensModel, providerEndpointMap[provider]) ??
|
||||||
4000,
|
4000,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue