Claudio.A2A.Part (Claudio v0.5.0)

View Source

A2A Part — the smallest unit of content within a Message or Artifact.

Parts can contain text, file references, raw bytes, or structured data.

Examples

Part.text("Hello, world!")
Part.file("https://example.com/doc.pdf", "application/pdf")
Part.data(%{"key" => "value"})

Summary

Functions

Create a structured data part.

Create a file reference part.

Create a text part.

Types

t()

@type t() :: %Claudio.A2A.Part{
  data: term() | nil,
  filename: String.t() | nil,
  media_type: String.t() | nil,
  metadata: map() | nil,
  raw: binary() | nil,
  text: String.t() | nil,
  url: String.t() | nil
}

Functions

data(value)

@spec data(term()) :: t()

Create a structured data part.

file(url, media_type)

@spec file(String.t(), String.t()) :: t()

Create a file reference part.

from_map(map)

@spec from_map(map()) :: t()

text(content)

@spec text(String.t()) :: t()

Create a text part.

to_map(part)

@spec to_map(t()) :: map()