From ee13f6a439ebf4a3223419596defecae7622fd40 Mon Sep 17 00:00:00 2001 From: LanQian <5499636+LanQian528@users.noreply.github.com> Date: Tue, 30 Apr 2024 06:38:52 +0800 Subject: [PATCH] fix retry --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index d6dcde3..a4935bd 100644 --- a/app.py +++ b/app.py @@ -26,9 +26,10 @@ async def to_send_conversation(request_data, access_token): try: await chat_service.get_chat_requirements() return chat_service - except Exception: + except HTTPException as e: if chat_service.s.session: await chat_service.close_client() + raise HTTPException(status_code=e.status_code, detail=e.detail) @app.post("/v1/chat/completions")