Skip to content

uni-flow 公开 API(中文注解)


uni-flow 公开 API(中文注解) / RuntimeAdapter

Interface: RuntimeAdapter ​

Defined in: core/types.ts:204

运行时适配器:把 Uni-Flow Unit 接到具体框架 / HTTP / Mock。 实现须提供 execute;steer / followUp 可为空操作。

Properties ​

type ​

readonly type: AdapterType

Defined in: core/types.ts:206

适配器类型标签。

Methods ​

cancel() ​

cancel(): void

Defined in: core/types.ts:216

请求取消。

Returns ​

void


execute() ​

execute(input, ctx): Promise<AgentOutput>

Defined in: core/types.ts:208

执行一轮并返回 AgentOutput。

Parameters ​

input ​

AgentInput

ctx ​

ExecutionContext

Returns ​

Promise<AgentOutput>


followUp() ​

followUp(content): void

Defined in: core/types.ts:212

运行中追问(若框架支持)。

Parameters ​

content ​

string

Returns ​

void


frameworkInfo() ​

frameworkInfo(): object

Defined in: core/types.ts:218

框架名称与版本,供可观测性使用。

Returns ​

object

name ​

name: string

version ​

version: string


steer() ​

steer(content): void

Defined in: core/types.ts:210

运行中转向(若框架支持)。

Parameters ​

content ​

string

Returns ​

void


subscribe() ​

subscribe(handler): Unsubscribe

Defined in: core/types.ts:214

订阅生命周期事件。

Parameters ​

handler ​

RuntimeEventHandler

Returns ​

Unsubscribe

MIT Licensed