Member Junction
    Preparing search index...

    Action that executes MemberJunction AI prompts

    // Execute a simple prompt
    await runAction({
    ActionName: 'Execute AI Prompt',
    Params: [{
    Name: 'PromptName',
    Value: 'Summarize Text'
    }, {
    Name: 'Variables',
    Value: {
    text: 'Long article text here...',
    maxLength: 200
    }
    }]
    });

    // Execute with model override
    await runAction({
    ActionName: 'Execute AI Prompt',
    Params: [{
    Name: 'PromptName',
    Value: 'Generate Code'
    }, {
    Name: 'Variables',
    Value: {
    language: 'TypeScript',
    description: 'Function to calculate fibonacci'
    }
    }, {
    Name: 'ModelOverride',
    Value: 'gpt-4'
    }, {
    Name: 'TemperatureOverride',
    Value: 0.7
    }]
    });

    // Execute with streaming
    await runAction({
    ActionName: 'Execute AI Prompt',
    Params: [{
    Name: 'PromptName',
    Value: 'Creative Writing'
    }, {
    Name: 'Variables',
    Value: { topic: 'space exploration' }
    }, {
    Name: 'Stream',
    Value: true
    }]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    Methods

    • Executes a MemberJunction AI prompt

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • PromptName: Name of the AI prompt to execute (required)
        • Variables: Object with variables for the prompt (optional)
        • ModelOverride: Override the default model (optional)
        • TemperatureOverride: Override temperature setting (optional)
        • MaxTokensOverride: Override max tokens (optional)
        • Stream: Boolean - stream responses (default: false)
        • SystemPromptOverride: Override system prompt (optional)
        • IncludeMetadata: Include prompt metadata in response (default: false)

      Returns Promise<ActionResultSimple>

      AI prompt response