Skip to content

OpenAIChatTools

Namespace: Vercel.AI.OpenAI

public static class OpenAIChatTools

Prepares Chat Completions function tools.

Inheritance: object

View source

Prepare(IReadOnlyList<LanguageModelTool>?, IReadOnlyList<OpenAIUnsupportedTool>?, ToolChoice?)

Section titled “Prepare(IReadOnlyList<LanguageModelTool>?, IReadOnlyList<OpenAIUnsupportedTool>?, ToolChoice?)”
public static OpenAIChatToolPreparation Prepare(IReadOnlyList<LanguageModelTool>? tools, IReadOnlyList<OpenAIUnsupportedTool>? unsupported, ToolChoice? toolChoice)

Prepares function tools and records unsupported tool types.

Parameters

Name Type Description
tools IReadOnlyList<LanguageModelTool>
unsupported IReadOnlyList<OpenAIUnsupportedTool>
toolChoice ToolChoice

Returns: OpenAIChatToolPreparation

View source

Prepare(IReadOnlyList<LanguageModelTool>?, ToolChoice?)

Section titled “Prepare(IReadOnlyList<LanguageModelTool>?, ToolChoice?)”
public static OpenAIChatToolPreparation Prepare(IReadOnlyList<LanguageModelTool>? tools, ToolChoice? toolChoice)

Prepares function tools. Strict is omitted when Strict is null.

Parameters

Name Type Description
tools IReadOnlyList<LanguageModelTool>
toolChoice ToolChoice

Returns: OpenAIChatToolPreparation

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product