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

App initialization #89

Merged
merged 8 commits into from
Aug 21, 2023

Conversation

oshoma
Copy link
Collaborator

@oshoma oshoma commented Aug 15, 2023

Make app initialization more robust and maintainable, and resolve #48

I don't have Pinecone set up yet, so this is worth testing with Pinecone before merging into master.

oshoma added 3 commits August 16, 2023 09:17
This names all SLACK environment variables consistently.

After merging this change you must rename the variable in your .env file
or in the production runtime environment and restart the app.
1. Briefly document environment variables in `sample.env`. We need to
update this file when we add, remove or rename environment variables.

2. Remove overlap between README.md and Tutorials/slackbot.rst.

3. Better distinguish between optional and mandatory values.
1. Move all initialization code to top of app_bolt.py.

2. Warn user and exit app when mandatory keys are undefined.
@oshoma oshoma force-pushed the app-initialization branch from 2a0e236 to 8775657 Compare August 16, 2023 13:18
@amirfz amirfz requested a review from 20001LastOrder August 16, 2023 13:24
Copy link
Collaborator

@20001LastOrder 20001LastOrder left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Please check the comment above.

apps/slackbot/.env-sample Show resolved Hide resolved
apps/slackbot/bolt_app.py Outdated Show resolved Hide resolved
oshoma added 4 commits August 16, 2023 23:38
1. Fixes Aggregate-Intellect#48

2. Warn user and exit app if Pinecone API key is set and other Pinecone
keys are not set.
Moving forward, modules should access environment variables via config.

Usage:

    First define variables in runtime environment or in your `.env` file.
    Then, ...

    import Config as cfg
    secret = cfg.SLACK_SIGNING_SECRET
    another_variable = cfg.ANOTHER_ENVIRONMENT_VARIABLE
If you are using AWS, rename these variables in your .env or production
environment and restart your app to pick up the changes.

ACCESS_KEY -> AWS_ACCESS_KEY
SECRET_KEY -> AWS_SECRET_KEY
Rename this variable in your .env or production environment and restart
your app to pick up the changes.

OPENAI_KEY -> OPENAI_API_KEY
@oshoma oshoma force-pushed the app-initialization branch from 8775657 to 9c0ea28 Compare August 17, 2023 03:42
@oshoma oshoma requested a review from 20001LastOrder August 17, 2023 03:44
If you are using the Github API, rename this variable in your .env or
production environment and restart your app to pick up the changes.

API_KEY -> GITHUB_AUTH_TOKEN
@oshoma oshoma force-pushed the app-initialization branch from 49bf9be to 370b80d Compare August 17, 2023 03:53
@20001LastOrder 20001LastOrder merged commit 6671d26 into Aggregate-Intellect:main Aug 21, 2023
@oshoma oshoma deleted the app-initialization branch August 21, 2023 21:07
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.

Namespace for Pinecone Database is Hard-Coded
2 participants