Package com.google.genkit.ai.agent
Class CustomAgentConfig.Builder<S>
java.lang.Object
com.google.genkit.ai.agent.CustomAgentConfig.Builder<S>
- Type Parameters:
S- the type of custom session state
- Enclosing class:
CustomAgentConfig<S>
Builder for
CustomAgentConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theCustomAgentConfig.clientTransform(ClientTransform<S> clientTransform) Sets the client-transform applied to session state before returning it to the caller in client-managed mode.description(String description) Sets the agent's human-readable description.Sets the agent's registered name (required).Sets the Java class for the agent's custom state type.store(SessionStore<S> store) Sets the session store for server-managed mode.storeOptions(SessionStoreOptions storeOptions) Sets the options forwarded to store operations.
-
Method Details
-
name
Sets the agent's registered name (required).- Parameters:
name- the agent name- Returns:
- this builder
-
description
Sets the agent's human-readable description.- Parameters:
description- the description- Returns:
- this builder
-
stateType
Sets the Java class for the agent's custom state type.- Parameters:
stateType- the state type class- Returns:
- this builder
-
store
Sets the session store for server-managed mode. Passnull(or omit) for client-managed mode.- Parameters:
store- the session store- Returns:
- this builder
-
clientTransform
Sets the client-transform applied to session state before returning it to the caller in client-managed mode.- Parameters:
clientTransform- the transform- Returns:
- this builder
-
storeOptions
Sets the options forwarded to store operations.- Parameters:
storeOptions- the store options- Returns:
- this builder
-
build
Builds theCustomAgentConfig.- Returns:
- a new
CustomAgentConfig - Throws:
IllegalStateException- ifnameis null or blank
-