/** * Gemini Interactions API Client * * Provides access to Gemini models and the Deep Research agent * via the Interactions API for stable, API-based research capabilities. */ import type { ProgressCallback } from "../types.js"; import type { GeminiQueryOptions, GeminiInteraction, DeepResearchOptions, UploadDocumentOptions, QueryDocumentOptions, GeminiFile, UploadDocumentResult, QueryDocumentResult, ListDocumentsResult } from "./types.js"; export { DEEP_RESEARCH_AGENT } from "./types.js"; /** * Client for Gemini Interactions API */ export declare class GeminiClient { private client; constructor(apiKey?: string); /** * Check if the client is available (API key configured) */ isAvailable(): boolean; private requireClient; /** * Perform a quick query to Gemini */ query(options: GeminiQueryOptions): Promise; /** * Check if a model is deprecated and return a warning message */ private getDeprecationWarning; /** * Start deep research using the Deep Research agent */ deepResearch(options: DeepResearchOptions): Promise; /** * Get an existing interaction by ID */ getInteraction(interactionId: string): Promise; /** * Poll for interaction completion */ pollForCompletion(interactionId: string, maxWaitMs: number, progressCallback?: ProgressCallback): Promise; /** * Delete a stored interaction */ deleteInteraction(interactionId: string): Promise; /** * Map SDK response to our interface */ private mapInteraction; /** * Upload a document to Gemini Files API * Files are retained for 48 hours and can be used in multiple queries * Large PDFs (>50MB or >1000 pages) are automatically chunked */ uploadDocument(options: UploadDocumentOptions): Promise; /** * Upload a large PDF by splitting it into chunks */ private uploadChunkedPdf; /** * Wait for file processing to complete */ private waitForFileProcessing; /** * Get file metadata */ getFile(fileName: string): Promise; /** * List all uploaded files */ listFiles(pageSize?: number, pageToken?: string): Promise; /** * Delete an uploaded file */ deleteFile(fileName: string): Promise; /** * Query an uploaded document */ queryDocument(options: QueryDocumentOptions): Promise; /** * Query multiple document chunks and aggregate results * This is useful for querying large documents that were split into chunks */ queryChunkedDocument(fileNames: string[], query: string, options?: { model?: string; aggregatePrompt?: string; }): Promise; /** * Map SDK file response to our interface */ private mapFile; /** * Detect MIME type from file extension */ private detectMimeType; /** * Format bytes to human-readable string */ private formatBytes; /** * Calculate expiration time (48 hours from now) */ private calculateExpiration; }