adk_context (erlang_adk v0.7.0)

View Source

Public, least-authority helpers for invocation and tool contexts.

Summary

Functions

abort_effects(Runtime, Receipt)

-spec abort_effects(map(), none | reference()) -> ok | {error, term()}.

add_memory(Context, Entry, Options)

-spec add_memory(map(), map(), map()) -> term().

attach_artifact(Context, Name, Selector)

-spec attach_artifact(map(), binary(), latest | pos_integer()) -> term().

capabilities()

-spec capabilities() -> [atom()].

commit_effects(Runtime, Receipt)

-spec commit_effects(map(), none | reference()) -> ok | {error, term()}.

delete_artifact(Context, Name, Selector)

-spec delete_artifact(map(), binary(), all | latest | pos_integer()) -> term().

delete_memory(Context, Id)

-spec delete_memory(map(), binary()) -> term().

identity(Context)

-spec identity(map()) -> {ok, map()} | {error, term()}.

list_artifact_versions(Context, Name, Options)

-spec list_artifact_versions(map(), binary(), map()) -> term().

list_artifacts(Context, Options)

-spec list_artifacts(map(), map()) -> term().

load_artifact(Context, Name, Selector)

-spec load_artifact(map(), binary(), latest | pos_integer()) -> term().

prepare_effects(Runtime, CallId)

-spec prepare_effects(map(), term()) -> {ok, none | reference(), [map()]} | {error, term()}.

project_tool(Module, Context, Runtime)

-spec project_tool(module(), map(), map()) -> {ok, map()} | {error, term()}.

Project a raw internal context for a local tool module. Modules which do not declare context_capabilities/0 remain on the explicit legacy path.

save_artifact(Context, Name, Data, Options)

-spec save_artifact(map(), binary(), binary(), map()) -> term().

search_memory(Context, Query, Options)

-spec search_memory(map(), binary(), map()) -> term().

state(Context)

-spec state(map()) -> {ok, map()} | {error, term()}.

take_effects(Runtime, CallId)

-spec take_effects(map(), term()) -> {ok, [map()]} | {error, term()}.