openai / openai-python

The official Python library for the OpenAI API
https://pypi.org/project/openai/
Apache License 2.0
21.66k stars 2.97k forks source link

timeout param is not handled correctly, resulting in no timeout being set #675

Closed ilyastam closed 9 months ago

ilyastam commented 9 months ago

Describe the bug

Passing a timeout to openai.ChatCompletion.create doesn't do anything. Likely due to he incorrect logic here: https://github.com/openai/openai-python/blob/main/openai/api_resources/abstract/engine_api_resource.py#L101 If pass 3, according to this I will have no timeout.

To Reproduce

call a completion api with a small timeout

Code snippets

No response

OS

any

Python version

any

Library version

v0.28.1

RobertCraigie commented 9 months ago

This should be fixed in v1 which was just released! You can read the changelog here.

boyleconnor commented 9 months ago

The file that @ilyastam linked to no longer exists in the current commit of main. I think this permalink should point to the line that @ilyastam was linking to.