Newer
Older
navi-1 / navi / config.py
@Eugene Sukhodolskiy Eugene Sukhodolskiy on 8 Apr 827 bytes Initial implementation of the agent system core
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")

    ollama_host: str = "http://localhost:11434"
    ollama_default_model: str = "gemma4:e2b-it-q4_K_M"

    openai_api_key: str = ""
    anthropic_api_key: str = ""

    fs_allowed_paths: str = "/tmp"
    terminal_allowed_commands: str = "ls,cat,echo,pwd,git,python3"

    log_level: str = "INFO"

    @property
    def fs_allowed_paths_list(self) -> list[str]:
        return [p.strip() for p in self.fs_allowed_paths.split(",") if p.strip()]

    @property
    def terminal_allowed_commands_list(self) -> list[str]:
        return [c.strip() for c in self.terminal_allowed_commands.split(",") if c.strip()]


settings = Settings()