Skip to content

fix(types): expand FunctionCallOutput.output to accept str or list#3122

Draft
anishesg wants to merge 1 commit intoopenai:mainfrom
proudhare:fix/ph-issue-2668
Draft

fix(types): expand FunctionCallOutput.output to accept str or list#3122
anishesg wants to merge 1 commit intoopenai:mainfrom
proudhare:fix/ph-issue-2668

Conversation

@anishesg
Copy link
Copy Markdown

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

The FunctionCallOutput.output field in src/openai/types/responses/response_input_item.py was typed as str only, which is inconsistent with the OpenAI API documentation that specifies the field accepts either a string or a list of content objects. The root cause was an upstream OpenAPI spec gap (openai/openai-openapi#488), but the Python library needs to reflect the documented behavior. The field type has been updated to Union[str, ResponseFunctionCallOutputItemList] (i.e. str | list[ResponseInputTextContent | ResponseInputImageContent | ResponseInputFileContent]) to match the API docs. A regression test in tests/test_models.py verifies that FunctionCallOutput correctly parses both string and list values for output.

Additional context & links

Fixes #2668

- [ ] I understand that this repository is auto-generated and my pull request may not be merged

Signed-off-by: anish k <ak8686@princeton.edu>
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.

FunctionCallOutput is inconsistent with OpenAI API docs

1 participant