discourse-ai/app/controllers/discourse_ai
Sam 9f2a4094f5
FEATURE: persona/tool import and export (#1450)
Introduces import/export feature for tools and personas.

Uploads are omitted for now, and will be added in a future PR 

*   **Backend:**
    *   Adds `import` and `export` actions to `Admin::AiPersonasController` and `Admin::AiToolsController`.
    *   Introduces `DiscourseAi::PersonaExporter` and `DiscourseAi::PersonaImporter` services to manage JSON serialization and deserialization.
    *   The export format for a persona embeds its associated custom tools. To ensure portability, `AiTool` references are serialized using their `tool_name` rather than their internal database `id`.
    *   The import logic detects conflicts by name. A `force=true` parameter can be passed to overwrite existing records.

*   **Frontend:**
    *   `AiPersonaListEditor` and `AiToolListEditor` components now include an "Import" button that handles file selection and POSTs the JSON data to the respective `import` endpoint.
    *   `AiPersonaEditorForm` and `AiToolEditorForm` components feature an "Export" button that triggers a download of the serialized record.
    *   Handles import conflicts (HTTP `409` for tools, `422` for personas) by showing a `dialog.confirm` prompt to allow the user to force an overwrite.

*   **Testing:**
    *   Adds comprehensive request specs for the new controller actions (`#import`, `#export`).
    *   Includes unit specs for the `PersonaExporter` and `PersonaImporter` services.
* Persona import and export implemented
2025-06-24 12:41:10 +10:00
..
admin FEATURE: persona/tool import and export (#1450) 2025-06-24 12:41:10 +10:00
ai_bot FEATURE: hybrid artifact security mode (#1431) 2025-06-12 20:04:48 +10:00
ai_helper FEATURE: Use different personas to power AI helper features. 2025-06-04 14:23:00 -03:00
discord FEATURE: Discord Bot integration (#831) 2024-10-16 12:41:18 -03:00
embeddings FIX: Invalid access error should be populated to user (#1303) 2025-04-30 12:10:10 -07:00
sentiment FIX: Ensure category badging present in sentiment reports (#1222) 2025-03-26 12:37:41 -07:00
summarization FIX/REFACTOR: FoldContent revamp (#866) 2024-10-25 11:51:17 -03:00