Jido.Composer.NodeIO (Jido Composer v0.4.0)

Copy Markdown View Source

Typed envelope for node output.

Wraps node results with type metadata (:map, :text, or :object) while preserving the monoidal map structure via to_map/1.

Types

  • :map — a plain map, passes through to_map/1 unchanged
  • :text — a string, wrapped as %{text: value} by to_map/1
  • :object — a structured object with optional schema, wrapped as %{object: value}

Summary

Types

io_type()

@type io_type() :: :map | :text | :object

t()

@type t() :: %Jido.Composer.NodeIO{
  meta: map(),
  schema: map() | nil,
  type: io_type(),
  value: term()
}

Functions

map(value)

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

mergeable?(node_io)

@spec mergeable?(t()) :: boolean()

object(value, schema \\ nil)

@spec object(map(), map() | nil) :: t()

text(value)

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

to_map(node_io)

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

unwrap(node_io)

@spec unwrap(t()) :: term()