adk_eval_environment_simulator behaviour (erlang_adk v0.10.0)

View Source

Behaviour for bounded evaluation environment simulators.

Environment simulators model effects such as a clock, database, or remote service without granting the evaluated agent a real production capability. Implementations are operator-selected Erlang modules, never names supplied by an untrusted evaluation document.

Summary

Types

effect_result/0

-type effect_result() ::
          {ok, Result :: term(), NewState :: term()} |
          {error, term(), NewState :: term()} |
          {error, term()}.

Callbacks

handle_effect/4

-callback handle_effect(Effect :: map(), State :: term(), Context :: map(), Config :: map()) ->
                           effect_result().

init/3

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

terminate/2

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