diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-06-23 18:37:46 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-06-23 18:37:46 +0900 |
| commit | 21b59cc1d0928dc04dcf5eac24470aaa05013b2d (patch) | |
| tree | 9888aa23aafea3907ce96eb958a06d4369dad86e /src/ollama_web/config.py | |
| parent | de0513e7cb0593b1aa141e367ff4da7156d6110f (diff) | |
基本機能実装
Diffstat (limited to 'src/ollama_web/config.py')
| -rw-r--r-- | src/ollama_web/config.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ollama_web/config.py b/src/ollama_web/config.py new file mode 100644 index 0000000..4f39d17 --- /dev/null +++ b/src/ollama_web/config.py @@ -0,0 +1,26 @@ +"""Application configuration for ollama-web.""" + +from __future__ import annotations + +import os +from dataclasses import dataclass, field + + +@dataclass +class Settings: + """Runtime settings resolved from environment variables.""" + + ollama_host: str = field(default_factory=lambda: os.environ.get("OLLAMA_HOST", "http://127.0.0.1:11434")) + default_model: str = field( + default_factory=lambda: os.environ.get("OLLAMA_WEB_MODEL", "llama3.2") + ) + host: str = field(default_factory=lambda: os.environ.get("OLLAMA_WEB_HOST", "0.0.0.0")) + port: int = field(default_factory=lambda: int(os.environ.get("OLLAMA_WEB_PORT", "8000"))) + ollama_timeout: float = 120.0 + scrape_timeout: float = 15.0 + scrape_max_chars: int = 4000 + search_max_results: int = 5 + + +settings = Settings() +"""Process-wide settings instance."""
\ No newline at end of file |
