Class AiPromptUserInstructionLibrary
The user's personal, reusable collection of standing instructions ("muletillas"), persisted under
IAiPromptPreferencesStore so it survives editor restarts and is shared across projects —
mirrors the Hub's own SerenityHubFavorites shape. Every mutation (Add(string, string),
Update(string, string, string), SetEnabled(string, bool), Remove(string)) reads the current list, applies
the change, and writes the whole list back immediately.
Inheritance
AiPromptUserInstructionLibrary
Assembly: Serenity.AiPromptBuilder.Editor.dll
Syntax
public sealed class AiPromptUserInstructionLibrary
Constructors
AiPromptUserInstructionLibrary()
Declaration
public AiPromptUserInstructionLibrary()
AiPromptUserInstructionLibrary(IAiPromptPreferencesStore)
Declaration
public AiPromptUserInstructionLibrary(IAiPromptPreferencesStore store)
Parameters
Methods
Add(string, string)
Appends a new snippet with a freshly generated id and Enabled defaulted to true.
Declaration
public AiPromptUserInstructionSnippet Add(string name, string instruction)
Parameters
Returns
ReadAll()
All persisted snippets, in stored order.
Declaration
public IReadOnlyList<AiPromptUserInstructionSnippet> ReadAll()
Returns
Remove(string)
Removes the snippet with id, if it exists.
Declaration
public void Remove(string id)
Parameters
| Type |
Name |
Description |
| string |
id |
|
SetEnabled(string, bool)
Sets the enabled flag of the snippet with id, if it still exists.
Declaration
public void SetEnabled(string id, bool enabled)
Parameters
Update(string, string, string)
Updates the name and instruction text of the snippet with id, if it still exists.
Declaration
public void Update(string id, string name, string instruction)
Parameters