FileDataConversions
Namespace: Vercel.AI.ProviderUtils
public static class FileDataConversionsConverts file payloads to the forms providers send.
Inheritance: object
Methods
Section titled “Methods”ConvertImageModelFileToDataUri(ImageModelFile)
Section titled “ConvertImageModelFileToDataUri(ImageModelFile)”public static string ConvertImageModelFileToDataUri(ImageModelFile file)Returns the URL of a URL file, or a base64 data URI for a file with bytes.
Maps to convertImageModelFileToDataUri.
Parameters
| Name | Type | Description |
|---|---|---|
file |
ImageModelFile |
Returns: string
ConvertInlineFileDataToUint8Array(LanguageModelFilePart)
Section titled “ConvertInlineFileDataToUint8Array(LanguageModelFilePart)”public static byte[] ConvertInlineFileDataToUint8Array(LanguageModelFilePart part)Returns the bytes of an inline data or text file part. Base64 data is decoded and text is UTF-8 encoded.
Maps to convertInlineFileDataToUint8Array.
Parameters
| Name | Type | Description |
|---|---|---|
part |
LanguageModelFilePart |
Returns: byte[]
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product