feat(llm): include conversation created time in LLM text format
This commit is contained in:
@@ -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:',
|
||||
|
||||
Reference in New Issue
Block a user