Skip to content

Regression: response.output_text is broken since 1.99.2 #2523

@hheimbuerger

Description

@hheimbuerger

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

  1. 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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions