Spaces:
Sleeping
Sleeping
File size: 979 Bytes
9002555 b39c0ba 9002555 b39c0ba 9002555 d57efd6 9002555 0767396 9002555 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
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()
|