Registry class final
Holds the actions, plugins, and named values of a Genkit instance.
Reach it through ai.registry. Plugins and middleware use it to look up
actions (lookupAction, listActions), register their own (register),
and keep plugin-scoped values (registerValue, lookupValue,
listValues).
A child registry (Registry.childOf) sees everything in its parent and
shadows it with its own entries; generate uses one to scope inline tools
to a single call.
Constructors
- Registry({Registry? parent})
- Registry.childOf(Registry parent)
-
factory
Properties
Methods
-
listActions(
) → Future< List< ActionMetadata> > -
listValues<
T> (String type) → Map< String, T> -
Returns every value in the
typenamespace, keyed by registry path (/<type>/<name>), with this registry's entries shadowing the parent's. -
lookupAction(
ActionType actionType, String name) → Future< Action?> -
lookupValue<
T> (String type, String name) → T? -
Returns the value registered under
namein thetypenamespace, here or in a parent registry, or null when there is none. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
Action action) → void -
registerValue(
String type, String name, dynamic value) → void -
Stores
valueundernamein thetypenamespace, replacing any previous value with the same key. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited