logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    AiPromptUserInstructionLibrary
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Editor.AiPromptBuilder
    Assembly: Serenity.AiPromptBuilder.Editor.dll
    Syntax
    public sealed class AiPromptUserInstructionLibrary

    Constructors

    AiPromptUserInstructionLibrary()

    Declaration
    public AiPromptUserInstructionLibrary()

    AiPromptUserInstructionLibrary(IAiPromptPreferencesStore)

    Declaration
    public AiPromptUserInstructionLibrary(IAiPromptPreferencesStore store)
    Parameters
    Type Name Description
    IAiPromptPreferencesStore store

    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
    Type Name Description
    string name
    string instruction
    Returns
    Type Description
    AiPromptUserInstructionSnippet

    ReadAll()

    All persisted snippets, in stored order.

    Declaration
    public IReadOnlyList<AiPromptUserInstructionSnippet> ReadAll()
    Returns
    Type Description
    IReadOnlyList<AiPromptUserInstructionSnippet>

    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
    Type Name Description
    string id
    bool enabled

    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
    Type Name Description
    string id
    string name
    string instruction
    In this article
    © 2026 Serenity. All Rights Reserved