File size: 490 Bytes
7be08b4
8a3374d
 
7be08b4
 
 
 
 
 
 
8a3374d
 
9490f88
8a3374d
 
 
 
 
 
 
a55a212
21d76a7
5dd40e8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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