Class CustomAgentConfig<S>

java.lang.Object
com.google.genkit.ai.agent.CustomAgentConfig<S>
Type Parameters:
S - the type of custom session state

public final class CustomAgentConfig<S> extends Object
Configuration for defining a custom agent via AgentActions.defineCustomAgent.

Use the CustomAgentConfig.Builder to configure the agent. The only required field is getName().

  • Method Details

    • builder

      public static <S> CustomAgentConfig.Builder<S> builder()
      Creates a builder for CustomAgentConfig.
      Type Parameters:
      S - the type of custom session state
      Returns:
      a new builder
    • getName

      public String getName()
      Returns the agent's registered name.
      Returns:
      the agent name (never null)
    • getDescription

      public String getDescription()
      Returns the agent's human-readable description.
      Returns:
      the description, or null if not set
    • getStateType

      public Class<S> getStateType()
      Returns the Java class for the agent's custom state type.
      Returns:
      the state type class, or null if not specified
    • getStore

      public SessionStore<S> getStore()
      Returns the session store for server-managed agents.

      When null, the agent operates in client-managed mode.

      Returns:
      the session store, or null for client-managed mode
    • getClientTransform

      public ClientTransform<S> getClientTransform()
      Returns the client-transform applied to session state before returning it to the caller in client-managed mode.
      Returns:
      the client transform, or null if not set
    • getStoreOptions

      public SessionStoreOptions getStoreOptions()
      Returns the options forwarded to store operations.
      Returns:
      the store options, or null if not set