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

Only initialize openAi instance if AI endpoint is called #1119

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

CodingDive
Copy link
Contributor

No description provided.

function getOpenAIInstance() {
if (!process.env.OPENAI_API_KEY) {
// eslint-disable-next-line no-console
console.error('OpenAI API key is not defined.')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this allowed in the api? What's the preferred function for logging?

packages/server/src/model/ai.ts Outdated Show resolved Hide resolved
Mikey Stengel and others added 2 commits November 14, 2023 19:38
@kulla kulla enabled auto-merge November 14, 2023 18:48
@kulla kulla added this pull request to the merge queue Nov 14, 2023
Merged via the queue into main with commit 84101b3 Nov 14, 2023
10 checks passed
@kulla kulla deleted the fix/openai-api-key-undefined branch November 14, 2023 19:39
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