Skip to content

Commit 6a46602

Browse files
committed
HOTFIX: Fix /search and /voice-search error handling
1 parent 2c5cbae commit 6a46602

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core_backend/app/question_answer/routers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ async def search(
143143
asession=asession,
144144
)
145145

146-
if isinstance(response, QueryResponse):
146+
if type(response) is QueryResponse:
147147
return response
148148

149-
if isinstance(response, QueryResponseError):
149+
if type(response) is QueryResponseError:
150150
return JSONResponse(
151151
status_code=status.HTTP_400_BAD_REQUEST, content=response.model_dump()
152152
)
@@ -259,10 +259,10 @@ async def voice_search(
259259
os.remove(file_path)
260260
file_stream.close()
261261

262-
if isinstance(response, QueryAudioResponse):
262+
if type(response) is QueryAudioResponse:
263263
return response
264264

265-
if isinstance(response, QueryResponseError):
265+
if type(response) is QueryResponseError:
266266
return JSONResponse(
267267
status_code=status.HTTP_400_BAD_REQUEST, content=response.model_dump()
268268
)

0 commit comments

Comments
 (0)