Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized request argument: request_timeout #626

Closed
njbbaer opened this issue Jan 16, 2023 · 2 comments
Closed

Unrecognized request argument: request_timeout #626

njbbaer opened this issue Jan 16, 2023 · 2 comments

Comments

@njbbaer
Copy link

njbbaer commented Jan 16, 2023

When I run the minimal example provided in the quickstart, I get an error:

from langchain.llms import OpenAI

llm = OpenAI(temperature=0.9)
text = "What would be a good company name a company that makes colorful socks?"
print(llm(text))
openai.error.InvalidRequestError: Unrecognized request argument supplied: request_timeout

Support for request_timeout was added to LangChain recently (#398), but the OpenAI docs don't mention that request parameter. By default LangChain passes 'request_timeout': None and removing it from the request fixes the problem.

@njbbaer
Copy link
Author

njbbaer commented Jan 16, 2023

Looking into this further, the openai Python library does actually document support for request_timeout, but it doesn't seem to work.

openai.Completion.create(engine="ada", prompt="Hello world", request_timeout=1)
openai.error.InvalidRequestError: Unrecognized request argument supplied: request_timeout

Could this be a problem upstream?

@njbbaer
Copy link
Author

njbbaer commented Jan 16, 2023

The issue was caused by an outdated version of the openai package. My apologies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant