Skip to content

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
app.listen(port, () => {
app.listen(port, async () => {
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

4 participants