UNPKG

ai-utils.js

Version:

Build AI applications, chatbots, and agents with JavaScript and TypeScript.

40 lines (39 loc) 1.12 kB
export class Tool { constructor(options) { Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "description", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "inputSchema", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "execute", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.name = options.name; this.description = options.description; this.inputSchema = options.inputSchema; this.execute = options.execute; } get inputSchemaDefinition() { return { name: this.name, description: this.description, schema: this.inputSchema, }; } }