Skip to content

OpenAIChatPromptMessage

Namespace: Vercel.AI.OpenAI

public sealed class OpenAIChatPromptMessage

One prompt message converted into an OpenAI chat message.

Inheritance: object

View source

public OpenAIChatPromptMessage(string role)

Creates a message.

Parameters

Name Type Description
role string

View source

public IReadOnlyList<OpenAIChatPromptPart>? Parts { get; set; }

User or assistant parts.

Value: IReadOnlyList<OpenAIChatPromptPart>

View source

public JsonElement? ProviderOptions { get; set; }

Provider options for this message. The openai object is read.

Value: JsonElement?

View source

public string Role { get; }

system, user, assistant, or tool.

Value: string

View source

public string? Text { get; set; }

System text, or assistant text when there are no parts.

Value: string

View source

public string? ToolCallId { get; set; }

Tool result id.

Value: string

View source

public IReadOnlyList<GeneratedToolCall>? ToolCalls { get; set; }

Assistant tool calls.

Value: IReadOnlyList<GeneratedToolCall>

View source

public string? ToolOutput { get; set; }

Tool result text.

Value: string

View source

public string? ToolOutputType { get; set; }

Tool result type: text, json, error-text, error-json, or execution-denied. Error types are sent as {"error": value}. When it is null, ToolOutput is sent as is.

Value: string

View source

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