Go to file
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
.github/workflows Initial commit 2023-02-17 11:33:47 -03:00
admin/assets/javascripts/discourse FEATURE: Display features that rely on multiple personas. (#1411) 2025-06-09 16:13:09 -03:00
app FEATURE: persona/tool import and export (#1450) 2025-06-24 12:41:10 +10:00
assets FEATURE: persona/tool import and export (#1450) 2025-06-24 12:41:10 +10:00
config FEATURE: persona/tool import and export (#1450) 2025-06-24 12:41:10 +10:00
db DEV: Indicate backfill rate for translations is hourly (#1451) 2025-06-21 15:45:09 +08:00
discourse_automation FEATURE: allow to send LLM reports to groups (#1246) 2025-04-07 15:31:30 +10:00
evals FEATURE: Use different personas to power AI helper features. 2025-06-04 14:23:00 -03:00
lib FIX: Include JSON instructions in Helper default personas (#1458) 2025-06-23 11:57:50 -03:00
public/ai-share FEATURE: persistent key-value storage for AI Artifacts (#1417) 2025-06-11 06:59:46 +10:00
spec FEATURE: persona/tool import and export (#1450) 2025-06-24 12:41:10 +10:00
svg-icons REFACTOR: update embeddings to formkit (#1188) 2025-03-13 11:27:38 -04:00
test/javascripts DEV: adds pointerup event to our select text helper (#1429) 2025-06-12 10:33:14 +02:00
tokenizers FEATURE: Add Qwen3 tokenizer and update Gemma to version 3 (#1440) 2025-06-17 10:25:03 -03:00
.discourse-compatibility DEV: Remove 'experimental' from translation features (#1439) 2025-06-19 12:23:56 +08:00
.gitignore FEATURE: allow tools to amend personas (#1250) 2025-04-09 15:48:25 +10:00
.npmrc DEV: Switch to use pnpm (#833) 2024-10-14 13:37:20 +02:00
.prettierignore FEATURE: UI to update ai personas on admin page (#290) 2023-11-21 16:56:43 +11:00
.prettierrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.rubocop.yml DEV: Expose AI spam scanning metrics (#1077) 2025-01-27 11:57:01 +08:00
.streerc DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.template-lintrc.cjs DEV: Update linting (#326) 2023-11-29 23:01:48 +01:00
Gemfile DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
Gemfile.lock Build(deps-dev): Bump rack from 3.1.12 to 3.1.14 (#1327) 2025-05-12 17:11:57 -03:00
LICENSE DEV: Update license (#1147) 2025-02-24 11:20:06 +08:00
README.md DEV: Extract configs to a yml file and allow local config (#1142) 2025-02-24 16:22:19 +11:00
about.json DEV: GH CI needs discourse-solved (#1220) 2025-03-26 10:12:55 -03:00
eslint.config.mjs DEV: Update eslint config (#917) 2024-11-19 11:57:40 +01:00
package.json DEV: Update linting (#1194) 2025-03-17 15:14:53 +11:00
plugin.rb DEV: Use a PORO to represent modules/features. (#1421) 2025-06-10 14:37:53 -03:00
pnpm-lock.yaml DEV: Update linting (#1194) 2025-03-17 15:14:53 +11:00
stylelint.config.mjs DEV: Update linting (#1191) 2025-03-13 13:25:38 +00:00
translator.yml UX: Display the indexing progress for RAG uploads (#557) 2024-04-09 11:03:07 -03:00

README.md

Discourse AI Plugin

Plugin Summary

For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco

Evals

The directory evals contains AI evals for the Discourse AI plugin. You may create a local config by copying config/eval-llms.yml to config/eval-llms.local.yml and modifying the values.

To run them use:

cd evals ./run --help

Usage: evals/run [options]
    -e, --eval NAME                  Name of the evaluation to run
        --list-models                List models
    -m, --model NAME                 Model to evaluate (will eval all models if not specified)
    -l, --list                       List evals

To run evals you will need to configure API keys in your environment:

OPENAI_API_KEY=your_openai_api_key ANTHROPIC_API_KEY=your_anthropic_api_key GEMINI_API_KEY=your_gemini_api_key