Skip to content

OpenAIChatPromptPart

Namespace: Vercel.AI.OpenAI

public sealed class OpenAIChatPromptPart

One user or assistant content part.

Inheritance: object

View source

public OpenAIChatPromptPart(string type)

Creates a part. <code class=“paramref”>type</code> is text or file.

Parameters

Name Type Description
type string

View source

public string? Base64 { get; set; }

Base64 payload used as-is when Data is null.

Value: string

View source

public byte[]? Data { get; set; }

Inline file bytes.

Value: byte[]

View source

public string? FileId { get; set; }

OpenAI file id.

Value: string

View source

public string? FileName { get; set; }

File name for PDF data.

Value: string

View source

public string? MediaType { get; set; }

IANA media type for a file part.

Value: string

View source

public JsonElement? ProviderOptions { get; set; }

Provider options for this part.

Value: JsonElement?

View source

public IReadOnlyDictionary<string, string>? ProviderReference { get; set; }

File ids by provider. The openai entry is sent as the file id; a missing entry throws.

Value: IReadOnlyDictionary<string, string>

View source

public string? Text { get; set; }

Text, when Type is text.

Value: string

View source

public string Type { get; }

Part type.

Value: string

View source

public string? Url { get; set; }

Remote URL for a file part.

Value: string

View source

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