Class AgentActions

java.lang.Object
com.google.genkit.ai.agent.internal.AgentActions

public final class AgentActions extends Object
Factory for defining custom agents.

The main entry point is defineCustomAgent(Registry, CustomAgentConfig, AgentFn).

  • 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 into
      config - the agent configuration
      fn - the agent function implementing per-turn logic
      Returns:
      the constructed and registered Agent