`Class LongRunningFunctionTool`
java.lang.Object
com.google.adk.tools.BaseTool
com.google.adk.tools.FunctionTool
com.google.adk.tools.LongRunningFunctionTool
这是一个函数工具,能够异步地返回结果。
-
嵌套类概述
Nested classes/interfaces inherited from class BaseTool
BaseTool.ToolArgsConfig, BaseTool.ToolConfigModifier and TypeClassDescriptionstatic class用于工具参数的配置类,支持任意键值对(key-value pairs)的配置。static class用于在 YAML/JSON 格式中定义工具的配置类。 -
方法概述
Modifier and TypeMethodDescriptionstatic LongRunningFunctionToolcreate(FunctionTool tool) 从一个 `FunctionTool` 对象创建一个 `LongRunningFunctionTool` 对象。static LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolstatic LongRunningFunctionToolfromConfig(BaseTool.ToolArgsConfig config, String configAbsPath) Methods inherited from class FunctionTool
callLive, create, create, create, create, declaration, func, isStreaming, runAsyncModifier and TypeMethodDescriptioncallLive(Map<String, Object> args, ToolContext toolContext, InvocationContext invocationContext) static FunctionToolstatic FunctionToolstatic FunctionToolstatic FunctionToolOptional<com.google.genai.types.FunctionDeclaration> 获取(所需的信息或数据)FunctionDeclaration该工具的表示方式(即如何展示或使用该工具)。func()返回底层的函数。Method.boolean如果被包装的函数返回一个 `Flowable` 对象,并且该对象可以被用于数据流处理(即进行流式操作),则返回 `true`。runAsync(Map<String, Object> args, ToolContext toolContext) 调用一个工具。Methods inherited from class BaseTool
customMetadata, description, fromConfig, longRunning, name, processLlmRequest, runAsync, runAsync, runAsync, runAsync, runAsync, runAsync, setCustomMetadataModifier and TypeMethodDescription返回该工具元数据的只读视图。static BaseToolfromConfig(BaseTool.ToolConfig config, String configAbsPath) 根据配置文件创建一个工具实例。booleanname()io.reactivex.rxjava3.core.CompletableprocessLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) 处理出站(即发送到外部系统的)数据/信息。LlmRequest.Builder.final <I,O> io.reactivex.rxjava3.core.Single <O> runAsync(I args, ToolContext toolContext, com.fasterxml.jackson.core.type.TypeReference<? extends O> typeReference) 调用一个带有通用参数的工具,并将返回的结果转换为指定的类型。final <I,O> io.reactivex.rxjava3.core.Single <O> 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> 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> runAsync(I args, ToolContext toolContext, Class<? extends O> oClass) 调用一个带有通用参数的工具,并将返回的结果转换为指定的数据类型(即指定的类)。runAsync(T args, ToolContext toolContext) 该函数使用通用的参数调用某个工具,并返回一个包含所有结果的映射(即一个键值对集合)。runAsync(T args, ToolContext toolContext, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 使用自定义方式调用一个带有通用参数的工具。ObjectMapper并返回一个包含结果的映射(map)。voidsetCustomMetadata(String key, Object value) 为与该键关联的工具设置自定义元数据。
-
方法详细信息(Method Details)
-
create
-
create
-
create
-
create
public static LongRunningFunctionTool create(Class<?> cls, String methodName, boolean requireConfirmation) -
create
-
create
public static LongRunningFunctionTool create(Object instance, String methodName, boolean requireConfirmation) -
create
-
create
public static LongRunningFunctionTool create(@Nullable Object instance, Method method, boolean requireConfirmation) -
create
从一个 `FunctionTool` 对象创建一个 `LongRunningFunctionTool` 对象。 -
fromConfig
public static LongRunningFunctionTool fromConfig(BaseTool.ToolArgsConfig config, String configAbsPath)
-