ImageModelFile
Namespace: Vercel.AI.Operations
public sealed class ImageModelFileAn image sent to doGenerate as a file or URL.
Inheritance: object
Properties
Section titled “Properties”Base64
Section titled “Base64”public string? Base64 { get; }Base64 text when the file was created with String); otherwise null.
Value: string
public byte[]? Data { get; }Bytes when Type is file. Decoded from Base64 when the file was created from base64 text.
Value: byte[]
FileName
Section titled “FileName”public string? FileName { get; set; }File name used when a provider uploads the file as multipart form data.
Value: string
MediaType
Section titled “MediaType”public string? MediaType { get; }Media type of a file image.
Value: string
ProviderOptions
Section titled “ProviderOptions”public IReadOnlyDictionary<string, JsonElement>? ProviderOptions { get; set; }Provider options for this file, keyed by provider id.
Value: IReadOnlyDictionary<string, JsonElement>
public string Type { get; }url or file.
Value: string
public string? Url { get; }URL when Type is url.
Value: string
Methods
Section titled “Methods”FromBase64(string, string, string?)
Section titled “FromBase64(string, string, string?)”public static ImageModelFile FromBase64(string data, string mediaType, string? fileName = null)Creates an image from base64 text. Providers that send base64 pass the text unchanged.
Parameters
| Name | Type | Description |
|---|---|---|
data |
string | |
mediaType |
string | |
fileName |
string |
Returns: ImageModelFile
FromFile(byte[], string, string?)
Section titled “FromFile(byte[], string, string?)”public static ImageModelFile FromFile(byte[] data, string mediaType, string? fileName = null)Creates a binary image.
Parameters
| Name | Type | Description |
|---|---|---|
data |
byte[] | |
mediaType |
string | |
fileName |
string |
Returns: ImageModelFile
FromUrl(string)
Section titled “FromUrl(string)”public static ImageModelFile FromUrl(string url)Creates a URL image.
Parameters
| Name | Type | Description |
|---|---|---|
url |
string |
Returns: ImageModelFile
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product