Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Output field to FunctionCall struct #920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harnyk
Copy link

@harnyk harnyk commented Jan 15, 2025

Describe the change

  • Added the Output field to the FunctionCall struct as described in the OpenAI API docs.
  • This field is optional and is of type *string.

Provide OpenAI documentation link
https://platform.openai.com/docs/api-reference/run-steps/step-object#run-steps/step-object-step_details
See: step_details / Tool Calls / tool_calls / Function tool call / function / output

Describe your solution
The output field is provided with FunctionCall in the Assistants API context, when the function result has been already submitted.

Tests
Unit tests updated, see the changes.

Additional context
I developed a CLI tool for retrieving and viewing OpenAI assistant thread history using Assistants API:
https://github.com/harnyk/threadviewer/

But I had to vendor and patch go-openai library in-place in order to make it support function call output field:

@harnyk harnyk force-pushed the fix/function-call-output branch 2 times, most recently from a54e136 to d5307fd Compare January 15, 2025 14:56
- Added the `Output` string field to the `FunctionCall` struct as described in the OpenAI API docs.
@harnyk harnyk force-pushed the fix/function-call-output branch from d5307fd to 0198bc2 Compare January 15, 2025 14:57
@harnyk harnyk marked this pull request as ready for review January 16, 2025 12:36
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.

1 participant