Skip to content

Build your personal knowledge base with Trilium Notes

client/AI chat: include keyboard key style in the formatting instructions

Adorian Doran11aab858fe67
diff --git a/apps/server/src/services/llm/providers/base_provider.spec.ts b/apps/server/src/services/llm/providers/base_provider.spec.ts
index 1c311bab1f..5b13192475 100644
--- a/apps/server/src/services/llm/providers/base_provider.spec.ts
+++ b/apps/server/src/services/llm/providers/base_provider.spec.ts
@@ -303,6 +303,7 @@ describe("BaseProvider system prompt", () => {
expect(prompt).toContain("Blockquotes");
expect(prompt).toContain("Tables");
expect(prompt).toContain("Collapsible blocks");
+ expect(prompt).toContain("Keyboard keys");
});
it("lists the workspace's custom task-state markers so the model can recognize them", () => {
diff --git a/apps/server/src/services/llm/providers/base_provider.ts b/apps/server/src/services/llm/providers/base_provider.ts
index 618ffa5ac9..441431b34e 100644
--- a/apps/server/src/services/llm/providers/base_provider.ts
+++ b/apps/server/src/services/llm/providers/base_provider.ts
@@ -270,6 +270,7 @@ export abstract class BaseProvider implements LlmProvider {
+ `**Collapsible blocks** — use the standard HTML \`<details>\`/\`<summary>\` form; the \`<summary>\` is the always-visible title. Placed back-to-back with nothing between them, consecutive collapsible blocks are grouped into an accordion — handy when presenting several options or alternatives the user can expand one at a time. Example:\n`
+ `<details><summary>Option A</summary>\nDetails about the first option.\n</details>\n<details><summary>Option B</summary>\nDetails about the second option.\n</details>\n\n`
+ `**Footnotes** — use \`[^1]\` in text and \`[^1]: explanation\` at the bottom.\n\n`
+ + `**Keyboard keys** — wrap each key in a \`<kbd>\` tag when documenting shortcuts, e.g. \`<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd>\`.\n\n`
+ buildTaskListHint()
);