Skip to content

Conversation

gembancud
Copy link

  • Update FunctionToolCallOutput to accept string|array for output parameter
  • This enables returning structured file/image references from function calls
  • Aligns with OpenAI's recent API update for file outputs in tool results
  • No breaking changes: existing string outputs continue to work

What:

  • New Feature

Description:

twitter
Openai released support for image and file inputs inside tool call results.
This PR aligns with that

  - Update FunctionToolCallOutput to accept string|array for output parameter
  - This enables returning structured file/image references from function calls
  - Aligns with OpenAI's recent API update for file outputs in tool results
  - No breaking changes: existing string outputs continue to work
Copy link
Collaborator

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

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

thanks! Generally if we put array we need to have a typed class that represents that structure in the return. Otherwise consumers of the API just have array and they don't know that array's shape.

I can't find this stuff in the docs so not exactly sure what this looks like myself.

Add dedicated response classes for function tool call output content types (text, image, file) to provide type-safe structured output handling instead of generic arrays. This aligns with OpenAI API specification and enables proper static analysis.

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

Co-Authored-By: Claude <[email protected]>
@gembancud
Copy link
Author

apologies for not including it but the shape should be documented in the openai api reference here

@gembancud gembancud requested a review from iBotPeaches October 7, 2025 15:32
Copy link
Collaborator

@iBotPeaches iBotPeaches 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 CI isn't happy due to some typing. I think expanding a test as well so we can capture this string vs array difference would be good.

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