Skip to content

Commit

Permalink
Merge pull request #110 from merefield/prettify_inner_thoughts
Browse files Browse the repository at this point in the history
IMPROVE: make presentation of inner thoughts in Posts prettier
  • Loading branch information
merefield authored Jul 10, 2024
2 parents 9b1647b + 5ca8f33 commit 83809f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/discourse_chatbot/bots/open_ai_bot_rag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_response(prompt, opts)

{
reply: res["choices"][0]["message"]["content"],
inner_thoughts: @inner_thoughts.to_s
inner_thoughts: @inner_thoughts
}
end

Expand Down
3 changes: 1 addition & 2 deletions lib/discourse_chatbot/post/post_reply_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def create
end

if @chatbot_bot_type == "RAG" && SiteSetting.chatbot_include_inner_thoughts_in_private_messages && @is_private_msg
default_opts.merge!(raw: '[details="Inner Thoughts"]<br/>' + @inner_thoughts + '<br/>[/details]')

default_opts.merge!(raw: "[details='Inner Thoughts']\n```json\n" + JSON.pretty_generate(@inner_thoughts) + "\n```\n[/details]")
new_post = PostCreator.create!(@author, default_opts)
end

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: 0.9.40
# version: 0.9.41
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down

0 comments on commit 83809f0

Please sign in to comment.