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

Error in OpenAIHandler when apiKey and baseUrl are Specified #12

Closed
enricobellato opened this issue Jan 1, 2024 · 0 comments
Closed

Comments

@enricobellato
Copy link
Contributor

Description

When apiKey and baseUrl parameters are passed to the OpenAIHandler, an error is thrown by the underlying OpenAI JavaScript library. This issue arises because these parameters, along with others, are directly passed to the completion function using the spread operator, which causes conflicts.

Steps to Reproduce

  1. Call OpenAIHandler with apiKey and baseUrl parameters.
  2. Observe that the library throws an error.

Expected Behavior

The OpenAIHandler should correctly separate the parameters for creating a new OpenAI object and the subset of parameters needed for the completions API call.

Actual Behavior

An error is thrown due to parameter conflicts when apiKey and baseUrl are provided.

Proposed Solution

Modify OpenAIHandler to separate the initialization parameters (apiKey, baseUrl) from the completion call parameters. This can be achieved by explicitly passing only the necessary parameters to the completions API call.

I will be submitting a pull request shortly to address this issue.

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

No branches or pull requests

2 participants