Skip to content

Conversation

Advayp
Copy link
Contributor

@Advayp Advayp commented Aug 26, 2025

Description

  • According to OpenAI's specification, OutputItem should be a tagged union. This PR updates that struct to align with OpenAI's specification
  • A nice benefit of this is that streaming with tool calls is now supported

Copy link
Owner

@64bit 64bit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this PR is updating incorrect type, the Response object output field type is OutputContent

https://github.com/64bit/async-openai/blob/main/async-openai/src/types/responses.rs#L1371

@Advayp
Copy link
Contributor Author

Advayp commented Sep 1, 2025

Looks like this PR is updating incorrect type, the Response object output field type is OutputContent

https://github.com/64bit/async-openai/blob/main/async-openai/src/types/responses.rs#L1371

The OutputContent type is already correct. I'm updating OutputItem because that's the output type used in streaming events. Though, after taking another look now, both OutputContent and OutputItem are the same. Because of this, I think we can remove the OutputItem type entirely and replace it with OutputContent. What do you think?

Copy link
Owner

@64bit 64bit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarification and PR! it makes sense to update OutputItem type with spec

@64bit 64bit merged commit a8bb897 into 64bit:main Sep 7, 2025
gilljon pushed a commit to gilljon/async-openai that referenced this pull request Sep 22, 2025
* fix(types)!: change AssistantStreamEvent field name (64bit#400)

BREAKING CHANGES: changed AssistantStreamEvent filed name

* Fix typo in `ChatCompletionToolChoiceOption` docs (64bit#401)

* feat: update image generation API to match latest OpenAI specs (64bit#402)

* feat: update image generation API to match latest OpenAI specs

- Add ImageModeration enum with 'auto' (default) and 'low' values
- Add moderation parameter to CreateImageRequest for gpt-image-1
- Extend ImageQuality enum to support 'high', 'medium', 'low' for gpt-image-1

These changes align with the latest OpenAI API documentation for image generation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* add Auto to ImageQuality

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Himanshu Neema <[email protected]>

* fix(deps): bump to [email protected] (64bit#409)

Signed-off-by: Nick Mitchell <[email protected]>

* feat: Add `minimal` reasoning effort for gpt-5 (64bit#411)

* add Scale and Priority to ServiceTier (64bit#416)

* Add streaming support for Responses API (64bit#405)

* Add streaming support for Responses API.

* Update examples/responses-stream/src/main.rs

* Update examples/responses-stream/src/main.rs

* Update examples/responses-stream/src/main.rs

* Delete async-openai/tests/responses.rs

---------

Co-authored-by: Himanshu Neema <[email protected]>

* chore: Release

* Add skip_serializing_if to more option types (64bit#412)

Signed-off-by: John Howard <[email protected]>

* Add Scale and Priority to the `ServiceTier` enum for the Responses API (64bit#419)

* Fix schema of code interpreter call output (64bit#420)

* chore: Release

* fix: CompoundFilter should use CompoundType instead (64bit#429)

* fix: Update `OutputItem` to align with OpenAI's Specification (64bit#426)

* Update `OutputItem` to align with OpenAI's Specification

* Update

* chore: Release

---------

Signed-off-by: Nick Mitchell <[email protected]>
Signed-off-by: John Howard <[email protected]>
Co-authored-by: posky <[email protected]>
Co-authored-by: lazymio <[email protected]>
Co-authored-by: Siyuan Yan <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Himanshu Neema <[email protected]>
Co-authored-by: Nick Mitchell <[email protected]>
Co-authored-by: Timon Vonk <[email protected]>
Co-authored-by: Kevin Zimmerman <[email protected]>
Co-authored-by: Kazzix <[email protected]>
Co-authored-by: John Howard <[email protected]>
Co-authored-by: Advayp <[email protected]>
Co-authored-by: the-spice-must-flow <[email protected]>
Co-authored-by: Ben Levin <[email protected]>
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.

2 participants