Files
hive/examples/templates/email_reply_agent/config.py
T
2026-03-03 20:39:04 -08:00

46 lines
1.2 KiB
Python

"""Runtime configuration."""
import json
from dataclasses import dataclass, field
from pathlib import Path
def _load_preferred_model() -> str:
"""Load preferred model from ~/.hive/configuration.json."""
config_path = Path.home() / ".hive" / "configuration.json"
if config_path.exists():
try:
with open(config_path) as f:
config = json.load(f)
llm = config.get("llm", {})
if llm.get("provider") and llm.get("model"):
return f"{llm['provider']}/{llm['model']}"
except Exception:
pass
return "anthropic/claude-sonnet-4-20250514"
@dataclass
class RuntimeConfig:
model: str = field(default_factory=_load_preferred_model)
temperature: float = 0.7
max_tokens: int = 40000
api_key: str | None = None
api_base: str | None = None
default_config = RuntimeConfig()
@dataclass
class AgentMetadata:
name: str = "Email Reply Agent"
version: str = "1.0.0"
description: str = (
"Filter unreplied emails, confirm recipients, send personalized replies."
)
intro_message: str = "Tell me which emails you want to reply to (e.g., 'emails from @company.com in the last week')."
metadata = AgentMetadata()