/** * Google AI Studio / Gemini API request transformer and usage extractor. * Intercepts /google-ai-studio/v1beta/models/*:generateContent and :streamGenerateContent * requests, extracts static system instructions, renders them to PNG image parts, and * passes transformed payloads to Google AI Studio. */ import { type TransformInfo } from './transform.js'; export interface GooglePart { text?: string; inlineData?: { mimeType: string; data: string; }; functionCall?: { name?: string; args?: unknown; [key: string]: unknown; }; functionResponse?: { name?: string; response?: unknown; parts?: GooglePart[]; [key: string]: unknown; }; [key: string]: unknown; } export interface GoogleContent { role?: 'user' | 'model' | string; parts?: GooglePart[]; [key: string]: unknown; } export interface GoogleGenerateContentRequest { contents?: GoogleContent[]; systemInstruction?: { role?: string; parts?: GooglePart[]; [key: string]: unknown; }; tools?: unknown[]; [key: string]: unknown; } export declare function parseGoogleModelFromPath(pathname: string): string | null; /** * Normalizes Google turn roles so that: * 1. Adjacent turns with the same role are merged. * 2. The conversation starts with a user turn. * 3. The conversation ends with a user turn (never a model turn), avoiding * Google AI Studio's 400 "Requests ending with a model turn are not supported." */ export declare function normalizeGoogleTurnRoles(contents: GoogleContent[]): GoogleContent[]; export declare function transformGoogleGenerateContent(bodyBytes: Uint8Array, modelName: string, options?: { compress?: boolean; compressTools?: boolean; compressToolResults?: boolean; collapseHistory?: boolean; minToolResultChars?: number; maxImagesPerToolResult?: number; cols?: number; reflow?: boolean; }): Promise<{ body: Uint8Array; info: TransformInfo; }>; //# sourceMappingURL=google.d.ts.map