Skip to content

fix(types): type annotation field as Annotation instead of object#3430

Open
Shriniwas410 wants to merge 1 commit into
openai:mainfrom
Shriniwas410:fix/response-annotation-type-1782238396
Open

fix(types): type annotation field as Annotation instead of object#3430
Shriniwas410 wants to merge 1 commit into
openai:mainfrom
Shriniwas410:fix/response-annotation-type-1782238396

Conversation

@Shriniwas410

Copy link
Copy Markdown

ResponseOutputTextAnnotationAddedEvent.annotation is typed as object, forcing consumers to use typing.cast or suppress type errors to access typed fields like title, url, file_id.

response_output_text.py already defines the correct discriminated union Annotation = Annotated[Union[AnnotationFileCitation, AnnotationURLCitation, AnnotationContainerFileCitation, AnnotationFilePath], PropertyInfo(discriminator="type")].

This PR imports and uses that type, removing the need for workarounds.

Fixes #3419

@Shriniwas410 Shriniwas410 requested a review from a team as a code owner June 23, 2026 18:13
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

Successfully merging this pull request may close these issues.

ResponseOutputTextAnnotationAddedEvent.annotation typed as object instead of Annotation

2 participants