Handle error from openai.

This commit is contained in:
Hemang
2025-02-19 15:31:39 +01:00
parent 9ab00a4e73
commit 62d09c118f
+4
View File
@@ -332,6 +332,10 @@ async def handle_non_streaming_response(
):
"""Handles non-streaming OpenAI responses"""
json_response = response.json()
if json_response.get("error"):
raise HTTPException(
status_code=response.status_code, detail=json_response.get("error")
)
await push_to_explorer(
dataset_name, json_response, request_body_json, invariant_authorization
)