Logfire integration for debugging
This commit is contained in:
parent
14873862f8
commit
6ba28244d8
4 changed files with 12 additions and 0 deletions
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue