adk_memory_embedding_provider behaviour (erlang_adk v0.10.0)

View Source

Bounded provider contract for memory embeddings.

Summary

Types

result/0

-type result() ::
          #{model := binary(), dimensions := pos_integer(), vectors := [vector()], usage => map()}.

service_ref/0

-type service_ref() :: {module(), term()}.

vector/0

-type vector() :: [float()].

Callbacks

capabilities/1

-callback capabilities(Handle :: term()) -> map() | {ok, map()}.

embed/4

-callback embed(Handle :: term(), Model :: binary(), Inputs :: [binary()], Options :: map()) ->
                   {ok, result()} | {error, term()}.

Functions

default_limits()

embed(_, Model, Inputs, Options, CallOptions)

Invoke an embedding provider in a killable bounded worker.

validate_request(Model, Inputs, Options, Limits)

validate_result(Result, Count, Limits)