( config: CodeModeToolConfig, )
| 25 | * ``` |
| 26 | */ |
| 27 | export function createCodeMode( |
| 28 | config: CodeModeToolConfig, |
| 29 | ): CreateCodeModeResult { |
| 30 | const tool = createCodeModeTool(config) |
| 31 | const systemPrompt = createCodeModeSystemPrompt(config) |
| 32 | |
| 33 | const lazyTools = config.tools.filter((t) => t.lazy) |
| 34 | const discoveryTool = |
| 35 | lazyTools.length > 0 |
| 36 | ? createDiscoveryTool(lazyTools, config.lazyToolsConfig) |
| 37 | : null |
| 38 | |
| 39 | return { |
| 40 | tool, |
| 41 | discoveryTool, |
| 42 | tools: discoveryTool ? [tool, discoveryTool] : [tool], |
| 43 | systemPrompt, |
| 44 | } |
| 45 | } |
no test coverage detected