( context: ProcessUserInputContext, deps: ReplPromptContextBuilderDeps, )
| 10 | } |
| 11 | |
| 12 | export async function buildReplPromptContext( |
| 13 | context: ProcessUserInputContext, |
| 14 | deps: ReplPromptContextBuilderDeps, |
| 15 | ): Promise<{ |
| 16 | systemPrompt: string |
| 17 | userContext: Record<string, string> |
| 18 | systemContext: Record<string, string> |
| 19 | }> { |
| 20 | const [systemPrompt, userContext, systemContext] = await Promise.all([ |
| 21 | deps.buildRenderedSystemPrompt(context), |
| 22 | deps.getUserContext(), |
| 23 | deps.getSystemContext(), |
| 24 | ]) |
| 25 | |
| 26 | if (deps.setRenderedPromptOnContext) { |
| 27 | context.renderedSystemPrompt = systemPrompt |
| 28 | } |
| 29 | |
| 30 | return { |
| 31 | systemPrompt, |
| 32 | userContext, |
| 33 | systemContext, |
| 34 | } |
| 35 | } |
no outgoing calls
no test coverage detected