Skip to content

Support OpenAI type: "custom" tools (including grammar) in AI SDK #12614

@JohnnyBill

Description

@JohnnyBill

Description

AI SDK currently supports json based tools well, but does not provide a first class way to define OpenAI custom/freeform
tools (type: "custom").

Please add support for passing OpenAI custom tools through AI SDK, including:

  • type: "custom"
  • name, description
  • optional format:
    • { type: "grammar", syntax: "lark" | "regex", definition: string }

This is needed for tools like freeform patching/editing where JSON schemas are too restrictive.

AI SDK Version

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelsupport

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions