Toolnexus.ToolResult (toolnexus v0.9.4)

Copy Markdown View Source

Uniform tool result (SPEC §1). metadata.pending carrying a Request = suspension (§10).

Summary

Functions

Convenience: an error result with the given text.

Convenience: a success result with the given text.

True when this result is a §10 suspension (metadata.pending is a Request).

Types

t()

@type t() :: %Toolnexus.ToolResult{
  is_error: boolean(),
  metadata: map() | nil,
  output: String.t()
}

Functions

error(text)

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

Convenience: an error result with the given text.

ok(text)

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

Convenience: a success result with the given text.

pending?(arg1)

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

True when this result is a §10 suspension (metadata.pending is a Request).