import type { AvailableModel, CreateChatCompletionOptions, LLMResponse } from "@browserbasehq/stagehand"; import { LLMClient } from "@browserbasehq/stagehand"; type LLMCache = any; export interface GroqClientOptions { apiKey?: string; baseURL?: string; maxRetries?: number; timeout?: number; skipTokenLimitCheck?: boolean; } export interface GroqMessage { role: "assistant" | "system" | "user" | "tool"; content: string | null; tool_calls?: Array; } export interface GroqToolCall { id: string; type: "function"; function: { name: string; arguments: string; }; } export interface GroqCompletion { id: string; object: "chat.completion"; created: number; model: string; choices: Array<{ index: number; message: GroqMessage; finish_reason: "stop" | "length" | "tool_calls" | "content_filter" | null; }>; usage: { prompt_tokens: number; completion_tokens: number; total_tokens: number; }; } export declare class GroqError extends Error { constructor(message: string); } export declare class GroqAPIError extends GroqError { status: number; code: string; param: string | null; constructor(message: string, status: number, code: string, param?: string | null); } export declare class GroqAuthenticationError extends GroqAPIError { constructor(message: string); } export declare class GroqRateLimitError extends GroqAPIError { constructor(message: string); } export declare class GroqTimeoutError extends GroqError { constructor(message?: string); } export declare class GroqConnectionError extends GroqError { constructor(message?: string); } export declare class GroqValidationError extends GroqError { constructor(message: string); } export declare class GroqClient extends LLMClient { type: "groq"; private client; private cache; private enableCaching; clientOptions: GroqClientOptions; userProvidedInstructions?: string; /** * Combines system prompts with user-provided instructions. * @param systemPrompt - The base system prompt * @param userProvidedInstructions - Optional user-provided instructions * @returns Combined system prompt with user instructions */ private combineSystemPrompt; /** * Prepares messages array with system prompt and user instructions. * @param messages - Original messages array * @param logger - Logger function * @returns Modified messages array with combined system prompt */ private prepareMessages; private validateParameters; constructor({ enableCaching, cache, modelName, clientOptions, userProvidedInstructions, }: { enableCaching?: boolean; cache?: LLMCache; modelName: AvailableModel; clientOptions?: GroqClientOptions; userProvidedInstructions?: string; }); createChatCompletion({ options, retries, logger, }: CreateChatCompletionOptions): Promise; } export {};