Skip to content

Accept "type": "" tool calls #7255

Closed

Description

@KTibow

Description

The OpenAI Compatible provider currently has two layers to verify that every tool call has a type of "function":

if (toolCallDelta.type !== 'function') {
throw new InvalidResponseDataError({
data: toolCallDelta,
message: `Expected 'function' type.`,
});
}

But these checks are unnecessary and serve no purpose since the "function" is the only type of tool call OpenAI's ever declared. More importantly, they prevent me from using the OpenAI Compatible provider from connecting to Novita AI, a provider that sets the type of tool calls to "" after the first one, like it's a delta. Novita isn't changing how their API works - they're confident that this "complies with OpenAI guidelines", and it makes some intuitive sense (it is in the delta section of the stream after all). To solve this, these checks will have to be removed.

AI SDK Version

No response

Activity

  1. added
    featureNew feature or request
    provider/openai-compatibleIssues related to the @ai-sdk/openai-compatible provider
    and removed on Jul 14, 2025
  2. added a commit that references this issue on Jul 14, 2025
    1b101e1
  3. added
    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` label
    on Oct 15, 2025
  4. added theissue type on Jul 22, 2026
  5. lgrammel commented on Jul 22, 2026

    @lgrammel
    Collaborator

    Identify issue type

    Identified as Feature
    Confidence: High

    Rationale

    This requests broader compatibility and more permissive handling of tool-call deltas, rather than identifying a violation of documented SDK behavior.

    Evidence

    • The provider currently requires every streamed tool-call type to equal "function".
    • Novita AI emits type: "" after the first tool-call delta, causing its responses to be rejected.
    • The request is to remove or relax validation to support this provider-specific response format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelfeatureNew feature or requestmerged-mainprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providertask-identify-issue-type-done

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions