Function
appendSystemContext
(
systemPrompt: SystemPrompt,
context: { [k: string]: string },
)
Source from the content-addressed store, hash-verified
| 429 | } |
| 430 | |
| 431 | export function appendSystemContext( |
| 432 | systemPrompt: SystemPrompt, |
| 433 | context: { [k: string]: string }, |
| 434 | ): string[] { |
| 435 | return [ |
| 436 | ...systemPrompt, |
| 437 | Object.entries(context) |
| 438 | .map(([key, value]) => `${key}: ${value}`) |
| 439 | .join('\n'), |
| 440 | ].filter(Boolean) |
| 441 | } |
| 442 | |
| 443 | export function prependUserContext( |
| 444 | messages: Message[], |
Tested by
no test coverage detected