Meet the AI Chat Assistant β your go-to Discord chat bot! π Tired of handling user questions in your server? This bot has got you covered. π€ It provides community details and helpful commands to tackle common Discord issues. Plus, stay in the loop with event updates from Twitter every three hours. π Discord management made easy! π
How the tool works:
- Install Python 3.10 or above on your machine.
- Install Pip.
- Obtain an OpenAI API key:
- Log in to the OpenAI website.
- Go to the "API keys" section.
- Generate your API key.
- (Optional) Obtain a Twitter bearer key:
- Go to the Twitter Developer Platform.
- Create a developer account and create a Twitter App.
- Obtain the bearer key from the App's Keys and Tokens section.
- Now, follow the steps below to install packages and run the app.
-
Rename the
.env_examplefile in the root directory of the project to.env. Replace theOPENAI_API_TOKENconfiguration value with your key{OPENAI_API_KEY}. You can also edit max tokens and other options if you wish. -
Run the
Communitydata.pyto get basic data about your community. You can also add more details according to your need by editing the file/Data/Basic_community_details.txt -
(OPTIONAL) If you want to incorporate the latest updates from Twitter/X, you need to replace '<your_bearer_token>' with your
Bearer Keyobtained and '<Community_twitter_Id>' with your Twitter Id. You can also modify the number of tweets available. -
(OPTIONAL) Run the
Tweetsscrap.pyto fetch data from Twitter/X tweets; the tweets get updated every 3 hours. -
From the project root folder, open your terminal and run
docker compose build. -
After the build is complete, run
docker compose upto start the app. -
Visit
localhost:8501on your browser after docker containers are up.
git clone https://github.com/Asinsayedali/AI-ChatAssistant.gitNavigate to the project folder:
cd AI-ChatAssistantRename the .env_example file in the root directory of the project to .env. Replace the OPENAI_API_TOKEN configuration value with your key {OPENAI_API_KEY}.You can also edit max tokens and other options if you wish.
Install the required packages to run the app:
pip install --upgrade -r requirements.txtpython Communitydata.pyEnter the Data according to questions asked. You can also add more details according to your need by editing the file /Data/Basic_community_details.txt
Before running the script ensure to replace '<your_bearer_token>' with your Bearer Key obtained and '<Community_twitter_Id>' with your Twitter Id. You can also modify the number of tweets available. The script is scheduled to run every 3 hours, fetching the most recent tweets from the platform.
python Tweetsscrap.pyYou can start the application by running main.py:
python main.pyYou can run the UI by running Streamlit app:
streamlit run ui.pyIt connects to the Pathway's backend API automatically and you will see the UI running on your browser at localhost:8501.
NOTE:
-
To retrieve tweet data from the Twitter API, please note that, due to recent policy updates, access to tweets data now requires a Basic plan subscription. The free plan no longer provides the capability to fetch tweets data. Consider upgrading to the Basic plan for uninterrupted access to this feature.
-
Include only essential and relevant data in the app; unnecessary information should be omitted.
