import logfire | |
from fastapi import FastAPI | |
from app import agent, models | |
logfire.configure( | |
service_name="api", scrubbing=False, send_to_logfire="if-token-present" | |
) | |
logfire.instrument_pydantic_ai() | |
app = FastAPI() | |
logfire.instrument_fastapi(app, excluded_urls=["health"]) | |
def health_check(): | |
return "ok" | |
async def ask(query: str): | |
response = await agent.agent.run(query) | |
return response.output | |