@servicenow/sdk - v4.7.0
    Preparing search index...

    Interface PromptSettingsBase<TInputs, TTools, TProvider>

    Base prompt settings for prompt versions Maps to sys_generative_ai_config fields Generic over TInputs and TTools to enable type-safe prompt builder

    interface PromptSettingsBase<
        TInputs extends readonly InputAttribute[] = readonly InputAttribute[],
        TTools extends
            Record<string, BaseToolHandle> = Record<string, BaseToolHandle>,
        TProvider extends string = string,
    > {
        $id: ExplicitKey;
        filterCondition?: { [K in string]?: string };
        maxTokens?: number;
        model: ModelForProvider<TProvider>;
        prompt: string | ((builder: PromptBuilder<TInputs, TTools>) => string);
        promptState: "draft" | "published" | "finalized" | "archived";
        temperature?: number;
        version?: number;
    }

    Type Parameters

    Index

    Properties

    Unique identifier for prompt

    Now.ID['my_skill_prompt_v1']
    
    filterCondition?: { [K in string]?: string }

    Filter condition for prompt version usage (maps to "Usage conditions" in ServiceNow UI) Defines when this prompt version should be used based on input attribute values

    In ServiceNow UI, this appears as:

    • Key dropdown: Select from available input attributes
    • Value field: Enter the condition value to match

    TYPE-SAFE: Keys can be:

    • Original input names (e.g., 'User table', 'priority')
    • Normalized name + dot-path for nested fields (e.g., 'user_table.building.country')

    Normalization converts spaces to underscores and lowercases: 'User table''user_table'

    // If you have inputs: [{ name: 'priority' }, { name: 'User table' }]
    filterCondition: {
    'priority': 'high', // Original name
    'user_table.building.country': 'USA' // Normalized + dot-path for nested field
    }
    // Multiple conditions (all must match)
    filterCondition: {
    'priority': '1',
    'user_table.active': 'true'
    }
    maxTokens?: number

    Maximum tokens for response (required for non-"Now LLM Generic" providers)

    Model name — autocomplete suggests known models for the selected provider Accepts any custom string for instance-specific or custom models

    Known model suggestions per provider:

    • Now LLM Service / Now LLM Generic: 'llm_generic_small', 'llm_generic_large', 'llm_generic_large_v2'
    • Azure OpenAI: 'gpt-4', 'gpt-4o-mini', 'gpt_large'
    • Open AI: 'gpt-4', 'gpt-4o-mini'
    • Google Gemini: 'gemini-pro', 'gemini_large'
    • AWS Claude: 'claude_large'
    • IBM Watson: 'ibm/granite-13b-chat-v2'
    prompt: string | ((builder: PromptBuilder<TInputs, TTools>) => string)

    The actual prompt text - can be a string or a builder function

    Option 1: Static string

    prompt: "You are a helpful assistant. User says: {{input.question}}"
    

    Option 2: Builder function (TYPE-SAFE!)

    prompt: (p) => p.template`
    You are a helpful assistant.
    User question: ${p.input.question}
    Search results: ${p.tool.search.results}
    `

    The builder function provides:

    • ✅ Autocomplete for input field names
    • ✅ Autocomplete for tool output fields (when tools are defined)
    • ✅ Type checking for field references
    • ✅ No need for external variable
    promptState: "draft" | "published" | "finalized" | "archived"

    Prompt state/status

    • "draft": Prompt is in draft state
    • "finalized": Prompt is finalized but not published
    • "published": Prompt is published and active
    • "archived": Prompt is archived (previous version)
    temperature?: number

    Temperature for LLM generation

    0.2
    
    version?: number

    Prompt version for tracking versions of same prompt

    1