FilePartInput
Namespace: Vercel.AI.Prompt
public sealed class FilePartInputA file-part value before it is converted to the v4 provider shape.
Inheritance: object
Properties
Section titled “Properties”public byte[]? Bytes { get; }Inline bytes.
Value: byte[]
IsArrayBuffer
Section titled “IsArrayBuffer”public bool IsArrayBuffer { get; }True when Bytes came from an ArrayBuffer and should be copied.
Value: bool
Reference
Section titled “Reference”public IReadOnlyDictionary<string, string>? Reference { get; }Provider reference.
Value: IReadOnlyDictionary<string, string>
public string? Text { get; }Text payload.
Value: string
TextData
Section titled “TextData”public string? TextData { get; }Inline base64 or any non-URL string.
Value: string
public string? Type { get; }Tagged type, when this value is already tagged.
Value: string
public Uri? Url { get; }URL instance.
Value: Uri
UrlText
Section titled “UrlText”public string? UrlText { get; }URL string that has not been parsed yet.
Value: string
Methods
Section titled “Methods”FromArrayBuffer(byte[])
Section titled “FromArrayBuffer(byte[])”public static FilePartInput FromArrayBuffer(byte[] bytes)Creates an ArrayBuffer payload. The bytes are copied during conversion.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: FilePartInput
FromBytes(byte[])
Section titled “FromBytes(byte[])”public static FilePartInput FromBytes(byte[] bytes)Creates inline bytes.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: FilePartInput
FromReference(IReadOnlyDictionary<string, string>)
Section titled “FromReference(IReadOnlyDictionary<string, string>)”public static FilePartInput FromReference(IReadOnlyDictionary<string, string> reference)Creates a provider reference.
Parameters
| Name | Type | Description |
|---|---|---|
reference |
IReadOnlyDictionary<string, string> |
Returns: FilePartInput
FromString(string)
Section titled “FromString(string)”public static FilePartInput FromString(string value)Creates a string payload. URLs and data URLs are detected during conversion.
Parameters
| Name | Type | Description |
|---|---|---|
value |
string |
Returns: FilePartInput
FromUrl(Uri)
Section titled “FromUrl(Uri)”public static FilePartInput FromUrl(Uri url)Creates a URL payload.
Parameters
| Name | Type | Description |
|---|---|---|
url |
Uri |
Returns: FilePartInput
TaggedData(byte[])
Section titled “TaggedData(byte[])”public static FilePartInput TaggedData(byte[] bytes)Creates tagged inline bytes.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: FilePartInput
TaggedData(string)
Section titled “TaggedData(string)”public static FilePartInput TaggedData(string data)Creates tagged inline text. A data URL is rejected.
Parameters
| Name | Type | Description |
|---|---|---|
data |
string |
Returns: FilePartInput
TaggedDataBuffer(byte[])
Section titled “TaggedDataBuffer(byte[])”public static FilePartInput TaggedDataBuffer(byte[] bytes)Creates tagged inline bytes copied from an ArrayBuffer.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: FilePartInput
TaggedReference(IReadOnlyDictionary<string, string>)
Section titled “TaggedReference(IReadOnlyDictionary<string, string>)”public static FilePartInput TaggedReference(IReadOnlyDictionary<string, string> reference)Creates a tagged provider reference.
Parameters
| Name | Type | Description |
|---|---|---|
reference |
IReadOnlyDictionary<string, string> |
Returns: FilePartInput
TaggedText(string)
Section titled “TaggedText(string)”public static FilePartInput TaggedText(string text)Creates a tagged text part.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: FilePartInput
TaggedUrl(Uri)
Section titled “TaggedUrl(Uri)”public static FilePartInput TaggedUrl(Uri url)Creates a tagged URL.
Parameters
| Name | Type | Description |
|---|---|---|
url |
Uri |
Returns: FilePartInput
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product