Skip to content

Commit

Permalink
IMPROVE: influence bot to greet user by username for dynamic greetings
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Oct 17, 2024
1 parent c62e979 commit c12ca01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/discourse_chatbot/chatbot_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def start_bot_convo
start_bot = ::DiscourseChatbot::OpenAiBotRag.new(opts, false)

system_message = { "role": "system", "content": I18n.t("chatbot.prompt.system.rag.private", current_date_time: DateTime.current) }
assistant_message = { "role": "assistant", "content": I18n.t("chatbot.prompt.quick_access_kick_off.announcement") }
assistant_message = { "role": "assistant", "content": I18n.t("chatbot.prompt.quick_access_kick_off.announcement", username: current_user.username) }

system_message_suffix = start_bot.get_system_message_suffix(opts)
system_message[:content] += " " + system_message_suffix
Expand Down
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ en:
private_message:
title_creation: "Create a short Topic title from summarising the prior messages"
quick_access_kick_off:
announcement: "I must greet the user warmly and kick off any questions I want answered"
announcement: "I must greet @%{username} warmly and kick off any questions I want answered."
function:
user_information:
name: "user_information_for_%{user_field}"
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-chatbot
# about: a plugin that allows you to have a conversation with a configurable chatbot in Discourse Chat, Topics and Private Messages
# version: 1.2.1
# version: 1.2.2
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down

0 comments on commit c12ca01

Please sign in to comment.