From 21b59cc1d0928dc04dcf5eac24470aaa05013b2d Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Tue, 23 Jun 2026 18:37:46 +0900 Subject: 基本機能実装 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ollama_web/config.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/ollama_web/config.py (limited to 'src/ollama_web/config.py') 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 -- cgit v1.2.3