Skip to content

Commit 0e76774

Browse files
fix: OpenAI error log fix (#53)
OpenAI error log fix Signed-off-by: Chandrasekharan M <[email protected]>
1 parent 5d0ead0 commit 0e76774

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/unstract/sdk/llm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ def run_completion(
7171
# TODO: Handle for all LLM providers
7272
except OpenAIAPIError as e:
7373
msg = "OpenAI error: "
74-
msg += e.message
7574
if hasattr(e, "body") and "message" in e.body:
7675
msg += e.body["message"]
76+
else:
77+
msg += e.message
7778
if isinstance(e, OpenAIRateLimitError):
7879
raise RateLimitError(msg)
7980
raise LLMError(msg) from e

0 commit comments

Comments
 (0)