Skip to content

Commit

Permalink
openai api fix
Browse files Browse the repository at this point in the history
Former-commit-id: ba7a468
  • Loading branch information
kyegomez committed Nov 11, 2023
1 parent 712bd0d commit bb90b27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion swarms/models/openai_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _create_retry_decorator(

errors = [
openai.Timeout,
openai.error.APIError,
openai.APIError,
openai.error.APIConnectionError,
openai.error.RateLimitError,
openai.error.ServiceUnavailableError,
Expand Down
4 changes: 2 additions & 2 deletions swarms/models/openai_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,10 @@ def validate_environment(cls, values: Dict) -> Dict:
if openai_organization:
raise Exception("The 'openai.organization' option isn't read in the client API. You will need to pass it when you instantiate the client, e.g. 'OpenAI(organization=openai_organization)'")
if openai_proxy:
raise Exception("The 'openai.proxy' option isn't read in the client API. You will need to pass it when you instantiate the client, e.g. 'OpenAI(proxy={
openai.proxy = {
"http": openai_proxy,
"https": openai_proxy,
})'") # type: ignore[assignment] # noqa: E501
} # type: ignore[assignment] # noqa: E501
except ImportError:
raise ImportError(
"Could not import openai python package. "
Expand Down

0 comments on commit bb90b27

Please sign in to comment.