|
|
|
@ -126,7 +126,8 @@ async def save_to_json(question_items: list[QuestionItem], background_tasks: Bac
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
logger.error(f"Error saving data to file or scheduling knowledge base update task: {e}")
|
|
|
|
|
raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
|
|
|
|
# raise HTTPException(status_code=500, detail=f"Internal Server Error: {str(e)}")
|
|
|
|
|
return {"status": "error", "message": "update task error···"}
|
|
|
|
|
|
|
|
|
|
@app.post("/matchQuestion")
|
|
|
|
|
def match_question(request: QuestionRequest):
|
|
|
|
@ -156,7 +157,7 @@ def match_question(request: QuestionRequest):
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
logger.error(f"Error matching question: {e}")
|
|
|
|
|
raise HTTPException(status_code=500, detail=str(e))
|
|
|
|
|
return QuestionResponse(code=500, msg="success", data=[])
|
|
|
|
|
|
|
|
|
|
recent_knowledge_bases = deque(load_knowledge_bases(), maxlen=max_knowledge_bases)
|
|
|
|
|
|
|
|
|
|