Files
fizzy/app/models/card/promptable.rb
T
Jorge Manrubia 81d6df3616 Remove comments from card prompts
We don't use to_prompt to generate AI responses anymore, only for events. Grabbing
all the comments don't make as much sense, and I'm sure it is quite expensive
2025-08-27 09:56:13 +02:00

36 lines
865 B
Ruby

module Card::Promptable
extend ActiveSupport::Concern
included do
include Rails.application.routes.url_helpers
end
def to_prompt
<<~PROMPT
BEGIN OF CARD #{id}
**Title:** #{title.first(1000)}
**Description:**
#{description.to_plain_text.first(10_000)}
#### Metadata
* Id: #{id}
* Created by: #{creator.name}}
* Assigned to: #{assignees.map(&:name).join(", ")}}
* Workflow stage: #{stage&.name}
* Created at: #{created_at}}
* Closed: #{closed?}
* Closed by: #{closed_by&.name}
* Closed at: #{closed_at}
* Collection id: #{collection_id}
* Collection name: #{collection.name}
* Number of comments: #{comments.count}
* Path: #{collection_card_path(collection, self, script_name: Account.sole.slug)}
END OF CARD #{id}
PROMPT
end
end