Discourse Chatbot 🤖

Thank you very much for your help and update @merefield

1 Like

That said there is a bug with this release. I will fix and update here. Do not update for now.

that’s fixed: FIX: do not exlude single user prompts in submission by merefield · Pull Request #120 · merefield/discourse-chatbot · GitHub

thanks for your patience.

3 Likes

I updated the plugin. There is no problem with the chatbot responding. But now the chatbot is giving an error saying that it cannot see the content of the image. I wanted to give you feedback. My vision setting: directly

1 Like

Thanks for the report. I’ll take a look

1 Like

That should be fixed now as of:

But I noticed something interesting in my testing.

In Discourse, there’s a slight delay in images being fully reflected in a Post’s data so if the bot replies too quickly it can miss seeing that there’s an image.

The solution is to up this value:

chatbot reply job time delay - I’ve tested it at 0 and 2 - and 0 is often too fast, so slow things down a bit.

If you are always refering to an image in a prior Post you should not have a problem, it’s only if you are Posting an image and then referring to it in the same post, e.g. “describe this image”

1 Like

This setting was set to 1, now I made it 2. I will update and try. Thanks for the fix.

1 Like

I’ve made the default 2 and the max 5 now, just in case some Discourse forums need more time to process images.

1 Like

I updated the plugin and tried 4 images for testing, but it did not give any errors. Thank you for the quick fix.

1 Like

To clarify what I mean, here’s an example:

I don’t want to share the mess when reply delay is 0 :smiley:

2 Likes

Hi! Are there any plans to add support for o1? it was released to tier 4 customers today. At least one thing o1 complains about is the:

Chatbot: There was a problem with Chat Completion: status: 400, message: Unsupported value: ‘messages[0].role’ does not support ‘system’ with this model.

1 Like

This is model is a pain :sweat_smile:

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

are you sure you’d find it useful with no tools, no bespoke character (as no system prompt) and such a high $$$ value?

1 Like

o1-preview and o1-mini support added.

You must select basic bot type (as tools are not supported by Open AI yet!).

e.g.

NB at time of writing you must have Tier 4 to access these beta models. Watch your email for when it becomes available to you.

2 Likes

thank you very much!

oh, absolutely. a lot of our use cases is for helping with scientific questions & problems and o1 is miles ahead of 4o. In fact, we never switched from 4 to 4o despite the latter being cheaper because it was visibly worse at science.

1 Like

@hiddenseal (and anyone who likes science stuff)

Found a workaround for using Maths equations with o1 without needing a system prompt:

  • Use the Maths Plugin
  • Tell Chatbot how to format equations and formulae

e.g.:

if x to the power of 5 minus 1 is zero, what is x?

Use the following formatting for the answer:

$$
equations and formulae
$$

Normally you’d put that formatting stuff in the system prompt of course (if your site was a regular user of bots for maths). But o1 doesn’t yet have that facility (yet?) so you need to be explicit at point of request. Seems to work though :rocket:

2 Likes

After the last update I am getting the following error. I wanted to inform you.

Chatbot: There was a problem with Chat Completion: status: 400, message: Unrecognized request argument supplied: max_completion_tokens

Again, you must keep up with the latest API version

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

max_tokens is deprecated and it’s being replaced it with max_completion_tokens

NB o1-mini won’t work with max_tokens at all.

Make sure you are on the latest Azure API.

If you are not able to do that, create a branch on your fork that corresponds to the commit prior to the change and git clone that fork and branch in app.yml.

2 Likes

I just tested Chatbot with the default brand new 3B llama3.2 locally and I must say it’s INCREDIBLE.

Tools appear to work and it’s very fast.

Great work Meta!

This is a fantastic option for development or experimentation at low cost or where you have limited internet.

Settings:

(this model dropdown is ignored here as you’ve specified the option of a custom model)

You must have ollama installed and running

4 Likes

@merefield

Thanks for this great plugin, I am working on a self-hosting version of our site so I can play around with it, I am aiming to replicate what you did here, Building a technical support chatbot

I am following the instructions, added

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

to my app.yml.

However, when I ./launcher rebuild app I get an error

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 `’

(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.

Any ideas if this is related to the plugin?

1 Like

Chatbot depends on gem multipart-post-2.4.0.

Looks like your zendesk plugin is lagging behind?

I would contact the author and ask them to update it or PR to the zendesk plugin :slight_smile:

Alternatively you could fork Chatbot and see if it works with the earlier version.