Class: Collavre::Comments::CompressCommand
- Inherits:
-
Object
- Object
- Collavre::Comments::CompressCommand
- Defined in:
- app/services/collavre/comments/compress_command.rb
Constant Summary collapse
- COMMAND_PATTERN =
/\A\/compress\b/i.freeze
- SYSTEM_PROMPT =
<<~PROMPT.freeze You are summarizing a conversation thread in a project management tool. Preserve key decisions, action items, important context, and any conclusions. Be concise but thorough. Respond in the same language as the conversation. Use markdown formatting for readability. PROMPT
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(comment:, user:) ⇒ CompressCommand
constructor
A new instance of CompressCommand.
Constructor Details
#initialize(comment:, user:) ⇒ CompressCommand
Returns a new instance of CompressCommand.
13 14 15 16 17 |
# File 'app/services/collavre/comments/compress_command.rb', line 13 def initialize(comment:, user:) @comment = comment @user = user @creative = comment.creative end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'app/services/collavre/comments/compress_command.rb', line 19 def call return unless compress_command? validate! enqueue_compress_job rescue StandardError => e Rails.logger.error("Compress command failed: #{e.}") e. end |