xref: /plugin/dokullm/doc/profiles.txt (revision bad70cfe3703fa467157762485bba967ee8e741f)
168020f72SCostin Stroie====== Profiles ======
268020f72SCostin Stroie
3*bad70cfeSCostin Stroie (aider)Profiles in DokuLLM allow you to organize and customize your AI interactions. Each profile can have its own set of actions, prompts, and configurations. By default, the plugin uses the [[default|default]] profile, but you can create and switch between multiple profiles as needed.
468020f72SCostin Stroie
568020f72SCostin Stroie===== Available Profiles =====
668020f72SCostin Stroie
768020f72SCostin StroieThe following profiles are currently available:
8*bad70cfeSCostin Stroie (aider)  * [[default|default]] - The standard profile with basic actions
968020f72SCostin Stroie  * //Add your custom profiles here//
1068020f72SCostin Stroie
1168020f72SCostin Stroie===== Creating a New Profile =====
1268020f72SCostin Stroie
1368020f72SCostin StroieTo create a new profile:
1468020f72SCostin Stroie
15*bad70cfeSCostin Stroie (aider)  - Create a new directory at ''lib/plugins/dokullm/doc/profiles/PROFILE_NAME'' (replace PROFILE_NAME with your desired profile name)
16*bad70cfeSCostin Stroie (aider)  - Create a profile definition file (similar to ''doc/default.txt'') that defines the actions available in this profile
17*bad70cfeSCostin Stroie (aider)  - Add prompt files for each action in your profile
1868020f72SCostin Stroie  - Configure the plugin to use your new profile in the plugin settings
1968020f72SCostin Stroie
20*bad70cfeSCostin Stroie (aider)===== Profile Structure =====
2168020f72SCostin Stroie
22*bad70cfeSCostin Stroie (aider)Each profile follows a specific directory structure:
23*bad70cfeSCostin Stroie (aider)
24*bad70cfeSCostin Stroie (aider)  * ''doc/profiles/PROFILE_NAME/'' - Profile directory
25*bad70cfeSCostin Stroie (aider)  * ''doc/profiles/PROFILE_NAME/system'' - Base system prompt for the profile
26*bad70cfeSCostin Stroie (aider)  * ''doc/profiles/PROFILE_NAME/action_name.txt'' - Prompt file for each action
27*bad70cfeSCostin Stroie (aider)  * ''doc/profiles/PROFILE_NAME/action_name/system'' - Action-specific system prompt extension
28*bad70cfeSCostin Stroie (aider)
29*bad70cfeSCostin Stroie (aider)===== Profile Action Definition =====
30*bad70cfeSCostin Stroie (aider)
31*bad70cfeSCostin Stroie (aider)Each profile needs a definition file (like ''doc/default.txt'') that contains a table defining the available actions. The table must have the following columns:
3268020f72SCostin Stroie
3368020f72SCostin Stroie^ ID ^ Label ^ Description ^ Icon ^ Result ^
3468020f72SCostin Stroie| action_id | Button Text | Description of what the action does | icon_name | result_action_type |
3568020f72SCostin Stroie
3668020f72SCostin StroieColumn details:
3768020f72SCostin Stroie  * **ID**: The action identifier, which corresponds to the prompt name
3868020f72SCostin Stroie  * **Label**: The text displayed on the button
3968020f72SCostin Stroie  * **Description**: A detailed description of the action, used as a tooltip
4068020f72SCostin Stroie  * **Icon**: The icon displayed on the button (can be empty)
4168020f72SCostin Stroie  * **Result**: The action to perform with the LLM result:
4268020f72SCostin Stroie    * ''show'': Display the result in a modal dialog
4368020f72SCostin Stroie    * ''append'': Add the result to the end of the current content
4468020f72SCostin Stroie    * ''replace'': Replace the selected content with the result
4568020f72SCostin Stroie    * ''insert'': Insert the result at the cursor position
4668020f72SCostin Stroie
47*bad70cfeSCostin Stroie (aider)==== Example Profile Definition ====
4868020f72SCostin Stroie
4968020f72SCostin StroieHere's an example of how to structure your profile action table:
5068020f72SCostin Stroie
5168020f72SCostin Stroie^ ID ^ Label ^ Description ^ Icon ^ Result ^
5268020f72SCostin Stroie| summarize | Summarize | Create a summary of the selected text | file-icons:summary | show |
5368020f72SCostin Stroie| expand | Expand | Expand the selected text with more details | file-icons:expand | replace |
54*bad70cfeSCostin Stroie (aider)| grammar | Fix Grammar | Correct grammar and spelling errors | file-icons:spellcheck | replace |
5568020f72SCostin Stroie
5668020f72SCostin Stroie===== Using Profiles =====
5768020f72SCostin Stroie
5868020f72SCostin StroieTo use a specific profile:
5968020f72SCostin Stroie  - Go to the plugin configuration page
6068020f72SCostin Stroie  - Find the "Prompt Profile" setting
6168020f72SCostin Stroie  - Enter the name of the profile you want to use
6268020f72SCostin Stroie  - Save the configuration
6368020f72SCostin Stroie
6468020f72SCostin StroieThe selected profile will be used for all LLM interactions until you change it.
6568020f72SCostin Stroie
66*bad70cfeSCostin Stroie (aider)===== Adding Custom Prompts =====
6768020f72SCostin Stroie
68*bad70cfeSCostin Stroie (aider)Each action in your profile corresponds to a prompt file. To add a custom prompt:
69*bad70cfeSCostin Stroie (aider)  - Create a new file at ''doc/profiles/PROFILE_NAME/PROMPT_NAME.txt'' (replace PROFILE_NAME with your profile and PROMPT_NAME with your action ID)
70*bad70cfeSCostin Stroie (aider)  - Write your prompt in this file, using placeholders as needed:
7168020f72SCostin Stroie    * ''{text}'' - The selected text from the editor or the entire text
7268020f72SCostin Stroie    * ''{template}'' - The template associated with the request
7368020f72SCostin Stroie    * The prompt will automatically be available through the action defined in your profile
7468020f72SCostin Stroie
75*bad70cfeSCostin Stroie (aider)===== System Prompt Extensions =====
76*bad70cfeSCostin Stroie (aider)
77*bad70cfeSCostin Stroie (aider)Profiles support a hierarchical system prompt architecture:
78*bad70cfeSCostin Stroie (aider)
79*bad70cfeSCostin Stroie (aider)  * Base system prompt at ''doc/profiles/PROFILE_NAME/system''
80*bad70cfeSCostin Stroie (aider)  * Action-specific extensions at ''doc/profiles/PROFILE_NAME/ACTION_NAME/system''
81*bad70cfeSCostin Stroie (aider)  * Extensions are automatically appended to the base system prompt
82*bad70cfeSCostin Stroie (aider)
8368020f72SCostin Stroie===== Metadata Support =====
8468020f72SCostin Stroie
85*bad70cfeSCostin Stroie (aider)DokuLLM supports metadata in your wiki pages, which can be used to provide additional context to the LLM:
8668020f72SCostin Stroie  * ''~~LLM_TEMPLATE:template_id~~'' - Specifies a template to use as context
8768020f72SCostin Stroie  * ''~~LLM_EXAMPLES:example1,example2~~'' - Specifies example pages to use as context
8868020f72SCostin Stroie  * ''~~LLM_PREVIOUS:previous_page~~'' - Specifies a previous document to use as context
8968020f72SCostin Stroie
9068020f72SCostin StroieThese metadata tags should be placed at the beginning of your wiki page.
91