Skip to content

Commit

Permalink
IMPROVE: pretty the json objects in log output
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield committed Jun 19, 2024
1 parent 1988181 commit 74c02f1
Showing 1 changed file with 4 additions and 4 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(args_str)}'
opts was '#{JSON.pretty_generate(opts)}'
+++++++++++++++++++++++++++++++++++++++
EOS
begin
Expand Down

0 comments on commit 74c02f1

Please sign in to comment.