openai api fix

pull/128/head
Kye 1 year ago
parent 285a3bdd87
commit ba7a468f02

@ -102,7 +102,7 @@ def _create_retry_decorator(
errors = [ errors = [
openai.Timeout, openai.Timeout,
openai.error.APIError, openai.APIError,
openai.error.APIConnectionError, openai.error.APIConnectionError,
openai.error.RateLimitError, openai.error.RateLimitError,
openai.error.ServiceUnavailableError, openai.error.ServiceUnavailableError,

@ -788,10 +788,10 @@ class OpenAIChat(BaseLLM):
if openai_organization: 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)'") 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: 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, "http": openai_proxy,
"https": openai_proxy, "https": openai_proxy,
})'") # type: ignore[assignment] # noqa: E501 } # type: ignore[assignment] # noqa: E501
except ImportError: except ImportError:
raise ImportError( raise ImportError(
"Could not import openai python package. " "Could not import openai python package. "

Loading…
Cancel
Save