Bot_Development / config.py
dsmultimedika's picture
fix : update code
0767396
raw
history blame contribute delete
979 Bytes
from pydantic_settings import BaseSettings
from dotenv import load_dotenv
import os
load_dotenv()
class MysqlConfig(BaseSettings):
DB_HOST: str = ""
DB_PORT: str = "10707" # Default MySQL port
DB_URI: str = ""
DB_USERNAME: str = ""
DB_PASSWORD: str = ""
DB_NAME: str = ""
DB_URI_SQL_ALCHEMY: str = ""
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "allow" # Allow extra fields
class PineconeConfig(BaseSettings):
PINECONE_API_KEY: str = ""
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "allow" # Allow extra fields
class GPTBotConfig(BaseSettings):
temperature : float = 0.3
model : str = "gpt-4o-mini"
max_tokens : int = 4096
streaming : bool = False
api_key : str = os.environ.get("OPENAI_API_KEY")
# Load configuration
MYSQL_CONFIG = MysqlConfig()
PINECONE_CONFIG = PineconeConfig()
GPTBOT_CONFIG = GPTBotConfig()