Skip to content

KnotAgentChat Knot 智能问答助手

基于 Knot Agent 平台的 AI 对话组件,通过动态加载 Chat SDK 实现问答交互,支持自定义标题、Logo、暗黑模式等配置。悬浮按钮支持拖拽移动,可通过 initialPosition 设置初始位置。

AgentID 从 Knot 平台->「智能体」->「使用配置」->「嵌入至 web 网页」获取。

示例

属性

属性说明类型默认值
agentIdKnot Agent ID(必填)string-
title对话框标题string'AI Assistant'
logoLogo 图片地址string-
empty空状态提示文本string'我是你的 AI 问答小助手,有什么问题尽管问我~'
streamingTimeout流式传输超时时间(秒)number1800
initialConversation是否显示初始对话booleantrue
baseURLKnot API 基础地址string'https://knot.aow.com'
sdkURLSDK 脚本地址string'https://knot.aow.com/chat-sdk/latest/sdk.js'
dark是否使用暗黑模式,不传则不自动设置boolean-
initialPosition悬浮按钮初始位置ButtonPosition{ right: 20, bottom: 20 }
zIndex容器的 z-index 层级number200

ButtonPosition 类型如下:

ts
interface ButtonPosition {
  /** 距离视口右侧的距离(px) */
  right?: number
  /** 距离视口底部的距离(px) */
  bottom?: number
}