Skip to content

QuiverAIImageReference

Namespace: Vercel.AI.QuiverAI

public sealed class QuiverAIImageReference

A reference image accepted by providerOptions.quiverai.referenceImages: { "url" } or { "base64" }. Exactly one of Url and Base64 is set. Serializes to that JSON shape.

Inheritance: object

View source

[JsonPropertyName("base64")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Base64 { get; }

Base64-encoded image data without a data URL prefix, or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null"&gt;null&lt;/a> for a URL reference.

Value: string

View source

[JsonPropertyName("url")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Url { get; }

HTTP or HTTPS image URL, or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null"&gt;null&lt;/a> for a base64 reference.

Value: string

View source

public static QuiverAIImageReference Prepare(byte[] input)

Returns a base64 reference for PNG, JPEG, WebP, GIF, or SVG bytes.

Parameters

Name Type Description
input byte[]

Returns: QuiverAIImageReference

View source

public static QuiverAIImageReference Prepare(string input)

Returns a URL reference for a URL, or a base64 reference for a base64 string or a base64 data URL. Throws InvalidArgumentException for other schemes, invalid base64, or unsupported images.

Parameters

Name Type Description
input string

Returns: QuiverAIImageReference

View source

public static QuiverAIImageReference Prepare(Uri input)

Returns a URL reference for an HTTP or HTTPS URL.

Parameters

Name Type Description
input Uri

Returns: QuiverAIImageReference

View source

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