UNPKG

donobu

Version:

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

38 lines 1.45 kB
import type { LanguageModel } from 'ai'; import type { z } from 'zod/v4'; import type { AssistantMessage, GptMessage, ProposedToolCallsMessage, StructuredOutputMessage } from '../models/GptMessage'; import type { ToolOption } from './GptClient'; import { GptClient } from './GptClient'; /** * A GPT client implemented using the Vercel AI SDK. */ export declare class VercelAiGptClient extends GptClient { private readonly model; private static readonly REQUEST_TIMEOUT_MILLISECONDS; /** * Create a new instance. */ constructor(model: Exclude<LanguageModel, string>); ping(options?: { signal?: AbortSignal; }): Promise<void>; getMessage(messages: GptMessage[], options?: { signal?: AbortSignal; }): Promise<AssistantMessage>; getStructuredOutput<T>(messages: GptMessage[], jsonSchema: z.ZodSchema<T>, options?: { signal?: AbortSignal; }): Promise<StructuredOutputMessage<T>>; getToolCalls(messages: GptMessage[], tools: ToolOption[], options?: { signal?: AbortSignal; }): Promise<ProposedToolCallsMessage>; /** * Convert GptMessage array to CoreMessage array for Vercel AI SDK. * Merges adjacent `tool_call_result` messages into a single `CoreToolMessage`. */ private convertToCoreMessages; /** * Maps an error to a DonobuException */ private mapErrorToDonobuException; } //# sourceMappingURL=VercelAiGptClient.d.ts.map