Update app.py
Browse files
app.py
CHANGED
|
@@ -393,7 +393,7 @@ async def tool_search_scholar(query, limit=5):
|
|
| 393 |
|
| 394 |
async def tool_library_info(question, history=None, model="gpt"):
|
| 395 |
if not vectorstore:
|
| 396 |
-
return {"answer": "Knowledge base not initialized.", "sources": []}
|
| 397 |
|
| 398 |
query = question
|
| 399 |
if history:
|
|
@@ -725,7 +725,7 @@ async def rag_query(req: RAGRequest):
|
|
| 725 |
}
|
| 726 |
except Exception as e:
|
| 727 |
elapsed = time.time() - start
|
| 728 |
-
return {"answer": "
|
| 729 |
|
| 730 |
|
| 731 |
# ---- Agent endpoint (Batch 3: tool-calling agent) ----
|
|
|
|
| 393 |
|
| 394 |
async def tool_library_info(question, history=None, model="gpt"):
|
| 395 |
if not vectorstore:
|
| 396 |
+
return {"answer": "Knowledge base not initialized.", "sources": [], "has_answer": False}
|
| 397 |
|
| 398 |
query = question
|
| 399 |
if history:
|
|
|
|
| 725 |
}
|
| 726 |
except Exception as e:
|
| 727 |
elapsed = time.time() - start
|
| 728 |
+
return {"answer": "", "sources": [], "has_answer": False, "error": str(e)}
|
| 729 |
|
| 730 |
|
| 731 |
# ---- Agent endpoint (Batch 3: tool-calling agent) ----
|