OpenAIChatPromptPart
Namespace: Vercel.AI.OpenAI
public sealed class OpenAIChatPromptPartOne user or assistant content part.
Inheritance: object
Constructors
Section titled “Constructors”OpenAIChatPromptPart(string)
Section titled “OpenAIChatPromptPart(string)”public OpenAIChatPromptPart(string type)Creates a part. <code class=“paramref”>type</code> is text or file.
Parameters
| Name | Type | Description |
|---|---|---|
type |
string |
Properties
Section titled “Properties”Base64
Section titled “Base64”public string? Base64 { get; set; }Base64 payload used as-is when Data is null.
Value: string
public byte[]? Data { get; set; }Inline file bytes.
Value: byte[]
FileId
Section titled “FileId”public string? FileId { get; set; }OpenAI file id.
Value: string
FileName
Section titled “FileName”public string? FileName { get; set; }File name for PDF data.
Value: string
MediaType
Section titled “MediaType”public string? MediaType { get; set; }IANA media type for a file part.
Value: string
ProviderOptions
Section titled “ProviderOptions”public JsonElement? ProviderOptions { get; set; }Provider options for this part.
Value: JsonElement?
ProviderReference
Section titled “ProviderReference”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>
public string? Text { get; set; }Text, when Type is text.
Value: string
public string Type { get; }Part type.
Value: string
public string? Url { get; set; }Remote URL for a file part.
Value: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product