From fa9593b4e825679d6192ff06c52c7087d251f8c8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 20 Apr 2024 16:01:25 -0500 Subject: [PATCH] refac: openai error message --- backend/apps/openai/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index 4098d73a5..4647d7489 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -341,7 +341,7 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)): try: res = r.json() if "error" in res: - error_detail = f"External: {res['error']}" + error_detail = f"External: {res['error']['message'] if 'message' in res['error'] else res['error']}" except: error_detail = f"External: {e}"