Skip to content
On this page

Stream 接入案例:小程序

当前 @tencent/ssv-ai-sdk-miniprogram@2.0.0 未导出 StreamBehavior,因此小程序端暂不提供独立的 Stream 单次生成 Behavior。

推荐方案

场景推荐
小程序端需要多轮对话 / 工具调用 / AG-UI使用 AgentBehavior
小程序端只需要旧版纯对话能力继续参考不推荐文档中的 ChatBehavior,并规划迁移

为什么没有 StreamBehavior?

2.0 的 Stream 能力由核心类 AIStream、React 的 useStream、Vue3 的 useStream 和 Vue2 的 StreamMixin 暴露。小程序包当前导出项为:

ts
export { CompletionBehavior } from './Completion';
export { ChatBehavior } from './Chat';
export { AgentBehavior } from './Agent';

因此文档中不应写不存在的 StreamBehavior 接入示例,避免业务误用。

小程序推荐 Agent 接入

请参考:Agent 接入案例:小程序

Released under the MIT License.