Discourse 聊天机器人 🤖

非常感谢您的帮助和更新 @merefield

1 个赞

话虽如此,此版本存在一个错误。我将在下面修复并更新。暂时不要更新。

已修复:FIX: do not exlude single user prompts in submission by merefield · Pull Request #120 · merefield/discourse-chatbot · GitHub

感谢您的耐心等待。

3 个赞

我更新了插件。聊天机器人响应没有问题。但现在聊天机器人报错说看不到图片内容。我想给您反馈一下。我的视觉设置:直接

1 个赞

谢谢你的报告。我会看看。

1 个赞

这应该已经修复了,截至:

但在我的测试中,我注意到了一些有趣的事情。

在 Discourse 中,图片完全反映在帖子的数据中会有一个轻微的延迟,所以如果机器人回复得太快,它可能会错过看到图片。

解决方案是提高此值:

chatbot reply job time delay - 我已将其测试为 0 和 2 - 0 通常太快,所以稍微放慢速度。

如果您始终引用先前帖子中的图片,则不应有问题,只有当您在同一帖子中发布图片然后引用它时,例如“描述此图片”。

1 个赞

此设置之前为 1,现在我将其设为 2。我将进行更新并尝试。感谢修复。

1 个赞

我现在将默认值设为 2,最大值设为 5,以防某些 Discourse 论坛处理图片需要更多时间。

1 个赞

我更新了插件并尝试了 4 张图片进行测试,但没有出现任何错误。感谢您的快速修复。

1 个赞

为了弄清楚我的意思,这里有一个例子:

我不想在回复延迟为 0 时分享这个混乱 :smiley:

2 个赞

您好!有计划支持 o1 吗?它今天已向 4 级客户发布。至少 o1 抱怨的一件事是:

Chatbot:聊天补全时出现问题:状态:400,消息:不支持的值:此模型不支持“messages[0].role”的“system”。

1 个赞

这个模型真让人头疼 :sweat_smile:

https://platform.openai.com/docs/guides/reasoning/beta-limitations

没有工具,没有定制角色(因为没有系统提示),而且价格这么高,你确定它有用吗?

1 个赞

已添加 o1-previewo1-mini 支持。

必须 选择 basic 机器人类型(因为 OpenAI 尚不支持工具!)。

例如:

注意:在撰写本文时,您必须拥有 Tier 4 才能访问这些 Beta 模型。请留意您的电子邮件,了解何时可供您使用。

2 个赞

非常感谢!

哦,绝对可以。我们的许多用例是帮助解决科学问题,而 o1 在科学方面远远领先于 4o。事实上,尽管后者更便宜,但我们从未从 4 切换到 4o,因为它在科学方面明显更差。

1 个赞

@hiddenseal (以及任何喜欢科学的人)

找到了在不使用系统提示的情况下,使用 o1 来处理数学方程的解决方法:

  • 使用 数学插件
  • 告诉聊天机器人如何格式化方程和公式

例如:

如果 x 的 5 次方减 1 等于零,x 是多少?

请使用以下格式回答:

$$
方程和公式
$$

通常,你会将格式化内容放在系统提示中(如果你的网站经常使用机器人处理数学问题)。但 o1 目前还没有这个功能(也许将来会有?),所以你需要在请求时明确说明。不过,这似乎有效 :rocket:

2 个赞

上次更新后,我收到了以下错误。我想告知您。

聊天机器人:聊天补全时出现问题:状态:400,消息:提供了无法识别的请求参数:max_completion_tokens

您必须跟上最新的 API 版本

https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens

max_tokens 已弃用,并被 max_completion_tokens 取代

注意:o1-mini 完全无法使用 max_tokens

确保您使用的是最新的 Azure API。

如果无法做到这一点,请在您的 fork 中创建一个与更改之前的提交相对应的分支,并在 app.yml 中 git clone 该 fork 和分支。

2 个赞

我刚刚在本地测试了 Chatbot,使用了全新的默认 3B llama3.2,我必须说它令人难以置信

工具似乎能正常工作,而且非常快。

Meta,干得好!

这是一个绝佳的选择,可以在低成本或网络受限的情况下进行开发或实验。

设置:

(此处忽略此模型下拉菜单,因为您已指定自定义模型选项)

您必须安装并运行 ollama

4 个赞

@merefield

感谢您提供的这个很棒的插件。我正在开发一个本地托管版本的网站,以便可以对其进行试验。我的目标是复制您在这里所做的:Building a technical support chatbot

我正在按照说明进行操作,已将

- git clone https://github.com/merefield/discourse-chatbot.git 

添加到我的 app.yml 中。

但是,当我运行 ./launcher rebuild app 时,我收到一个错误:

Gem::LoadError: can’t activate multipart-post-2.2.3, already activated multipart-post-2.4.0 (Gem::LoadError)

Full Error Messages

I, [2024-10-04T14:03:14.844712 #1] INFO – :
exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf

I, [2024-10-04T14:03:14.846521 #1] INFO – :
sleep 10

2259:C 04 Oct 2024 14:03:14.854 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

2259:C 04 Oct 2024 14:03:14.854 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=2259, just started

2259:C 04 Oct 2024 14:03:14.854 # Configuration loaded

2259:M 04 Oct 2024 14:03:14.855 * monotonic clock: POSIX clock_gettime

2259:M 04 Oct 2024 14:03:14.855 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use

2259:M 04 Oct 2024 14:03:14.855 # Failed listening on port 6379 (TCP), aborting.

I, [2024-10-04T14:03:24.849199 #1] INFO – :

I, [2024-10-04T14:03:24.849755 #1] INFO – :
cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’

rake aborted!

Gem::LoadError: can’t activate multipart-post-2.2.3, already activated multipart-post-2.4.0 (Gem::LoadError)

/var/www/discourse/lib/plugin_gem.rb:25:in `load’

/var/www/discourse/lib/plugin/instance.rb:824:in `gem’

/var/www/discourse/plugins/discourse-zendesk-plugin/plugin.rb:13:in `activate!’

/var/www/discourse/lib/plugin/instance.rb:767:in `instance_eval’

/var/www/discourse/lib/plugin/instance.rb:767:in `activate!’

/var/www/discourse/lib/discourse.rb:348:in `block in activate_plugins!’

/var/www/discourse/lib/discourse.rb:345:in `each’

/var/www/discourse/lib/discourse.rb:345:in `activate_plugins!’

/var/www/discourse/config/application.rb:232:in `block in <class:Application>’

/var/www/discourse/lib/plugin.rb:6:in `initialization_guard’

/var/www/discourse/config/application.rb:232:in `<class:Application>’

/var/www/discourse/config/application.rb:75:in `<module:Discourse>’

/var/www/discourse/config/application.rb:74:in `<top (required)>’

/var/www/discourse/Rakefile:7:in `<top (required)>’

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>’

/usr/local/bin/bundle:25:in `load’

/usr/local/bin/bundle:25:in `<main>’

(See full trace by running task with --trace)

I, [2024-10-04T14:03:33.989382 #1] INFO – :

I, [2024-10-04T14:03:33.989950 #1] INFO – : Terminating async processes

I, [2024-10-04T14:03:33.989982 #1] INFO – : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 36

I, [2024-10-04T14:03:33.990027 #1] INFO – : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 104

104:signal-handler (1728050613) Received SIGTERM scheduling shutdown…

2024-10-04 14:03:33.990 UTC [36] LOG: received fast shutdown request

2024-10-04 14:03:33.991 UTC [36] LOG: aborting any active transactions

2024-10-04 14:03:33.996 UTC [36] LOG: background worker “logical replication launcher” (PID 51) exited with exit code 1

2024-10-04 14:03:33.997 UTC [46] LOG: shutting down

104:M 04 Oct 2024 14:03:34.007 # User requested shutdown…

104:M 04 Oct 2024 14:03:34.007 * Saving the final RDB snapshot before exiting.

2024-10-04 14:03:34.023 UTC [36] LOG: database system is shut down

104:M 04 Oct 2024 14:03:34.025 * DB saved on disk

104:M 04 Oct 2024 14:03:34.025 # Redis is now ready to exit, bye bye…

FAILED


Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’ failed with return #<Process::Status: pid 2262 exit 1>

Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn’

exec failed with the params {“cd”=>“$home”, “tag”=>“migrate”, “hook”=>“db_migrate”, “cmd”=>[“su discourse -c ‘bundle exec rake db:migrate’”]}

bootstrap failed with exit code 1

** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

./discourse-doctor may help diagnose the problem.

289408d3c0350809f88a235d9c3ae0b23074f4e1a727748bbc3ab3b205e18115

==================== END REBUILD LOG ====================

Failed to rebuild app.

有什么想法,这是否与插件有关?

1 个赞

Chatbot 依赖于 gem multipart-post-2.4.0。

看起来您的 zendesk 插件落后了?

您可以联系作者,让他们更新它或向 zendesk 插件提交 PR :slight_smile:

或者,您可以分叉 Chatbot,看看它是否与早期版本兼容。