Records reasoning, citations (the FAQs the assistant found), the tool path, and the model for each V1 Captain reply in a new captain_message_generations table. The assistant reports the source IDs it actually used so cited FAQs can be flagged, and handoff messages capture the transfer reason. Agents can expand any Captain message in the conversation (a sparkle toggle on the timestamp line) to see this breakdown, fetched on demand from a dedicated endpoint. Model is shown only in development. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 lines
539 B
Ruby
11 lines
539 B
Ruby
FactoryBot.define do
|
|
factory :captain_message_generation, class: 'Captain::MessageGeneration' do
|
|
reasoning { 'Matched the FAQ about creating an account.' }
|
|
model { 'gpt-4o-mini' }
|
|
citations { [{ 'title' => 'How to create an account?', 'source' => 'https://example.com/docs', 'document_id' => nil }] }
|
|
generation_path { [{ 'tool' => 'search_documentation', 'arguments' => { 'query' => 'account' }, 'result' => 'Question: ...' }] }
|
|
association :message
|
|
association :assistant, factory: :captain_assistant
|
|
end
|
|
end
|