Jidoka.Effect.OperationResult (Jidoka v0.9.0)

Copy Markdown View Source

Durable operation observation stored on agent state.

This is separate from Jidoka.Effect.Result: the effect result records interpreter status, while operation result records the semantic tool observation that should survive across later turns.

Summary

Functions

Builds an operation result from an operation intent and its output.

Normalizes an existing operation result, keyword list, or map.

Builds an operation result from keyword or map attributes.

Builds an operation result and raises if the attributes are invalid.

Returns the Zoi schema for an operation result.

Converts an operation result to a tool message for the model.

Types

t()

@type t() :: %Jidoka.Effect.OperationResult{
  arguments: map(),
  content: nil | nil | binary(),
  effect_id: nil | nil | binary(),
  loop_index: integer(),
  metadata: map(),
  operation: binary(),
  output: any(),
  request_id: nil | nil | binary()
}

Functions

from_effect(intent, output)

@spec from_effect(Jidoka.Effect.Intent.t(), term()) :: {:ok, t()} | {:error, term()}

Builds an operation result from an operation intent and its output.

from_input(result)

@spec from_input(t() | keyword() | map()) :: {:ok, t()} | {:error, term()}

Normalizes an existing operation result, keyword list, or map.

new(attrs)

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds an operation result from keyword or map attributes.

new!(attrs)

@spec new!(keyword() | map()) :: t()

Builds an operation result and raises if the attributes are invalid.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for an operation result.

to_message(result)

@spec to_message(t()) :: Jidoka.Agent.Message.t()

Converts an operation result to a tool message for the model.