Compare commits

...
Author SHA1 Message Date
Pranav 958d90b8e9 feat(llm): include conversation created time in LLM text format 2026-07-23 08:03:49 -07:00
2 changed files with 5 additions and 0 deletions
@@ -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)
@@ -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:',