这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@timothycarambat
Copy link
Member

resolves #511

@timothycarambat timothycarambat marked this pull request as ready for review January 2, 2024 20:49
@timothycarambat timothycarambat merged commit ceadc8d into master Jan 2, 2024
@timothycarambat timothycarambat deleted the 511-azure-128k-gpt-4-turbo branch January 2, 2024 20:49
@review-agent-prime
Copy link

server/utils/helpers/updateENV.js

Using a Set instead of an Array for the token limit check can improve the performance of the function. The Set.has() method has a time complexity of O(1) while the Array.includes() method has a time complexity of O(n).
Create Issue
See the diff
Checkout the fix

    const validTokenLimits = new Set([4_096, 16_384, 8_192, 32_768, 128_000]);
    if (!validTokenLimits.has(tokenLimit))
      return "Invalid OpenAI token limit.";
git fetch origin && git checkout -b ReviewBot/Impro-641jvd7 origin/ReviewBot/Impro-641jvd7

cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid OpenAI Token Limit

2 participants