TomTom Maps for JavaScript
    Preparing search index...

    Variable composeSystemPromptConst

    composeSystemPrompt: (overrides?: SystemPromptSectionOverrides) => string

    Composes the base system prompt from SYSTEM_PROMPT_SECTIONS, applying any per-section overrides.

    Type Declaration

      • (overrides?: SystemPromptSectionOverrides): string
      • Parameters

        • Optionaloverrides: SystemPromptSectionOverrides

          Replacement body text keyed by section; omitted sections fall back to the default. The section heading is added automatically, so an override does not repeat it. Pass the result to MapAgentOptions.systemPrompt.

        Returns string

        The composed system prompt string.

    import { createMapAgent, composeSystemPrompt } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';

    const agent = createMapAgent(map, {
    model: openai('gpt-4o'),
    // No need to repeat "RESPONSE FORMATTING:" — it is prepended for you.
    systemPrompt: composeSystemPrompt({
    responseFormatting: 'Always respond in Spanish, and keep it terse.',
    }),
    });