()
| 29 | } |
| 30 | |
| 31 | async getTools(): ReturnType<ModelContext['getTools']> { |
| 32 | return Array.from(this.tools.values()).map( |
| 33 | ({name, title = '', description, inputSchema, annotations}) => ({ |
| 34 | name, |
| 35 | title, |
| 36 | description, |
| 37 | inputSchema, |
| 38 | annotations, |
| 39 | origin: location.origin, |
| 40 | window, |
| 41 | }), |
| 42 | ); |
| 43 | } |
| 44 | |
| 45 | async executeTool({name}: {name: string}, input: Record<string, unknown> = {}): Promise<string> { |
| 46 | const tool = this.tools.get(name)!; |