/** * The following code is modified based on * https://github.com/nanobrowser/nanobrowser/blob/master/chrome-extension/src/background/agent/actions/builder.ts * * Apache-2.0 License * Copyright (c) 2024 alexchenzl * https://github.com/nanobrowser/nanobrowser/blob/master/LICENSE */ import { ActionResult, type AgentContext } from '../types'; import { type ActionSchema } from './schemas'; import { z } from 'zod'; import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; export declare class InvalidInputError extends Error { constructor(message: string); } /** * An action is a function that takes an input and returns an ActionResult */ export declare class Action { private readonly handler; readonly schema: ActionSchema; constructor(handler: (input: any) => Promise, schema: ActionSchema); call(input: unknown): Promise; name(): string; /** * Returns the prompt for the action * @returns {string} The prompt for the action */ prompt(): string; } export declare function buildDynamicActionSchema(actions: Action[]): z.ZodType; export declare class ActionBuilder { private readonly context; private readonly extractorLLM; constructor(context: AgentContext, extractorLLM: BaseChatModel); buildDefaultActions(): Action[]; } //# sourceMappingURL=builder.d.ts.map