nikeshn commited on
Commit
852ee83
·
verified ·
1 Parent(s): 7b86bd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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": "Error processing your question.", "sources": [], "error": str(e)}
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) ----