proper response
This commit is contained in:
@@ -67,6 +67,7 @@ class TestQueryResponse(BaseModel):
|
|||||||
query: str
|
query: str
|
||||||
response: str
|
response: str
|
||||||
sources: list[SourceItem]
|
sources: list[SourceItem]
|
||||||
|
error: bool
|
||||||
|
|
||||||
|
|
||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
@@ -102,7 +103,9 @@ def test_query(payload: TestQueryRequest) -> TestQueryResponse:
|
|||||||
|
|
||||||
response_text = str(result)
|
response_text = str(result)
|
||||||
logger.info(f"/api/test-query completed successfully (sources={len(sources)})")
|
logger.info(f"/api/test-query completed successfully (sources={len(sources)})")
|
||||||
return TestQueryResponse(query=query, response=response_text, sources=sources)
|
return TestQueryResponse(
|
||||||
|
query=query, response=response_text, sources=sources, error=False
|
||||||
|
)
|
||||||
|
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
raise
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user