Class LlmAgent
java.lang.Object
com.google.adk.agents.BaseAgent
com.google.adk.agents.LlmAgent
The LLM-based agent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forLlmAgent.static enumEnum to define if contents of previous events should be included in requests to the underlying LLM. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LlmAgent.Builderbuilder()Returns aLlmAgent.BuilderforLlmAgent.io.reactivex.rxjava3.core.Single<String> Constructs the text global instruction for this agent based on theglobalInstructionfield.io.reactivex.rxjava3.core.Single<String> canonicalInstruction(ReadonlyContext context) Constructs the text instruction for this agent based on theinstructionfield.protected BaseLlmFlowbooleanbooleanexecutor()Optional<com.google.genai.types.GenerateContentConfig> Optional<com.google.genai.types.Schema> model()Optional<com.google.genai.types.Schema> booleanplanning()protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext) protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext) tools()Methods inherited from class com.google.adk.agents.BaseAgent
afterAgentCallback, beforeAgentCallback, description, findAgent, findSubAgent, name, parentAgent, parentAgent, rootAgent, runAsync, runLive, subAgents
-
Constructor Details
-
LlmAgent
-
-
Method Details
-
builder
Returns aLlmAgent.BuilderforLlmAgent. -
determineLlmFlow
-
runAsyncImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext) - Specified by:
runAsyncImplin classBaseAgent
-
runLiveImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext) - Specified by:
runLiveImplin classBaseAgent
-
canonicalInstruction
Constructs the text instruction for this agent based on theinstructionfield.This method is only for use by Agent Development Kit.
- Parameters:
context- The context to retrieve the session state.- Returns:
- The resolved instruction as a
Singlewrapped string.
-
canonicalGlobalInstruction
Constructs the text global instruction for this agent based on theglobalInstructionfield.This method is only for use by Agent Development Kit.
- Parameters:
context- The context to retrieve the session state.- Returns:
- The resolved global instruction as a
Singlewrapped string.
-
instruction
-
globalInstruction
-
model
-
planning
public boolean planning() -
generateContentConfig
-
exampleProvider
-
includeContents
-
tools
-
disallowTransferToParent
public boolean disallowTransferToParent() -
disallowTransferToPeers
public boolean disallowTransferToPeers() -
beforeModelCallback
-
afterModelCallback
-
beforeToolCallback
-
afterToolCallback
-
inputSchema
-
outputSchema
-
executor
-
outputKey
-
resolvedModel
-