Spaces:
Sleeping
Sleeping
File size: 994 Bytes
da21448 | 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 | from functools import lru_cache
from pydantic import Field, SecretStr
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
openai_api_key: SecretStr
chat_model: str = "gpt-4o-mini"
chat_temperature: float | None = 0.0
embedding_model: str = "text-embedding-3-small"
embedding_dimensions: int = Field(default=1536, gt=0)
neo4j_uri: str
neo4j_username: str = "neo4j"
neo4j_password: SecretStr
neo4j_database: str = "neo4j"
chunk_size: int = Field(default=900, gt=0)
chunk_overlap: int = Field(default=150, ge=0)
extraction_workers: int = Field(default=4, ge=1, le=16)
vector_top_k: int = Field(default=5, ge=1, le=50)
graph_max_hops: int = Field(default=2, ge=1, le=4)
graph_max_facts: int = Field(default=40, ge=1, le=200)
@lru_cache
def get_settings() -> Settings:
return Settings()
|