View Source LlmComposer.Cache.Behaviour behaviour (llm_composer v0.13.0)
Cache behaviour to use other implementations for cache mod.
Summary
Callbacks
Deletes a key from the cache.
Returns :ok.
Retrieves a value from the cache by key.
Returns {:ok, value} if found and not expired, :miss otherwise.
Stores a value in the cache with the given key and TTL in seconds.
Returns :ok.
Callbacks
@callback delete(key :: term()) :: :ok
Deletes a key from the cache.
Returns :ok.
Retrieves a value from the cache by key.
Returns {:ok, value} if found and not expired, :miss otherwise.
@callback put(key :: term(), value :: term(), ttl_seconds :: non_neg_integer()) :: :ok
Stores a value in the cache with the given key and TTL in seconds.
Returns :ok.