类的用途(Uses of the Class)
com.google.adk.tools.ToolContext
Packages that use ToolContext
Package
Description
-
**用途:** ToolContext 在……里面;处于……状态 com.example
Methods in com.example with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.example.a2a_basic
Methods in com.example.a2a_basic with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.example.helloworld
Methods in com.example.helloworld with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.example.workflows
Methods in com.example.workflows with parameters of type ToolContextModifier and TypeMethodDescriptionOrderProcessingWorkflow.CreditBureau.creditCheck(ToolContext toolContext, String customerId, int orderTotalUsd) 检查客户的信用额度是否足以覆盖订单的总金额。 -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.agents
Methods in com.google.adk.agents with parameters of type ToolContextModifier and TypeMethodDescriptionCallbacks.AfterToolCallback.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext, Object response) 工具运行完成后会触发异步回调函数。Callbacks.AfterToolCallbackSync.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext, Object response) Callbacks.BeforeToolCallback.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext) 在工具运行之前执行的异步回调函数。Callbacks.BeforeToolCallbackSync.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext) Callbacks.OnToolErrorCallback.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext, Exception error) 当工具调用失败时,会触发异步回调函数。Callbacks.OnToolErrorCallbackSync.call(InvocationContext invocationContext, BaseTool baseTool, Map<String, Object> input, ToolContext toolContext, Exception error) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.flows.llmflows
Methods in com.google.adk.flows.llmflows with parameters of type ToolContextModifier and TypeMethodDescriptionstatic voidAgentTransfer.transferToAgent(String agentName, ToolContext toolContext) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.models.springai
Methods in com.google.adk.models.springai with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.plugins
Methods in com.google.adk.plugins with parameters of type ToolContextModifier and TypeMethodDescriptionDebugLoggingPlugin.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) LoggingPlugin.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) Plugin.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) 在某个工具被调用之后,会执行相应的回调函数。PluginManager.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) ReflectAndRetryToolPlugin.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) 如果操作成功,该工具的故障计数会被重置;如果操作本身是成功的,但其中包含错误信息,这些错误信息会被传递到重试逻辑中(即系统会尝试再次执行该操作)。DebugLoggingPlugin.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) LoggingPlugin.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) Plugin.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) 回调函数在工具被调用之前执行。PluginManager.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) ReplayPlugin.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) ReflectAndRetryToolPlugin.ResultErrorExtractor.extractErrorFromResult(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) 返回错误信息。result例如:result当它包含自身时(即当它自身也是其所包含的内容时)"status": "error"如果调用成功,该参数将包含返回的结果;否则该参数为空。DebugLoggingPlugin.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) LoggingPlugin.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) Plugin.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) 当工具调用遇到错误时,会执行此回调函数。PluginManager.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) ReflectAndRetryToolPlugin.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) 将工具使用过程中出现的错误转化为对模型的反馈建议(即指导模型如何改进其行为)。 -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.plugins.agentanalytics
Methods in com.google.adk.plugins.agentanalytics with parameters of type ToolContextModifier and TypeMethodDescriptionBigQueryAgentAnalyticsPlugin.afterToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Map<String, Object> result) BigQueryAgentAnalyticsPlugin.beforeToolCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext) BigQueryAgentAnalyticsPlugin.onToolErrorCallback(BaseTool tool, Map<String, Object> toolArgs, ToolContext toolContext, Throwable error) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools
Methods in com.google.adk.tools that return ToolContextMethods in com.google.adk.tools with parameters of type ToolContextModifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableLoadArtifactsTool.appendArtifactsToLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) FunctionTool.callLive(Map<String, Object> args, ToolContext toolContext, InvocationContext invocationContext) static voidExitLoopTool.exitLoop(ToolContext toolContext) 退出……LoopAgentexecution.static io.reactivex.rxjava3.core.Single<LoadMemoryResponse> LoadMemoryTool.loadMemory(String query, ToolContext toolContext) 为当前用户加载内存数据。io.reactivex.rxjava3.core.CompletableBaseTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) 处理出站(即发送到外部系统的)数据/信息。LlmRequest.Builder.default io.reactivex.rxjava3.core.CompletableBaseToolset.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) 处理出站(即发送到外部系统的)数据/信息。LlmRequest.Builder.io.reactivex.rxjava3.core.CompletableBuiltInCodeExecutionTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableExampleTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableGoogleMapsTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableGoogleSearchTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableLoadArtifactsTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableLoadMemoryTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableUrlContextTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) io.reactivex.rxjava3.core.CompletableVertexAiSearchTool.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) AgentTool.runAsync(Map<String, Object> args, ToolContext toolContext) final <I,O> io.reactivex.rxjava3.core.Single <O> BaseTool.runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.core.type.TypeReference<? extends O> typeReference) 调用一个带有通用参数的工具,并将返回的结果转换为指定的类型。final <I,O> io.reactivex.rxjava3.core.Single <O> BaseTool.runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.core.type.TypeReference<? extends O> typeReference) 调用一个工具,该工具接受通用的参数以及一个自定义的参数。ObjectMapper返回结果后,这些结果会被转换为指定的数据类型。final <I,O> io.reactivex.rxjava3.core.Single <O> BaseTool.runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Class<? extends O> oClass) 调用一个工具,该工具接受通用的参数以及一个自定义的参数。ObjectMapper返回结果后,这些结果会被转换成指定的类类型。final <I,O> io.reactivex.rxjava3.core.Single <O> BaseTool.runAsync(I args, ToolContext toolContext, Class<? extends O> oClass) 调用一个带有通用参数的工具,并将返回的结果转换为指定的数据类型(即指定的类)。BaseTool.runAsync(Map<String, Object> args, ToolContext toolContext) 调用一个工具。BaseTool.runAsync(T args, ToolContext toolContext) 该函数使用通用的参数调用某个工具,并返回一个包含所有结果的映射(即一个键值对集合)。BaseTool.runAsync(T args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 使用自定义方式调用一个带有通用参数的工具。ObjectMapper并返回一个包含结果的映射(map)。FunctionTool.runAsync(Map<String, Object> args, ToolContext toolContext) LoadArtifactsTool.runAsync(Map<String, Object> args, ToolContext toolContext) SetModelResponseTool.runAsync(Map<String, Object> args, ToolContext toolContext) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools.applicationintegrationtoolset
Methods in com.google.adk.tools.applicationintegrationtoolset with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools.computeruse
Methods in com.google.adk.tools.computeruse with parameters of type ToolContextModifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableComputerUseToolset.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) 将计算机使用配置信息添加到大型语言模型(LLM)的请求中。ComputerUseTool.runAsync(Map<String, Object> args, ToolContext toolContext) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools.mcp
Methods in com.google.adk.tools.mcp with parameters of type ToolContext -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools.retrieval
Methods in com.google.adk.tools.retrieval with parameters of type ToolContextModifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableVertexAiRagRetrieval.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) VertexAiRagRetrieval.runAsync(Map<String, Object> args, ToolContext toolContext) -
**用途:** ToolContext 在……里面;处于……状态 com.google.adk.tools.skills
Methods in com.google.adk.tools.skills with parameters of type ToolContextModifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableSkillToolset.processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)