Skip to content

BUG : file_search annotations are coming up as ResponseAudioDeltaEvent #2383

Open
@dominpm

Description

@dominpm

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

When using the Responses API, file_search annotations are being returned as ResponseAudioDeltaEvent instead of the expected annotation type. This appears to be a bug in how file search events are handled in the response payload.

Expected Behavior

file_search annotations should be returned with their correct event type (e.g., FileSearchEvent), not as ResponseAudioDeltaEvent.

Actual Behavior

All file_search annotations are appearing as ResponseAudioDeltaEvent in the response annotations.

To Reproduce

  1. Call the Responses API with a request that triggers a file_search annotation.
  2. Inspect the annotations in the response.
  3. Notice that file_search results are incorrectly labeled as ResponseAudioDeltaEvent.

Code snippets

ResponseAudioDeltaEvent(delta=None, sequence_number=345, type='response.output_text.annotation.added', item_id='XX', output_index=1, content_index=0, annotation_index=3, annotation={'type': 'file_citation', 'file_id': 'file-XX', 'filename': 'XX.pdf', 'index': 1364})

OS

Windows

Python version

v3.12.0

Library version

v1.82.0

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