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

fix: openai env instantiation #2

Merged
merged 1 commit into from
Dec 30, 2024
Merged

fix: openai env instantiation #2

merged 1 commit into from
Dec 30, 2024

Conversation

Evanc123
Copy link
Contributor

In sessionManager.ts the code loads the openAI api key from process.env.OPENAI_API_KEY, but does not itself load variables from a .env file (by running something like dotenv.config()), so if the key is not in the current environment a user will experience a silent failure.

This PR now passes the api key to sessionManager.ts from server.ts, and adds an assertion that the key should be non-null.

Copy link
Collaborator

@ibigio ibigio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ibigio ibigio merged commit 4e9f754 into openai:main Dec 30, 2024
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.

2 participants