Skip to content

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


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

Interface: HttpAdapterConfig

Defined in: adapters/http-adapter.ts:15

HTTP RuntimeAdapter 配置:把 Unit 执行委托给远程 /execute 风格端点。

请求体为 { input, context } JSON;响应体须可解析为 AgentOutput

Properties

endpoint

endpoint: string

Defined in: adapters/http-adapter.ts:17

远程 Unit 的 HTTP 端点 URL(通常 POST)。


fetchFn?

optional fetchFn?: (input, init?) => Promise<Response>

Defined in: adapters/http-adapter.ts:23

可注入的 fetch(便于单测 Mock);默认使用全局 fetch

Parameters

input

string | URL | Request

init?

RequestInit

Returns

Promise<Response>


headers?

optional headers?: Record<string, string>

Defined in: adapters/http-adapter.ts:19

附加请求头(如鉴权);默认仍会带 Content-Type: application/json

MIT Licensed