UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

36 lines 1.75 kB
import { JSONSchema7 } from 'json-schema'; import { ToolCallContext } from '../models/ToolCallContext'; import { ToolCallResult } from '../models/ToolCallResult'; /** Represents a tool call to be invoked by a DonobuFlow. */ export declare abstract class Tool<NonGptParameters, GptParameters> { /** * This is the name for the tool that will be shared with the LLM when making requests. */ readonly name: string; /** This is the description that will be shared with the LLM when making requests. */ readonly description: string; /** This is the JSON-schema for the tool when it is invoked by a non-LLM. */ readonly inputSchema: JSONSchema7; /** * This is the JSON-schema that will be shared with the LLM when making * requests during autonomous flows. **/ readonly inputSchemaForGpt: JSONSchema7; /** * This is the message that will be displayed in the front-end control panel when this tool is * invoked, assuming the control panel is enabled. */ readonly controlPanelMessage: string; /** Returns true if this tool requires the usage of a GPT. */ readonly requiresGpt: boolean; protected constructor(name: string, description: string, parametersTypeNameForNonGptSchema: string, parametersTypeNameForGptSchema: string, requiresGpt?: boolean); /** * Invoke the tool with the given context and parameters. */ abstract call(_context: ToolCallContext, _parameters: NonGptParameters): Promise<ToolCallResult>; /** * Invoke the tool as made from a GPT with the given context and parameters. */ abstract callFromGpt(_context: ToolCallContext, _parameters: GptParameters): Promise<ToolCallResult>; } //# sourceMappingURL=Tool.d.ts.map