路由(Route)

sealed interface Route

A value on a workflow edge, and the value a node emits to select which of its outgoing edges are followed. An edge fires when the value it carries matches one the node emitted.

On the wire a route is a bare scalar - a string, integer or boolean - and Default is the DEFAULT_ROUTE_SENTINEL string, matching adk-python.

Inheritors

类型

Link copied to clipboard
object Companion
Link copied to clipboard
data object Default : Route

“回退边缘”(fallback edge)是指在节点的所有路由路径都无法匹配该节点发送的数据时(包括该节点根本没有发送任何数据的情况)才会被使用的路径。一个节点可以声明多个这样的回退边缘,这些回退边缘会同时被触发;但是,某个默认的回退边缘不能与某个具体的路由路径共享相同的物理路径(即不能与某个具体的数据传输路径相关联)。

Link copied to clipboard
data class Flag(val value: Boolean) : Route

一条由布尔值标识的路由,用于表示双向分支(即数据可以在两个方向上传输)。

Link copied to clipboard
data class Num(val value: Long) : Route

由一个整数标识的路由。

Link copied to clipboard
data class Tag(val value: String) : Route

由字符串标识的路由(这是最常见的情况)。该操作会抛出异常(即错误)。 IllegalArgumentException for DEFAULT_ROUTE_SENTINEL该内容将从 JSON 数据中读取出来。 默认值.