I'm mention a AI character I created in a topic on the forum, but I'm getting a 500 error message

AI-generated summary

A user reports a 500 error when mentioning an AI character they created in a forum topic, with the error occurring due to a missing language model for the AI persona kuaza. The issue stems from the AI plugin failing to find the specified model (gpt-3.5-turbo-16k) for the ‘Motivational_Coach’ persona kuaza. The user suggests that changing the model setting resolved the problem, indicating the need to properly configure the Default Language Model for AI character mentions to avoid the error.

I’m mention a AI character I created in a topic on the forum, but I’m getting a 500 error message. (I turn on the mention setting when creating the character.) Example console error:

logs error message:

Message (3 copies reported)

NoMethodError (undefined method `split' for nil:NilClass)
lib/plugin/instance.rb:541:in `block in on'
lib/discourse_event.rb:12:in `block in trigger'
lib/discourse_event.rb:12:in `trigger'
lib/post_creator.rb:258:in `trigger_after_events'
lib/post_creator.rb:220:in `create'
lib/new_post_manager.rb:318:in `perform_create_post'
lib/new_post_manager.rb:252:in `perform'
app/controllers/posts_controller.rb:201:in `create'
app/controllers/application_controller.rb:423:in `block in with_resolved_locale'
app/controllers/application_controller.rb:423:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:393:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:236:in `call'

Backtrace

plugins/discourse-ai/lib/ai_bot/playground.rb:39:in `schedule_reply'
plugins/discourse-ai/lib/ai_bot/entry_point.rb:128:in `block in inject_into'
lib/plugin/instance.rb:541:in `block in on'
lib/discourse_event.rb:12:in `block in trigger'
/usr/local/lib/ruby/3.2.0/set.rb:511:in `each_key'
/usr/local/lib/ruby/3.2.0/set.rb:511:in `each'
lib/discourse_event.rb:12:in `trigger'
lib/post_creator.rb:258:in `trigger_after_events'
lib/post_creator.rb:220:in `create'
lib/new_post_manager.rb:318:in `perform_create_post'

Env

hostname xxxxxxx-app
process_id 2131
application_version xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
HTTP_HOST xxxxxxxxx.com
REQUEST_URI /posts
REQUEST_METHOD POST
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
HTTP_ACCEPT */*
HTTP_REFERER https://xxxxxxxx.com/t/xxxxxxxxxxxxxxxxxxxxx/xxxxxxxxx/3
HTTP_X_FORWARDED_FOR xxxxxxxx
HTTP_X_REAL_IP xxxxxxxxx
username xxxxxxx
params raw @Motivational_Coach I'm looking for true love and affection, what do you recommend me to do?
--- --- --- ---
--- ---
unlist_topic false
category 5253
topic_id 777496
is_warning false
archetype regular
typing_duration_msecs 1300
composer_open_duration_msecs 7218
featured_link
shared_draft false
draft_key 777496
nested_post true

I guess it’s my fault. This setting needs to be selected if topic mentions will be used: Default Language Model

I made a mention to test it, still waiting for an answer. :slight_smile:

edit:
When I got an error like this, I changed the model and it was fixed. (gpt-3.5-turbo):
Model open_ai:gpt-3.5-turbo-16k not found for persona Motivational_Coach