-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
In 1.99.2, Response objects are missing the output_text
attribute. Test case is the very first example from the README. But here's an even simpler way to reproduce:
It worked in 1.99.1:
> uv run --with="openai==1.99.1" python -c "from openai import OpenAI; print(OpenAI().responses.create(model='gpt-4o', input='sup?').output_text)"
Hey! Not much, just here to help. What's up with you?
The same code is broken in 1.99.2:
> uv run --with="openai==1.99.2" python -c "from openai import OpenAI; OpenAI().responses.create(model='gpt-4o', input='sup?').output_text"
Traceback (most recent call last):
File "C:\Users\me\AppData\Local\uv\cache\archive-v0\IzxeX74ZmC-P7DA6mL-0x\Lib\site-packages\pydantic\main.py", line 983, in __getattr__
return pydantic_extra[item]
~~~~~~~~~~~~~~^^^^^^
KeyError: 'output_text'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\me\AppData\Local\uv\cache\archive-v0\IzxeX74ZmC-P7DA6mL-0x\Lib\site-packages\pydantic\main.py", line 985, in __getattr__
raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc
AttributeError: 'Response' object has no attribute 'output_text'
To Reproduce
- Run
uv run --with="openai==1.99.2" python -c "from openai import OpenAI; OpenAI().responses.create(model='gpt-4o', input='sup?').output_text"
Expected: any GPT response
Actual: AttributeError
Code snippets
uv run --with="openai==1.99.2" python -c "from openai import OpenAI; OpenAI().responses.create(model='gpt-4o', input='sup?').output_text"
OS
Windows 11
Python version
Python v3.11.1
Library version
openai v1.99.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working