adk_eval_adapter behaviour (erlang_adk v0.7.0)

View Source

Adapter behaviour used by versioned, multi-turn evaluation sets.

One worker process owns a case and threads State through its turns. This maps naturally to an Erlang session process while letting tests use a small deterministic adapter. The adapter may return canonical ADK events so the evaluator can preserve and score the trajectory.

Summary

Types

turn_result/0

-type turn_result() ::
          #{output := term(), events => [adk_event:event() | map()], state => term(), metadata => map()}.

Callbacks

init_case/4

(optional)
-callback init_case(Target :: term(), Case :: map(), Context :: map(), Config :: map()) ->
                       {ok, CaseTarget :: term(), InitialState :: term()} |
                       {ok, InitialState :: term()} |
                       {error, term()}.

run_turn/5

-callback run_turn(Target :: term(), Turn :: map(), State :: term(), Context :: map(), Config :: map()) ->
                      {ok, turn_result()} | {error, term()}.

terminate_case/3

(optional)
-callback terminate_case(CaseTarget :: term(), FinalState :: term(), Config :: map()) ->
                            ok | {error, term()}.