fixed some things
This commit is contained in:
11
README.md
11
README.md
@@ -1,10 +1,9 @@
|
||||
Create an directory where you create an empty __init__.py file.
|
||||
Set the following as Environement variables:
|
||||
|
||||
In the same directory create a config.py file and configure the following:
|
||||
|
||||
openai_api_key = 'YOUR_OPENAI_API_KEY'
|
||||
discord_bot_token = 'YOUR_DISCORD_BOT_TOKEN'
|
||||
assistant_id = 'YOUR_OPENAI_ASSISTANT_ID'
|
||||
OPENAI_API_KEY
|
||||
DISCORD_BOT_TOKEN
|
||||
ASSISTANT_ID
|
||||
|
||||
Default settings:
|
||||
message_chunk_size = 2000
|
||||
thread_inactivity_timeout_hours = 1
|
||||
@@ -4,16 +4,16 @@ from openai import AsyncOpenAI
|
||||
import logging
|
||||
import asyncio
|
||||
import time
|
||||
from config import config
|
||||
from collections import defaultdict
|
||||
from datetime import datetime, timedelta
|
||||
import os
|
||||
|
||||
# Configuration and Constants
|
||||
OPENAI_API_KEY = config.openai_api_key
|
||||
DISCORD_BOT_TOKEN = config.discord_bot_token
|
||||
ASSISTANT_ID = config.assistant_id
|
||||
MESSAGE_CHUNK_SIZE = config.message_chunk_size
|
||||
THREAD_INACTIVITY_TIMEOUT_HOURS = config.thread_inactivity_timeout_hours
|
||||
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
||||
DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN")
|
||||
ASSISTANT_ID = os.getenv("ASSISTANT_ID")
|
||||
MESSAGE_CHUNK_SIZE = 2000
|
||||
THREAD_INACTIVITY_TIMEOUT_HOURS = 1
|
||||
|
||||
# Setting up logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
Reference in New Issue
Block a user