Skip to content

EveContentPart

NexusLabs.Eve

EveContentPart Class

Wraps one AI SDK-compatible user-content part.

public sealed record EveContentPart : System.IEquatable<NexusLabs.Eve.EveContentPart>

Inheritance System.Object 🡒 EveContentPart

Implements System.IEquatable<EveContentPart>

Properties

EveContentPart.Json Property

Gets the JSON object sent to eve.

public System.Text.Json.JsonElement Json { get; }

Property Value

System.Text.Json.JsonElement

Methods

EveContentPart.CreateFile(string, string, string) Method

Creates a file content part from a URL or data URL.

public static NexusLabs.Eve.EveContentPart CreateFile(string data, string mediaType, string? filename=null);

Parameters

data System.String

The file URL or inline data URL.

mediaType System.String

The file media type.

filename System.String

The optional filename.

Returns

EveContentPart
A file content part.

EveContentPart.CreateFile(ReadOnlySpan\<byte>, string, string) Method

Creates an inline file content part from bytes.

public static NexusLabs.Eve.EveContentPart CreateFile(System.ReadOnlySpan<byte> bytes, string mediaType, string? filename=null);

Parameters

bytes System.ReadOnlySpan<System.Byte>

The file bytes.

mediaType System.String

The file media type.

filename System.String

The optional filename.

Returns

EveContentPart
A file content part containing a base64 data URL.

EveContentPart.CreateImage(string, string) Method

Creates an image content part from a URL or data URL.

public static NexusLabs.Eve.EveContentPart CreateImage(string image, string? mediaType=null);

Parameters

image System.String

The image URL or inline data URL.

mediaType System.String

The optional image media type.

Returns

EveContentPart
An image content part.

EveContentPart.CreateText(string) Method

Creates a text content part.

public static NexusLabs.Eve.EveContentPart CreateText(string text);

Parameters

text System.String

The user text.

Returns

EveContentPart
A text content part.

EveContentPart.FromJson(JsonElement) Method

Wraps a future or custom AI SDK content-part object.

public static NexusLabs.Eve.EveContentPart FromJson(System.Text.Json.JsonElement json);

Parameters

json System.Text.Json.JsonElement

The content-part JSON object.

Returns

EveContentPart
A content part that preserves the supplied JSON.