类:Workflow.Builder
java.lang.Object
com.google.adk.workflow.Workflow.Builder
- Enclosing class:
Workflow
“Builder for”是一个用于描述某种构建工具或框架的术语。它通常表示该工具/框架用于帮助开发者或系统管理员快速、高效地创建或构建特定类型的应用程序、系统或组件。例如:“Builder for Web Applications”(用于构建Web应用程序的工具)或“Builder for Cloud Services”(用于构建云服务的工具)。
Workflow只需要提供节点的名称即可。与其他节点不同,工作流在恢复运行时将从头开始重新执行(即所有步骤都会被重新执行),除非有特殊情况说明需要保留之前的执行结果。 rerunOnResume 这会关闭那个功能(或设备)。-
方法概述
Modifier and TypeMethodDescriptionbuild()构建工作流程。config(NodeConfig config) description(String description) edges(Consumer<? super EdgesBuilder> graphDefinition) 用于设置边缘(即界线或边界)。graphDefinition被添加到一个新的(列表、文件等)中。EdgesBuilder.inputSchema(@Nullable com.google.genai.types.Schema inputSchema) maxConcurrency(int maxConcurrency) 设置同时可以运行的节点的最大数量,该数量必须至少为 1。outputSchema(@Nullable com.google.genai.types.Schema outputSchema) rerunOnResume(boolean rerunOnResume) stateSchema(@Nullable com.google.genai.types.Schema stateSchema) waitForOutput(boolean waitForOutput)
-
方法详细信息(Method Details)
-
name
-
edges
-
edges
-
edges
用于设置边缘(即界线或边界)。graphDefinition被添加到一个新的(列表、文件等)中。EdgesBuilder.例如:
.edges(g -> g.fromStart().chain(a, b)). -
description
-
maxConcurrency
设置同时可以运行的节点的最大数量,该数量必须至少为 1。如果没有设置节点数量限制,则工作流可以无限制地运行(即可以同时运行任意数量的节点)。 -
rerunOnResume
-
waitForOutput
-
config
-
inputSchema
@CanIgnoreReturnValue public Workflow.Builder inputSchema(@Nullable com.google.genai.types.Schema inputSchema) -
outputSchema
@CanIgnoreReturnValue public Workflow.Builder outputSchema(@Nullable com.google.genai.types.Schema outputSchema) -
stateSchema
@CanIgnoreReturnValue public Workflow.Builder stateSchema(@Nullable com.google.genai.types.Schema stateSchema) -
build
构建工作流程。- Throws:
IllegalArgumentException- if the workflow's name or the name of a node in its graph is empty or contains/,@, or.GraphValidationException- if the graph is malformed, for example ifStartcannot reach one of its nodesWorkflowConfigurationException- if the output schema of an edge's source admits a value that the input schema of its target does not
-