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