# buildSystemPrompt
Source: https://docs.maelstrom-ai.co/dev/reference/planner-llm/functions/buildsystemprompt/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **buildSystemPrompt**(`mode`, `options?`): `string`

Defined in: [packages/planner-llm/src/lib/prompt/prompt-builder.ts:116](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/planner-llm/src/lib/prompt/prompt-builder.ts#L116)

Build the system-prompt half for a given layout mode and config-time options.

Pure: depends only on its arguments, so the result can be cached per `(mode, options)` tuple. `llmPlanner` precomputes one string per `LayoutMode` at construction and indexes by `request.context.layoutMode` per request — derive once, not per-turn.

## Parameters

### mode

`LayoutMode`

### options?

`Pick`<[`PromptOptions`](https://docs.maelstrom-ai.co/dev/reference/planner-llm/interfaces/promptoptions/), `"system"` | `"vars"`\>

## Returns

`string`

## Throws

If a `system` customizer is invalid (function targeting a non-default key) or itself throws. Messages have the form `Prompt section customizer for "<key>" ...`.

## Example

```ts
const systemPrompt = buildSystemPrompt('grid', {
  vars: { assistantName: 'Aria' },
  system: { identity: 'You are a healthcare assistant.' },
});
```
