24 lines
469 B
Ruby
24 lines
469 B
Ruby
class Captain::SummaryService < Captain::BaseTaskService
|
|
pattr_initialize [:account!, :conversation_display_id!]
|
|
|
|
def perform
|
|
make_api_call(
|
|
model: configured_model,
|
|
messages: [
|
|
{ role: 'system', content: prompt_from_file('summary') },
|
|
{ role: 'user', content: conversation.to_llm_text(include_contact_details: false) }
|
|
]
|
|
)
|
|
end
|
|
|
|
private
|
|
|
|
def event_name
|
|
'summarize'
|
|
end
|
|
|
|
def feature_key
|
|
'editor'
|
|
end
|
|
end
|