Hiyve Components - v1.0.0
    Preparing search index...

    A reusable AI prompt template. Hosts persist these (typically per teacher) and pass them into AIMagicAction.prompts. The SDK is AI-provider-agnostic — systemPrompt and userPromptPrefix describe the intent, the consumer's onTransform callback decides how to route them (OpenAI, Anthropic, local model, …).

    Two flavours co-exist in the same list:

    • Presets (isPreset: true): shipped with the host, immutable by end users. Always visible.
    • Custom (isPreset false/absent): created by a teacher in the settings UI; only their own author sees them.
    interface AIPromptTemplate {
        category?: string;
        description?: string;
        id: string;
        isPreset?: boolean;
        model?: string;
        name: string;
        systemPrompt: string;
        userPromptPrefix: string;
    }
    Index

    Properties

    category?: string

    Category tag for scoping (e.g. 'note', 'assignment'). The consumer filters available prompts by category when mounting the action; an empty/missing category matches everything.

    description?: string

    Optional human-readable description shown as helper text.

    id: string

    Stable identifier (e.g. ObjectId or slug).

    isPreset?: boolean

    True when shipped as a host preset — UI hides edit/delete for these.

    model?: string

    Optional model override (e.g. 'gpt-4o-mini'). Consumer-controlled.

    name: string

    Display name shown in the action dropdown.

    systemPrompt: string

    System role / behaviour instructions for the model. Sent as the system message (or equivalent) by the host's onTransform.

    userPromptPrefix: string

    Prefix prepended to the user input before sending. E.g. "Rewrite the following text to be student-friendly:\n\n".