Class ToolContext
java.lang.Object
com.google.adk.agents.ReadonlyContext
com.google.adk.agents.CallbackContext
com.google.adk.tools.ToolContext
ToolContext object provides a structured context for executing tools or functions.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class CallbackContext
eventActionsFields inherited from class ReadonlyContext
invocationContext -
Method Summary
Modifier and TypeMethodDescriptionactions()static ToolContext.Builderbuilder(InvocationContext invocationContext) voidfunctionCallId(String functionCallId) voidRequests confirmation for the given function call.voidrequestConfirmation(String hint) Requests confirmation for the given function call.voidrequestConfirmation(String hint, Object payload) Requests confirmation for the given function call.io.reactivex.rxjava3.core.Single<SearchMemoryResponse> searchMemory(String query) Searches the memory of the current user.voidsetActions(EventActions actions) voidtoolConfirmation(ToolConfirmation toolConfirmation) toString()Methods inherited from class CallbackContext
eventActions, eventId, listArtifacts, loadArtifact, loadArtifact, loadArtifact, saveArtifact, stateMethods inherited from class ReadonlyContext
agentName, branch, events, invocationContext, invocationId, sessionId, userContent, userId
-
Method Details
-
actions
-
setActions
-
functionCallId
-
functionCallId
-
toolConfirmation
-
toolConfirmation
-
requestConfirmation
-
requestConfirmation
Requests confirmation for the given function call.- Parameters:
hint- A hint to the user on how to confirm the tool call.
-
requestConfirmation
public void requestConfirmation()Requests confirmation for the given function call. -
searchMemory
Searches the memory of the current user. -
builder
-
toBuilder
-
toString
-