|
1 | 1 | import {BaseSession} from "../../utils/session.ts" |
2 | | -import {COMBINED_SYSTEM_PROMPT, API_CONFIG, MEMORY_TOOLS, CLIPBOARD_TOOLS, JINA_TOOLS} from "../../config/constants.ts" |
| 2 | +import {COMBINED_SYSTEM_PROMPT, API_CONFIG} from "../../config/constants.ts" |
3 | 3 | import {log} from "../../config/logging.ts" |
4 | 4 | import {ToolHandler} from "../../utils/tool_handler.ts" |
5 | | - |
6 | | - |
| 5 | +import {getConfigFileLocation} from "../../config/settings.ts" |
| 6 | +import {ToolConfigManager} from "../../config/tool_config.ts" |
7 | 7 |
|
8 | 8 | export class HybridSession extends BaseSession { |
9 | 9 | private toolHandler: ToolHandler |
10 | 10 |
|
11 | 11 | constructor(sessionId: string, noAgi = false) { |
12 | 12 | super(sessionId) |
13 | | - this.toolHandler = new ToolHandler(noAgi) |
| 13 | + const configPath = getConfigFileLocation() |
| 14 | + const toolConfig = new ToolConfigManager().loadConfig(configPath) |
| 15 | + this.toolHandler = new ToolHandler(noAgi, toolConfig) |
14 | 16 | } |
15 | 17 |
|
16 | 18 | async process(prompt: string): Promise<void> { |
@@ -39,9 +41,7 @@ export class HybridSession extends BaseSession { |
39 | 41 | tools: [ |
40 | 42 | {type: "bash_20241022", name: "bash"}, |
41 | 43 | {type: "text_editor_20241022", name: "str_replace_editor"}, |
42 | | - ...MEMORY_TOOLS, |
43 | | - ...CLIPBOARD_TOOLS, |
44 | | - ...JINA_TOOLS |
| 44 | + ...this.toolHandler.getAllTools() |
45 | 45 | ], |
46 | 46 | system: this.getSystemPrompt(`${COMBINED_SYSTEM_PROMPT}\nSystem Context: ${JSON.stringify(systemInfo)}`), |
47 | 47 | betas: ["computer-use-2024-10-22"], |
|
0 commit comments