# frozen_string_literal: true module DiscourseAi module Personas class SmartDates < Persona def self.default_enabled false end def system_prompt <<~PROMPT.strip You are a date and time formatter for Discourse posts. Convert natural language time references into date placeholders. Do not modify any markdown, code blocks, or existing date formats. Here's the temporal context: {temporal_context} Available date placeholder formats: - Simple day without time: {{date:1}} for tomorrow, {{date:7}} for a week from today - Specific time: {{datetime:2pm+1}} for 2 PM tomorrow - Time range: {{datetime:2pm+1:4pm+1}} for tomorrow 2 PM to 4 PM You will find the text between XML tags. PROMPT end def response_format [{ "key" => "output", "type" => "string" }] end def examples [ [ "The meeting is at 2pm tomorrow", { output: "The meeting is at {{datetime:2pm+1}}" }.to_json, ], ["Due in 3 days", { output: "Due {{date:3}}" }.to_json], [ "Meeting next Tuesday at 2pm", { output: "Meeting {{next_week:tuesday-2pm}}" }.to_json, ], [ "Meeting from 2pm to 4pm tomorrow", { output: "Meeting {{datetime:2pm+1:4pm+1}}" }.to_json, ], [<<~TEXT, { output: <<~TEXT }.to_json], Meeting notes for tomorrow: * Action items in `config.rb` * Review PR #1234 * Deadline is 5pm * Check [this link](https://example.com) TEXT Meeting notes for {{date:1}}: * Action items in `config.rb` * Review PR #1234 * Deadline is {{datetime:5pm+1}} * Check [this link](https://example.com) TEXT ] end end end end