Skip to content

QAnything

特点

  • 网易有道知识库智能体
  • 支持知识库问答功能
  • 默认为纯文本模型
  • 不支持在线对话持久化(可通过agent中配置本地历史消息实现)

使用代码配置

typescript
const chatAgent = new PPAgent({
  // ... 其他配置 ...
  bot: {
    type: "qanything-bot",
    options: {
      botId: "your-bot-id", // 必填,在Agents页面的右上角或者浏览器的URL中都可以看到botId
      apiBase: "https://openapi.youdao.com/q_anything/api", // 可选,API服务地址,默认为"https://openapi.youdao.com/q_anything/api"
      apiKey: "your-api-key", // 可选,API密钥
      onlyText: true // 可选,是否为纯文本模型,默认为true
    }
  },
  source: {
    // ... 消息源配置 ...
  },
  agent: {
    // ... agent配置 ...
  }
});

服务器运行请参考 install_code 文件。

注意事项

  • 需要提供有效的botId才能正常使用
  • 此模型默认不支持对话持久化,如有需要,请在agent的配置中开启本地历史消息
  • 如果不配置apiBase,将使用默认的"https://openapi.youdao.com/q_anything/api"