AttractorEx.Agent.Tool (attractor_phoenix v0.1.0)

Copy Markdown View Source

Definition of a callable tool exposed to an agent session.

Tools default to target: :environment, meaning their executor receives the current execution environment. Session-managed tools such as subagent lifecycle operations set target: :session and receive the current session instead.

Summary

Functions

Serializes a tool into the model-facing definition shape.

Types

executor()

@type executor() :: (map(), term() -> String.t() | map() | list() | term())

t()

@type t() :: %AttractorEx.Agent.Tool{
  description: String.t(),
  execute: executor(),
  name: String.t(),
  parameters: map(),
  target: target()
}

target()

@type target() :: :environment | :session

Functions

definition(tool)

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

Serializes a tool into the model-facing definition shape.