File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 88Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
99"""
1010
11+ import traceback
12+
1113from fastapi import APIRouter , HTTPException , Request
1214
1315chat_router = APIRouter ()
@@ -19,7 +21,7 @@ async def query(request: Request, query: str):
1921 try :
2022 result = await rag .run_graph_invoke (query )
2123 except Exception as e :
22- print ( e )
23- result = HTTPException (status_code = 500 , detail = str ( e ) )
24+ detail = f" { e } \n { traceback . format_exc () } "
25+ result = HTTPException (status_code = 500 , detail = detail )
2426
2527 return {"result" : result }
Original file line number Diff line number Diff line change @@ -168,9 +168,9 @@ def _classify_question_domain(self, state: RAGState) -> dict:
168168
169169 domain_str = ""
170170
171- for d , info in domain_info :
172- desc = info .get ( " description" , None )
173- if not desc :
171+ for d , info in domain_info . items () :
172+ desc = info .description
173+ if not desc or len ( desc ) == 0 :
174174 desc = f"if the question is about { d } "
175175 else :
176176 desc = f"if the question is about { desc } "
You can’t perform that action at this time.
0 commit comments