adk_eval_user_simulator behaviour (erlang_adk v0.10.0)

View Source

Behaviour for deterministic evaluation user simulators.

A simulator is invoked inside the evaluation case worker. Implementations must keep all returned values JSON-compatible; the runner applies hard step, byte, heap, and deadline bounds before values enter a stored result.

Summary

Types

next_result/0

-type next_result() ::
          {continue, Turn :: map(), NewState :: term()} | {done, NewState :: term()} | {error, term()}.

Callbacks

init/3

(optional)
-callback init(Scenario :: map(), Context :: map(), Config :: map()) ->
                  {ok, State :: term()} | {error, term()}.

next_turn/4

-callback next_turn(Transcript :: [map()], State :: term(), Context :: map(), Config :: map()) ->
                       next_result().

terminate/2

(optional)
-callback terminate(State :: term(), Config :: map()) -> ok.