elna / app /main.py
David Chu
fix: api response type
5dd40e8 unverified
raw
history blame contribute delete
490 Bytes
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"])
@app.get("/health")
def health_check():
return "ok"
@app.get("/ask", response_model=models.Statements)
async def ask(query: str):
response = await agent.agent.run(query)
return response.output