Spectre.Action.Planner behaviour (Spectre v0.3.0)

Copy Markdown View Source

Port implemented by optional action-planning libraries.

A planner may inspect an LLM reply and return provider-neutral Spectre.Action values. It cannot execute providers or mutate Agent state.

Summary

Types

response()

@type response() :: %{reply_text: String.t(), actions: [Spectre.Action.t() | map()]}

Callbacks

clean_reply(t, arg2, keyword)

(optional)
@callback clean_reply(String.t(), Spectre.Context.t() | map(), keyword()) :: String.t()

plan(t, arg2, keyword)

(optional)
@callback plan(String.t(), Spectre.Context.t() | map(), keyword()) ::
  {:ok, Spectre.Action.t() | map()} | {:error, term()}

plan_response(t, arg2, keyword)

@callback plan_response(String.t(), Spectre.Context.t() | map(), keyword()) ::
  {:ok, response()} | {:error, term()}