adk_planner behaviour (erlang_adk v0.7.0)

View Source

Behaviour for provider-neutral explicit planning and replanning.

Planner callbacks return data. They do not execute steps. The runtime validates every plan and invokes a separate trusted adk_plan_executor.

Summary

Types

decision/0

-type decision() ::
          continue | {replan, adk_plan:plan()} | {complete, term()} | {fail, term()} | {error, term()}.

descriptor/0

-type descriptor() :: #{module := module(), target := term(), config => map()}.

Callbacks

plan/4

-callback plan(Target :: term(), Goal :: term(), Context :: map(), Config :: map()) ->
                  {ok, adk_plan:plan()} | {complete, term()} | {error, term()}.

review/6

-callback review(Target :: term(),
                 Plan :: adk_plan:plan(),
                 Step :: adk_plan:step(),
                 Observation :: map(),
                 Context :: map(),
                 Config :: map()) ->
                    decision().