openai api fix

Former-commit-id: ba7a468f02
grit/923f7c6f-0958-480b-8748-ea6bbf1c2084
Kye 1 year ago
parent 712bd0d9d4
commit bb90b27697

@ -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,

@ -788,10 +788,10 @@ class OpenAIChat(BaseLLM):
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. "

Loading…
Cancel
Save