Discourse 聊天机器人 🤖

:information_source: 摘要 Discourse 的原创 AI 聊天机器人
:hammer_and_wrench: 仓库链接 GitHub - merefield/discourse-chatbot: An AI bot with RAG capability for Topics, Chat & Customer Support in Discourse, currently powered by OpenAI · GitHub
:open_book: 安装指南 如何在 Discourse 中安装插件
:heart: 赞助支持 请考虑成为我开源工作的长期赞助商,选择适合您或您所在组织资源和需求的赞助级别,以确保该插件获得应有的维护,并继续为您的站点提供服务。

喜欢这个插件吗?请在 GitHub 上给它一个 :star: 吧!:pray:

:information_source: 由于这是一个独立贡献的插件,请在此主题中提出支持、错误、用户体验和功能请求。注意:该插件提供在 Discourse.org 的托管服务上。如果您是自建托管,则可以安装它;如果您使用第三方托管,也可能可以安装(但请先咨询您的提供商)。

Discourse 的原创 AI 聊天机器人

Chatbot 将可配置的 AI 对话引入到主题(Topics)、私信(Personal Messages)、聊天频道(Chat channels)和聊天线程(Chat threads)中。您可以为机器人设定一个适合您社区的角色,决定哪些用户组可以使用它,并为低信任度、中信任度和高信任度用户选择不同的模型和工具。

它可以:

  • 根据当前对话正常回答;
  • 使用语义搜索或混合搜索检索选定的论坛内容;
  • 搜索维基百科、最新新闻和网络;
  • 抓取远程页面并获取当日收盘市场数据;
  • 执行可靠的基于表达式的计算;
  • 查看上传的图片并可选地读取 PDF;
  • 生成和编辑图片;
  • 在私密对话中收集未填写的可编辑用户字段(User Fields);
  • 将私密聊天对话升级给配置好的员工组;
  • 自动回复选定分类(Categories)中的新主题;以及
  • 接受由其他插件提供的额外工具。

有关实际的支持工作流程,请参阅构建技术支持聊天机器人

启用本地论坛搜索后,机器人可以基于您社区的内容来回答:

对于更简单的对话,可以暴露更少或没有工具,以减少调用、延迟和成本:

提供商支持

您可以独立为回复、嵌入(embeddings)、视觉(vision)和图片生成选择提供商。每种功能都重用所选提供商的 API 密钥。

功能 OpenAI Anthropic Google Gemini xAI
LLM 回复和工具 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
嵌入 :white_check_mark: :white_check_mark: :white_check_mark:
视觉 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
图片生成 :white_check_mark: :white_check_mark: :white_check_mark:
图片编辑 GPT Image 模型 :white_check_mark:
PDF 对话输入 :white_check_mark:

如果未设置自定义 URL,Chatbot 将使用所选提供商的内置官方端点。自定义模型名称和 URL 支持 Azure OpenAI、Ollama、代理以及实现受支持提供商 API 格式的其他服务。

仅当该提供商处于激活状态时,才会显示特定的提供商模型下拉菜单。回复模型可以根据信任级别有所不同,而嵌入、视觉和图片生成各自拥有独立的提供商和模型选择器。

阅读完整的提供商和自定义端点指南

访问权限、配额和工具

在您将用户组分配给 Chatbot 的低、中或高信任级别设置之前,没有人拥有访问权限。用户将继承其最高匹配 Chatbot 信任级别的配额、模型和工具允许列表。配额可以按查询次数或令牌(tokens)来衡量。

内置工具针对每个信任级别独立选择。凭据和支持性设置仍然控制运行时可用性,因此,如果选择了网络工具但未提供其 API 密钥,该工具将不会暴露出来。

阅读关于访问权限和配额以及信任级别工具的文档。

本地论坛搜索和隐私

:biohazard: 请在启用本地论坛搜索之前了解嵌入的范围。

默认的 benchmark_user 策略会嵌入在配置的信任级别下对合适用户可见的内容。categories 策略会嵌入从明确选择的分类中获取的内容。语义搜索针对速度进行了优化,不会为每个向机器人提问的人重复执行可见性检查,因此,如果范围包含受限内容,匹配的内容可能会在其原始受众之外被共享。

私信永远不会被嵌入。请保持基准信任级别较低,除非其内容可以披露给每个 Chatbot 用户,否则避免使用私密分类,并从不应使用它的信任级别中移除 local_forum_search

所选提供商可能会接收对话内容、上传文件、嵌入的搜索匹配结果和工具结果。请审查其数据保留和使用条款,并在您的论坛条款和隐私声明中披露此处理过程。

阅读完整的嵌入、范围和隐私指南

快速开始

  1. 使用标准的自建插件程序安装该插件。
  2. 选择 chatbot_llm_provider,输入该提供商的 API 密钥,并为每个信任级别选择模型。
  3. 将用户组添加到低、中或高信任访问设置中,并配置配额。
  4. 选择每个信任级别可用的内置工具。
  5. 如果您启用了 local_forum_search,请配置其嵌入提供商并仔细审查其范围。
  6. 提及机器人、回复它、使用快速访问按钮,或配置分类自动回复提示词。

快速 OpenAI 示例

  1. 创建一个 OpenAI API 密钥 并确保已启用 API 计费。
  2. chatbot_llm_provider 设置为 OpenAI,并将密钥粘贴到 chatbot_open_ai_token 中。
  3. 保持自定义 URL 为空,为您打算使用的每个信任级别选择一个 OpenAI 模型,并将您的测试组添加到匹配的 Chatbot 访问设置中。
  4. 在允许的主题、私信或聊天中提及机器人以进行测试。

仓库的 README 是前提条件、所有主要设置组、特定提供商行为、自定义端点、嵌入维护、提示词自定义、调试、扩展开发和卸载的权威来源:

:books: 打开完整的 README

精选 UI 功能

分类可以欢迎新主题并询问机器人搜索相关的社区内容:

可选的快速访问按钮可以打开与机器人的直接聊天或私信:

用户字段工具可以私密地收集受支持的空白字段:

用户字段收集

支持和赞助

请在此 Meta 主题中报告支持请求、错误、用户体验反馈和功能创意。请包含提供商、模型名称、相关设置、HTTP 状态和提供商响应体,同时移除 API 密钥和私密内容。

这项工作依赖于社区的支持。如果该插件对您的站点有价值,请赞助其持续维护

项目赞助商

赞助商 级别 网站
Surety Silver Plus suretyhome.com

免责声明

LLM 可能会产生看似正确但实际错误的输出。请针对您社区的需求测试该插件,了解隐私和成本影响,并应用适当的审核措施。生成输出的条款因提供商和司法管辖区而异;请审查您启用的每个提供商的条款。

104 个赞
Building a technical support chatbot
Answer feature
Webhooks on chat messages?
How to check what prevents rake migrate?
Weekly Summary of AI topics
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Interact with discourse from Python?
Sidekiq not working
Locations Plugin :earth_africa:
Lessons from Colossal Caves
Issue after Rebuilding Discourse on Digital Ocean Droplet
Locations Plugin :earth_africa:
I have error when upgrade new version of discourse
I have error when upgrade new version of discourse
Site down after upgrade via SSH - how to fix?
2023: The Year in Review
Character count when writing description
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Is there an option to use Discourse Chat as a customer service type of chat?
Configure AI Chatbot for Trust Level 0 Access
Creating bot on discourse
AI Helper Plugin
Copy custom file in discourse container while build
Voice to text integration
Allow specifiy user different from guardian.user in chat services such as Chat::CreateMessage
How to add a ChatGPT trained AI to discourse?
Cannot get the js in my component to compile SyntaxError: Private field must be used in an enclosing class
Allow ChatBot to read PDFs so it can join in a group discussion
How to create a custom ChatGPT based bot?
Discourse and Coveo
Link for new DM / personal chat message with pre-filled information
UX IPhone issues
How to respond to automatic topics with AI
Comparison between discourse-ai AI Bot and merefield/discourse-chatbot
Allow multiple ‘new topic’ drafts
I have error when upgrade the latest discourse
Two different answers from gpt4o - one right, one wrong.. !?
Is the shortcut to start AI conversation a user setting or not?
Setting Form Templates with a tag
Recommendation: chatbot to support discussion in threads
Photography Mentor Bot
Grouped Site Settings under Headings in Plugins
Update Not Completed and Discourse not opening
Recommendation: chatbot to support discussion in threads
Discourse AI Topic Summary :robot:
Discourse AI Topic Summary :robot:
Hubot Adapter for Discourse
Hubot Adapter for Discourse
Verbose log
Making the case for a hard cap feature on user group AI usage for AI bots and AI Helper
LLMs and the impact on customer support
2024: The Year in Review
How to respond to automatic topics with AI
What User Information is Exposed to LLMs in Discourse AI
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Configure AI Chatbot for Trust Level 0 Access
Auto responder using AI
Locations Plugin :earth_africa:
Discourse AI Topic Summary :robot:
Discourse Chat Bridge (Telegram)
AI personas integration of the chat plugin: It would be great if site users could chat with AI personas
What's the best way to store data with a plugin?
Locations Plugin :earth_africa:
Locations Plugin :earth_africa:
Is there any built-in chatbot or conversational assistant available in Discourse?
ChatGPT Assistant Integration
Create posts with AI
Multisite vs multiple containers
Training a model on a site's posts?
How are we all feeling about ChatGPT and other LLMs and how they'll impact forums?
GPT-4 with vision available
Use AI to request summary and others things from topic
Upgrading from /admin/upgrade takes *very* long
Embed additional explainer text in Form Template
We need prompt chains: Allow custom AI persona tools to access LangChain.js and/or longer execution time
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)
Configure AI Chatbot for Trust Level 0 Access
Enabling AI Bot in Chat
When I start a conversation with the AI, it gives two answers to my question
Balancing Costs and Functionality in AI-Powered Forums
Advice on a support bot for a technical support forum (Discourse AI vs Discourse Chatbot)