diff --git a/app/services/llm_formatter/conversation_llm_formatter.rb b/app/services/llm_formatter/conversation_llm_formatter.rb index 1e71ccbbc..0061aad9d 100644 --- a/app/services/llm_formatter/conversation_llm_formatter.rb +++ b/app/services/llm_formatter/conversation_llm_formatter.rb @@ -3,6 +3,7 @@ class LlmFormatter::ConversationLlmFormatter < LlmFormatter::DefaultLlmFormatter sections = [] sections << "Conversation ID: ##{@record.display_id}" sections << "Channel: #{@record.inbox.channel.name}" + sections << "Created At: #{@record.created_at}" sections << 'Message History:' sections << if @record.messages.any? build_messages(config) diff --git a/spec/services/llm_formatter/conversation_llm_formatter_spec.rb b/spec/services/llm_formatter/conversation_llm_formatter_spec.rb index b79ee6d79..99790d765 100644 --- a/spec/services/llm_formatter/conversation_llm_formatter_spec.rb +++ b/spec/services/llm_formatter/conversation_llm_formatter_spec.rb @@ -11,6 +11,7 @@ RSpec.describe LlmFormatter::ConversationLlmFormatter do expected_output = [ "Conversation ID: ##{conversation.display_id}", "Channel: #{conversation.inbox.channel.name}", + "Created At: #{conversation.created_at}", 'Message History:', 'No messages in this conversation' ].join("\n") @@ -46,6 +47,7 @@ RSpec.describe LlmFormatter::ConversationLlmFormatter do expected_output = [ "Conversation ID: ##{conversation.display_id}", "Channel: #{conversation.inbox.channel.name}", + "Created At: #{conversation.created_at}", 'Message History:', 'User: Hello, I need help', 'Bot: Thanks for reaching out, an agent will reach out to you soon', @@ -62,6 +64,7 @@ RSpec.describe LlmFormatter::ConversationLlmFormatter do expected_output = [ "Conversation ID: ##{conversation.display_id}", "Channel: #{conversation.inbox.channel.name}", + "Created At: #{conversation.created_at}", 'Message History:', 'No messages in this conversation', "Contact Details: #{conversation.contact.to_llm_text}" @@ -86,6 +89,7 @@ RSpec.describe LlmFormatter::ConversationLlmFormatter do expected_output = [ "Conversation ID: ##{conversation.display_id}", "Channel: #{conversation.inbox.channel.name}", + "Created At: #{conversation.created_at}", 'Message History:', 'No messages in this conversation', 'Conversation Attributes:',