Bot_Development / config.py
dsmultimedika's picture
Build Application
9002555
raw
history blame
No virus
900 Bytes
from pydantic_settings import BaseSettings
import os
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 = ""
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 = 512
streaming : bool = False
api_key : str = os.environ.get("OPENAI_API_KEY")
# Load configuration
MYSQL_CONFIG = MysqlConfig()
PINECONE_CONFIG = PineconeConfig()
GPTBOT_CONFIG = GPTBotConfig()