File size: 900 Bytes
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
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()