48 lines
1.6 KiB
Python
48 lines
1.6 KiB
Python
"""Configuration management for Mem0 Interface POC."""
|
|
|
|
import os
|
|
from typing import List, Optional
|
|
from pydantic import Field
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# API Configuration
|
|
openai_api_key: str = Field(..., env="OPENAI_COMPAT_API_KEY")
|
|
openai_base_url: str = Field(..., env="OPENAI_COMPAT_BASE_URL")
|
|
embedder_api_key: str = Field(..., env="EMBEDDER_API_KEY")
|
|
|
|
# ollama_base_url: str = Field(..., env="OLLAMA_BASE_URL")
|
|
|
|
# Database Configuration
|
|
qdrant_host: str = Field("localhost", env="QDRANT_HOST")
|
|
qdrant_port: int = Field(6333, env="QDRANT_PORT")
|
|
qdrant_collection_name: str = Field("mem0", env="QDRANT_COLLECTION_NAME")
|
|
|
|
# Neo4j Configuration
|
|
neo4j_uri: str = Field("bolt://localhost:7687", env="NEO4J_URI")
|
|
neo4j_username: str = Field("neo4j", env="NEO4J_USERNAME")
|
|
neo4j_password: str = Field("mem0_neo4j_password", env="NEO4J_PASSWORD")
|
|
|
|
# Application Configuration
|
|
log_level: str = Field("INFO", env="LOG_LEVEL")
|
|
cors_origins: str = Field("http://localhost:3000", env="CORS_ORIGINS")
|
|
|
|
# Model Configuration - Ultra-minimal (single model)
|
|
default_model: str = Field("claude-sonnet-4", env="DEFAULT_MODEL")
|
|
|
|
|
|
@property
|
|
def cors_origins_list(self) -> List[str]:
|
|
"""Convert CORS origins string to list."""
|
|
return [origin.strip() for origin in self.cors_origins.split(",")]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = False
|
|
|
|
|
|
# Global settings instance
|
|
settings = Settings()
|