Class AgentActions
java.lang.Object
com.google.genkit.ai.agent.internal.AgentActions
Factory for defining custom agents.
The main entry point is defineCustomAgent(Registry, CustomAgentConfig, AgentFn).
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> Agent<S> defineCustomAgent(Registry registry, CustomAgentConfig<S> config, AgentFn<S> fn) Defines a custom agent, registers it (and any companion actions) with the registry, and returns the agent instance.
-
Method Details
-
defineCustomAgent
public static <S> Agent<S> defineCustomAgent(Registry registry, CustomAgentConfig<S> config, AgentFn<S> fn) Defines a custom agent, registers it (and any companion actions) with the registry, and returns the agent instance.- Type Parameters:
S- the type of custom session state- Parameters:
registry- the registry to register the agent and companion actions intoconfig- the agent configurationfn- the agent function implementing per-turn logic- Returns:
- the constructed and registered
Agent
-