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

Update assistant to not crash on startup. #12

Merged
merged 1 commit into from
Sep 23, 2023
Merged

Conversation

stnguyen90
Copy link
Contributor

What does this PR do?

If the _APP_ASSISTANT_OPENAI_API_KEY env var was not set, the assistant would crash. This prevents that from happening and returns an error message if the key is not set.

Test Plan

With valid _APP_ASSISTANT_OPENAI_API_KEY set

Logs:

image

Request:

image

With invalid _APP_ASSISTANT_OPENAI_API_KEY set

Logs:

image

...

image

Request:

image

Without _APP_ASSISTANT_OPENAI_API_KEY set

Logs:

image

Request:

image

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 requested a review from TGlide September 19, 2023 19:05
main.js Outdated Show resolved Hide resolved
main.js Outdated
console.log(`Started server on port: ${port}`);
console.log('initializing search index...');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think still a typo with lowercase i

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

If the _APP_ASSISTANT_OPENAI_API_KEY env var was not set, the assistant
would crash. This prevents that from happening and returns an error
message if the key is not set.
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.

🐛 Bug Report: appwrite-assistant 1.4.2 Docker container doesn't start
3 participants