Skip to content

Commit

Permalink
Merge pull request #103 from merefield/pretty_jsons_for_debug
Browse files Browse the repository at this point in the history
IMPROVE:  Logging - pretty the jsons for debug
  • Loading branch information
merefield authored Jun 19, 2024
2 parents 1988181 + c5d1465 commit 0c6bd6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/discourse_chatbot/bots/open_ai_bot_rag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def create_chat_completion(messages, use_functions = true, iteration)
::DiscourseChatbot.progress_debug_message <<~EOS
I called the LLM to help me
------------------------------
value of messages is: #{messages}
value of messages is: #{JSON.pretty_generate(messages)}
+++++++++++++++++++++++++++++++
EOS
parameters = {
Expand Down Expand Up @@ -142,7 +142,7 @@ def create_chat_completion(messages, use_functions = true, iteration)
::DiscourseChatbot.progress_debug_message <<~EOS
+++++++++++++++++++++++++++++++++++++++
The llm responded with
#{res}
#{JSON.pretty_generate(res)}
+++++++++++++++++++++++++++++++++++++++
EOS
res
Expand Down Expand Up @@ -248,8 +248,8 @@ def call_function(func_name, args_str, opts)
::DiscourseChatbot.progress_debug_message <<~EOS
+++++++++++++++++++++++++++++++++++++++
I used '#{func_name}' to help me
args_str was '#{args_str}'
opts was '#{opts}'
args_str was '#{JSON.pretty_generate(JSON.parse(args_str))}'
opts was '#{JSON.pretty_generate(opts)}'
+++++++++++++++++++++++++++++++++++++++
EOS
begin
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.33
# version: 0.9.34
# authors: merefield
# url: https://github.com/merefield/discourse-chatbot

Expand Down

0 comments on commit 0c6bd6d

Please sign in to comment.