Fixes age validation errors caused by the LLM not knowing the current date.
Changes:
- prompts.py: inject date.today() at the top of both system prompts so the
LLM can accurately calculate a child's age from their date of birth
- llm.py: add optional thinking_budget parameter to complete(); when set,
passes thinking={"type": "enabled", "budget_tokens": N} to litellm and
raises max_tokens to thinking_budget + 4096 (Anthropic models only)
- config.py: add thinking_budget field, read from THINKING_BUDGET env var
- .env.example: document the THINKING_BUDGET option
- core.py: pass thinking_budget through to llm.complete()
- main.py: pass thinking_budget when constructing EmailAgent
- chat_app.py: switch from stream_complete to asyncio.to_thread(complete)
so extended thinking works and so only the reply field is shown to
the parent (not the raw JSON wrapper)
To enable extended thinking set THINKING_BUDGET=8000 in .env.
https://claude.ai/code/session_01SUWzMzFvSfWiHXA2p6rPg9
82 lines
3.3 KiB
Bash
82 lines
3.3 KiB
Bash
# ---------------------------------------------------------------
|
|
# Meister-Eder Email Agent — Configuration Template
|
|
# ---------------------------------------------------------------
|
|
# Copy this file to .env and fill in your values.
|
|
# The .env file must NOT be committed to version control.
|
|
# ---------------------------------------------------------------
|
|
|
|
# ---------------------------------------------------------------
|
|
# AI Model (via litellm — supports any provider)
|
|
# ---------------------------------------------------------------
|
|
# Use litellm model strings: "<provider>/<model-name>"
|
|
# Examples:
|
|
# anthropic/claude-opus-4-6 (default)
|
|
# openai/gpt-4o
|
|
# gemini/gemini-2.0-flash
|
|
AI_MODEL=anthropic/claude-opus-4-6
|
|
|
|
# Extended thinking — Anthropic models only (leave unset to disable).
|
|
# Enables a reasoning phase before the model's reply, which improves
|
|
# accuracy on age calculations, logic-heavy questions, and edge cases.
|
|
# Recommended value: 8000 (tokens). Must be less than max_tokens.
|
|
# THINKING_BUDGET=8000
|
|
|
|
# ---------------------------------------------------------------
|
|
# API Keys — set the one matching your chosen model's provider
|
|
# ---------------------------------------------------------------
|
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
# OPENAI_API_KEY=sk-...
|
|
# GEMINI_API_KEY=...
|
|
|
|
# ---------------------------------------------------------------
|
|
# Email — IMAP (receiving parent messages)
|
|
# ---------------------------------------------------------------
|
|
IMAP_HOST=imap.example.com
|
|
IMAP_PORT=993
|
|
IMAP_USERNAME=anmeldung@example.com
|
|
IMAP_PASSWORD=your-imap-password
|
|
IMAP_USE_SSL=true
|
|
|
|
# ---------------------------------------------------------------
|
|
# Email — SMTP (sending replies and notifications)
|
|
# ---------------------------------------------------------------
|
|
SMTP_HOST=smtp.example.com
|
|
SMTP_PORT=587
|
|
SMTP_USE_TLS=true
|
|
|
|
# ---------------------------------------------------------------
|
|
# Registration email address (displayed as sender to parents)
|
|
# ---------------------------------------------------------------
|
|
REGISTRATION_EMAIL=anmeldung@example.com
|
|
|
|
# ---------------------------------------------------------------
|
|
# Admin notification routing
|
|
# Each leader receives mail only when a day in their group is booked.
|
|
# ADMIN_EMAIL_CC is always included as Cc (comma-separated for multiple).
|
|
# For testing, point all three to your own email address.
|
|
# ---------------------------------------------------------------
|
|
ADMIN_EMAIL_INDOOR=andrea.sigrist@gmx.net
|
|
ADMIN_EMAIL_OUTDOOR=baba.laeubli@gmail.com
|
|
ADMIN_EMAIL_CC=spielgruppen@familien-verein.ch
|
|
|
|
# ---------------------------------------------------------------
|
|
# Storage
|
|
# ---------------------------------------------------------------
|
|
# Directory for conversation state and completed registrations.
|
|
DATA_DIR=data
|
|
|
|
# Path to the knowledge-base markdown files (admin-editable).
|
|
KNOWLEDGE_BASE_DIR=openspec/changes/define-project-scope/content/knowledge-base
|
|
|
|
# ---------------------------------------------------------------
|
|
# Polling
|
|
# ---------------------------------------------------------------
|
|
# How often (in seconds) to check the inbox for new messages.
|
|
POLL_INTERVAL=60
|
|
|
|
# ---------------------------------------------------------------
|
|
# Web chat server
|
|
# ---------------------------------------------------------------
|
|
# Listen on all interfaces so the app is reachable from outside localhost.
|
|
CHAINLIT_HOST=0.0.0.0
|