Skip to content

SystemPrompt

type SystemPrompt = string | SystemContentBlock[];

Defined in: src/types/messages.ts:437

System prompt for guiding model behavior. Can be a simple string or an array of content blocks for advanced caching.

// Simple string
const prompt: SystemPrompt = 'You are a helpful assistant'
// Array with cache points for advanced caching
const prompt: SystemPrompt = [
{ textBlock: new TextBlock('You are a helpful assistant') },
{ textBlock: new TextBlock(largeContextDocument) },
{ cachePointBlock: new CachePointBlock({ cacheType: 'default' }) }
]