mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-06-01 05:39:47 +08:00
26 lines
687 B
Python
26 lines
687 B
Python
from pydantic_settings import BaseSettings
|
|
from typing import List
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_KEYS: List[str]
|
|
ALLOWED_TOKENS: List[str]
|
|
BASE_URL: str = "https://generativelanguage.googleapis.com/v1beta"
|
|
MODEL_SEARCH: List[str] = ["gemini-2.0-flash-exp"]
|
|
TOOLS_CODE_EXECUTION_ENABLED: bool = False
|
|
SHOW_SEARCH_LINK: bool = True
|
|
SHOW_THINKING_PROCESS: bool = True
|
|
AUTH_TOKEN: str = ""
|
|
MAX_FAILURES: int = 3
|
|
|
|
def __init__(self):
|
|
super().__init__()
|
|
if not self.AUTH_TOKEN:
|
|
self.AUTH_TOKEN = self.ALLOWED_TOKENS[0] if self.ALLOWED_TOKENS else ""
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|