Skip to content

Commit

Permalink
Fix error code for RunFailed on quota exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilger committed Feb 22, 2024
1 parent df72f29 commit c40adea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gpt_agent.ex
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ defmodule GptAgent do
id: id,
thread_id: state.thread_id,
assistant_id: state.assistant_id,
code: "rate_limit_exceeded-final",
code: "rate_limit_exceeded-quota",
message: response |> Map.get("last_error", %{}) |> Map.get("message")
)
)
Expand Down
2 changes: 1 addition & 1 deletion test/gpt_agent_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ defmodule GptAgentTest do
id: ^run_id,
thread_id: ^thread_id,
assistant_id: ^assistant_id,
code: "rate_limit_exceeded-final",
code: "rate_limit_exceeded-quota",
message:
"You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors."
}},
Expand Down

0 comments on commit c40adea

Please sign in to comment.