import { GoogleGenAI } from '@google/genai'; import { type LLMAssistanceOptions, type LLMAssistanceResult, type LLMAssistanceMessage, type LLMCreateChatOptions, type LLMCreateChatResult, type LLMCreateFileStorageOptions, type LLMCreateFileStorageResult, type LLMInstanceOptions, type LLMModel, LLMProviders, type LLMUploadedFile, type LLMUploadFileOptions, type LLMUploadFileResult, type LLMStructuredResult } from '../../../LLMService.typedefs'; import { type LLMLoggerInterface } from '../../../utilities/logger'; import { type LLMReporterInterface } from '../../../utilities/reporter'; import { LLMAssistanceService } from '../../../services'; import { type LLMSchemaInterface } from '../../../utilities/schema'; export declare class GoogleGenerativeAIAssistanceService | undefined> extends LLMAssistanceService { private cachedContent; private chatSessions; private uploadedFiles; private uncachedFileStorages; private chatInstructions; constructor(logger: LLMLoggerInterface | undefined, reporter: Reporter, options?: LLMInstanceOptions[LLMProviders.GoogleGenerativeAI]); get instance(): GoogleGenAI; uploadFile(fileOptions: LLMUploadFileOptions): Promise; getFile(path: string): Promise; deleteFile(fileId: string): Promise; createFileStorage(options: LLMCreateFileStorageOptions): Promise; deleteFileStorage(fileStorageId: string): Promise; createChat(options: LLMCreateChatOptions): Promise; deleteChat(chatId: string): Promise; private getStorageFileParts; protected assistInChatText(options: LLMAssistanceOptions): Promise; protected assistInChatStructured(options: LLMAssistanceOptions & { schema: LLMSchemaInterface; }): Promise; private prepareChatMessage; private sendStructuredFollowUp; /** * The conversation one round was sent with: the chat's system instruction, * the history the SDK holds for the session, and the parts this round adds. * Built before the request goes out so a round that throws traces the same * transcript a successful one does. */ private buildRoundConversation; /** * One round's usage, mapped exactly as the run total is mapped for metrics, * so the per-round generations add up to the single metrics point the run * still writes. */ private buildUsageMetrics; private readonly buildRoundOutcome; private extractUsageFromResponse; private combineUsage; private convertCustomToolsToGoogle; private executeGoogleToolLoop; /** * The visible assistant text a continuing tool-loop round produced, joined * from the response's text parts. Thinking parts (`part.thought`) are * excluded so only the visible narration channel is surfaced. */ private extractVisibleToolRoundText; private executeGoogleFunctionCalls; private buildFunctionResponseParts; private executeSingleGoogleFunctionCall; /** * Gemini 3 models accept image bytes inside `functionResponse.parts`. Each * image blob carries a unique `displayName` the `response` payload then * references via `{ $ref: displayName }`. */ private buildNativeFunctionResponsePart; /** * Gemini 2.5 models cannot carry images in a function response, so image * bytes are appended as sibling user-content parts after every function * response in the same message. */ private buildAppendedFunctionResponseParts; private buildInlineImageParts; private fetchToolImageBlob; countTokens(messages: LLMAssistanceMessage[], model: LLMModel): Promise; }