Package com.google.genkit.agent
Class AgentConfig.Builder<S>
java.lang.Object
com.google.genkit.agent.AgentConfig.Builder<S>
- Type Parameters:
S- the type of custom session state
- Enclosing class:
AgentConfig<S>
Builder for
AgentConfig.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theAgentConfig.clientTransform(ClientTransform<S> clientTransform) Sets the client-transform applied to session state before returning it to the caller in client-managed mode.config(GenerationConfig config) Sets the generation configuration.description(String description) Sets the agent's human-readable description.Sets the maximum number of tool-execution turns for a single generate call.Sets the model name to use for generation.Sets the agent's registered name (required).promptInput(Object promptInput) Sets the input passed to the prompt fordefinePromptAgent.promptName(String promptName) Sets the name of a registered prompt to drivedefinePromptAgent.Sets the Java class for the agent's custom state type.store(SessionStore<S> store) Sets the session store for server-managed mode.Sets the system prompt for the agent.Sets the tools available to the agent.Sets the tools available to the agent.
-
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
-
model
Sets the model name to use for generation. Whennull, the Genkit default model is used.- Parameters:
model- the model name- Returns:
- this builder
-
system
Sets the system prompt for the agent.- Parameters:
system- the system prompt- Returns:
- this builder
-
tools
Sets the tools available to the agent.- Parameters:
tools- the tools- Returns:
- this builder
-
tools
Sets the tools available to the agent.- Parameters:
tools- the tools- Returns:
- this builder
-
config
Sets the generation configuration.- Parameters:
config- the config- Returns:
- this builder
-
maxTurns
Sets the maximum number of tool-execution turns for a single generate call.- Parameters:
maxTurns- the max turns- 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
-
stateType
Sets the Java class for the agent's custom state type.- Parameters:
stateType- the state type class- 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
-
promptName
Sets the name of a registered prompt to drivedefinePromptAgent.- Parameters:
promptName- the prompt name- Returns:
- this builder
-
promptInput
Sets the input passed to the prompt fordefinePromptAgent.- Parameters:
promptInput- the prompt input- Returns:
- this builder
-
build
Builds theAgentConfig.- Returns:
- a new
AgentConfig - Throws:
IllegalStateException- ifnameis null or blank
-