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

fix: field 'tool_calls' is required for type with serial name 'submit_tool_outputs', but it was missing #266

Merged
merged 4 commits into from
Nov 24, 2023

Conversation

voqaldev
Copy link
Contributor

Q A
Bug fix? yes

Describe your change

Fixes Field 'tool_calls' is required for type with serial name 'submit_tool_outputs', but it was missing. API states that required action is the parent object:
image

@aallam
Copy link
Owner

aallam commented Nov 24, 2023

Nice catch! I think we can make it future proof (for new tools later) by having something like this (based on openapi spec):

/**
 * Details on the action required to continue the run.
 */
@BetaOpenAI
@Serializable
public sealed interface RequiredAction {

    @Serializable
    @SerialName("submit_tool_outputs")
    public class SubmitToolOutputs(
        /**
         * A list of the relevant tool calls.
         */
        @SerialName("submit_tool_outputs") public val toolOutputs: ToolOutputs,
    ) : RequiredAction
}

/**
 * Details on the tool outputs needed for this run to continue.
 */
@Serializable
public data class ToolOutputs(
    /**
     * A list of the relevant tool calls
     */
    @SerialName("tool_calls") val toolCalls: List<ToolCall>
)

Copy link
Owner

@aallam aallam left a comment

Choose a reason for hiding this comment

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

Nice! thanks again for your contribution!

@aallam aallam merged commit 5554118 into aallam:main Nov 24, 2023
2 of 15 checks passed
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