erowid-bot/app/config.py

35 lines
977 B
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
database_url: str = "postgresql+asyncpg://erowid:erowid@erowid-db:5432/erowid"
database_url_sync: str = "postgresql://erowid:erowid@erowid-db:5432/erowid"
llm_provider: str = "ollama" # ollama | claude | openai
ollama_base_url: str = "http://ollama:11434"
ollama_embed_model: str = "nomic-embed-text"
ollama_chat_model: str = "llama3.2:1b"
anthropic_api_key: str = ""
openai_api_key: str = ""
app_host: str = "0.0.0.0"
app_port: int = 8000
# Scraper settings
scrape_delay: float = 3.0 # seconds between requests (be polite to Erowid)
scrape_batch_size: int = 50
# RAG settings
chunk_size: int = 500 # tokens per chunk
chunk_overlap: int = 50 # token overlap between chunks
retrieval_top_k: int = 2 # number of chunks to retrieve
class Config:
env_file = ".env"
extra = "ignore"
settings = Settings()