Enum Content Part

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub enum ContentPart {
    Text {
        text: String,
        extra: Map<String, Json>,
    },
    ImageUrl {
        image_url: OpenAiImageUrl,
        extra: Map<String, Json>,
    },
    Image {
        image: Json,
        extra: Map<String, Json>,
    },
    Audio {
        audio: Json,
        extra: Map<String, Json>,
    },
    File {
        file: Json,
        extra: Map<String, Json>,
    },
    Refusal {
        refusal: String,
        extra: Map<String, Json>,
    },
    ToolUse {
        id: String,
        name: String,
        input: Json,
        extra: Map<String, Json>,
    },
    ToolResult {
        tool_use_id: String,
        content: Json,
        is_error: Option<bool>,
        extra: Map<String, Json>,
    },
    ProviderNative {
        provider: String,
        kind: String,
        value: Json,
    },
}

A single content part within a multimodal message.

v1 supports text only. Future versions may add ImageUrl, Audio, etc.

Variants

Text

Text

A text content part.

Fields

text: String

The text content.

extra: Map<String, Json>

Provider fields without portable semantics.

ImageUrl

ImageUrl

An image URL content part.

Fields

image_url: OpenAiImageUrl

Image URL payload.

extra: Map<String, Json>

Provider fields without portable semantics.

Image

Image

Portable image input payload.

Fields

image: Json

Provider-neutral image data object.

extra: Map<String, Json>

Provider fields without portable semantics.

Audio

Audio

Portable audio input payload.

Fields

audio: Json

Provider-neutral audio data object.

extra: Map<String, Json>

Provider fields without portable semantics.

File

File

Portable file or document input payload.

Fields

file: Json

Provider-neutral file data object.

extra: Map<String, Json>

Provider fields without portable semantics.

Refusal

Refusal

Assistant refusal content.

Fields

refusal: String

Refusal text.

extra: Map<String, Json>

Provider fields without portable semantics.

ToolUse

ToolUse

Tool call embedded in a provider content-block array.

Fields

id: String

Tool call identifier.

name: String

Tool name.

input: Json

Parsed arguments.

extra: Map<String, Json>

Provider fields without portable semantics.

ToolResult

ToolResult

Tool result embedded in a provider content-block array.

Fields

tool_use_id: String

Tool call identifier.

content: Json

Tool result payload.

is_error: Option<bool>

Whether the tool failed.

extra: Map<String, Json>

Provider fields without portable semantics.

ProviderNative

ProviderNative

Lossless provider-native content block.

Fields

provider: String

Provider surface that owns the value.

kind: String

Native block discriminator or a descriptive fallback.

value: Json

Exact provider JSON value.

Trait Implementations

impl Clone for ContentPart

impl Clone for ContentPart

clone

fn clone(&self) -> ContentPart

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for ContentPart

impl Debug for ContentPart

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'de> Deserialize<'de> for ContentPart

impl<'de> Deserialize<'de> for ContentPart

deserialize

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

impl PartialEq for ContentPart

impl PartialEq for ContentPart

eq

fn eq(&self, other: &ContentPart) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl Serialize for ContentPart

impl Serialize for ContentPart

serialize

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
    __S: Serializer,

impl StructuralPartialEq for ContentPart

impl StructuralPartialEq for ContentPart