Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing Validation for azureApiKey in lib/utils/index.ts #335

Closed
2 tasks done
diogo-karma opened this issue Sep 9, 2024 · 0 comments · Fixed by #336
Closed
2 tasks done

[BUG] Missing Validation for azureApiKey in lib/utils/index.ts #335

diogo-karma opened this issue Sep 9, 2024 · 0 comments · Fixed by #336

Comments

@diogo-karma
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Vercel Runtime Logs

  • I have checked the Vercel Runtime Logs for errors (if applicable)

Current Behavior

The file lib/utils/index.ts fails to validate the azureApiKey variable from the .env file. This issue causes errors when the azureApiKey is the only key present. The validation logic needs to be updated to include azureApiKey along with the other keys.

if (
    !(ollamaBaseUrl && ollamaModel) &&
    !openaiApiKey &&
    !googleApiKey &&
    !anthropicApiKey
  ) {
    throw new Error(
      'Missing environment variables for Ollama, OpenAI, Azure OpenAI, Google or Anthropic'
    )
  }

Expected Behavior

if (
    !(ollamaBaseUrl && ollamaModel) &&
    !openaiApiKey &&
    !googleApiKey &&
    !azureApiKey &&
    !anthropicApiKey
  ) {
    throw new Error(
      'Missing environment variables for Ollama, OpenAI, Azure OpenAI, Google or Anthropic'
    )
  }

Steps To Reproduce

'Missing environment variables for Ollama, OpenAI, Azure OpenAI, Google or Anthropic'

Environment

Linux kpax 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug  2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
&
Vercel

Anything else?

No response

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 a pull request may close this issue.

1 participant