Discourse Chatbot 🤖

The bot will stop automatically responding once a second (human) person joins the conversation (ie posts).

The bot will always respond once invoked when there is only one human.

This is covered in the OP, here:

My forum is over 100k users and just modified the digest time-frame to 600 days instead of 180 which led to many emails being sent right now. Could this influence the trigger of the quota? Cause I’ve triggered the quota reset and nothing and it’s been an hour. I’ve mentioned the bot yes

1 Like

The bot response will be delayed if there is a big queue of jobs.

I believe a triggered job may also be delayed.

First deal with the backlog :).

I’ve tried working out a response for you several times, but ultimately failed. Please contact the admin if this persists, thank you!

You need to take a look at why. There should be an error in your logs.

Check the AI response by enabling verbose logging (last settings) and diverting the log to Warn (in Production you can’t read Info logs)

Then view these in /logs

Often this is because you haven’t provided a valid key or there’s not enough money in your account, but might be for other reasons.

I think I have a big sidekiq backlog. Is there a way to increase the capacity of sidekiq in order to process tasks faster?

That’s rather beyond the scope of this plugin :slight_smile:

A combination of

  1. move to a more powerful server with more cores and memory.
  2. increase rate limits on your email service provider (potentially).

Normally your queues should be all but empty.

Chatbot: There was a problem, but will retry til limit: nil can’t be coerced into Integer

This is the error I get

Have you: Chatbot embeddings enabled?

Presumably your bot is of type RAG? (if so above must be enabled)

What model are you using?

No RAG.

gpt-4o-mini

Can you see a backtrace in /logs for this error?

Message (4 copies reported)

Chatbot: There was a problem, but will retry til limit: nil can't be coerced into Integer

Backtrace

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:134:in `block in error'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:134:in `error'
/var/www/discourse/plugins/discourse-chatbot/app/jobs/regular/chatbot_reply.rb:140:in `rescue in execute'
/var/www/discourse/plugins/discourse-chatbot/app/jobs/regular/chatbot_reply.rb:121:in `execute'
/var/www/discourse/app/jobs/base.rb:316:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.1.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.1.0/lib/rails_multisite/connection_management.rb:21:in `with_connection'
/var/www/discourse/app/jobs/base.rb:303:in `block in perform'
/var/www/discourse/app/jobs/base.rb:299:in `each'
/var/www/discourse/app/jobs/base.rb:299:in `perform'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:202:in `execute_job'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:177:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:132:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:179:in `block in invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/middleware/chain.rb:182:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:169:in `block in process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:113:in `local'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq.rb:44:in `block in <module:Sidekiq>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:263:in `stats'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:13:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_retry.rb:80:in `global'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:124:in `block in dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/job_logger.rb:39:in `prepare'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:123:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:168:in `process'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:78:in `process_one'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/processor.rb:68:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:8:in `watchdog'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/sidekiq-6.5.12/lib/sidekiq/component.rb:17:in `block in safe_thread'

Please set these accordingly and let me know if you can see anything additional in logs that looks suspicious:

PS I’ve confirmed that the Basic & RAG bots are working on latest.

Conclusion from private discussion: quota reset job had still not run.

This must run once before you can use the bot.

Currently you may need to trigger this once after installing the plugin.

I will look at performing this one-off initial run automatically sometime soon.

Hopefully that should resolve the issue for good.

3 Likes

DeepSeek Hype :sweat_smile:

Get in on the act with Chatbot :rocket:

You can use the bot in at least Basic mode at least to access V3 and R1

I’ve used:

(no affiliate)

which hosts their models.

Set up like so:

Be sure to set Basic bot mode and substitute your key.

But you may be able to use DeepSeek AI directly if you can access their website to sign up :sweat_smile:

Base URL would be “https://api.deepseek.com”.

3 Likes

See last post for a way of using alternative models, particularly large hosted Open Source models.