Logfire integration for debugging

This commit is contained in:
Yiorgis Gozadinos 2026-01-08 12:17:24 +02:00
parent 14873862f8
commit 6ba28244d8
No known key found for this signature in database
4 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,15 @@ def convert_messages_to_history(
load_dotenv()
# Configure logfire (only sends data if LOGFIRE_TOKEN is present)
try:
import logfire
logfire.configure(send_to_logfire="if-token-present", console=False)
logfire.instrument_pydantic_ai()
except Exception:
pass
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)

View file

@ -9,6 +9,7 @@ dependencies = [
"pydantic-ai-slim[ag-ui,anthropic,openai]>=1.39.0",
"python-dotenv>=1.2.1",
"haiku.rag-slim[agui]>=0.23.1",
"logfire[pydantic-ai]>=3.17.0",
]
[dependency-groups]

View file

@ -14,6 +14,7 @@ services:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
- LOGFIRE_TOKEN=${LOGFIRE_TOKEN:-}
volumes:
- ${DB_PATH:-./data/haiku.rag.lancedb}:/data
- ./backend:/app/src:ro

View file

@ -10,6 +10,7 @@ services:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
- LOGFIRE_TOKEN=${LOGFIRE_TOKEN:-}
volumes:
- ${DB_PATH:-./data/haiku.rag.lancedb}:/data
extra_hosts: