import type { Context, Model, StreamFunction, StreamOptions } from "../types"; import type { Content, FunctionCallingConfigMode, ThinkingConfig } from "./google-shared"; import { type GoogleThinkingLevel } from "./google-shared"; /** * Thinking level for Gemini 3 models. Re-exported from `google-shared` so existing * `import { GoogleThinkingLevel } from "./google-gemini-cli"` callers keep working. */ export type { GoogleThinkingLevel }; export interface GoogleGeminiCliOptions extends StreamOptions { toolChoice?: "auto" | "none" | "any" | "required"; /** * Thinking/reasoning configuration. * - Gemini 2.x models: use `budgetTokens` to set the thinking budget * - Gemini 3 models (gemini-3-pro-*, gemini-3-flash-*): use `level` instead * * When using `streamSimple`, this is handled automatically based on the model. */ thinking?: { enabled: boolean; /** Thinking budget in tokens. Use for Gemini 2.x models. */ budgetTokens?: number; /** Thinking level. Use for Gemini 3 models (LOW/HIGH for Pro, MINIMAL/LOW/MEDIUM/HIGH for Flash). */ level?: GoogleThinkingLevel; }; projectId?: string; } export { ANTIGRAVITY_SYSTEM_INSTRUCTION, getAntigravityRequestHeaders, getGeminiCliHeaders, getGeminiCliUserAgent, } from "./google-gemini-headers"; interface ParsedGeminiCliCredentials { accessToken: string; projectId: string; refreshToken?: string; expiresAt?: number; } export declare function parseGeminiCliCredentials(apiKeyRaw: string): ParsedGeminiCliCredentials; export declare function shouldRefreshGeminiCliCredentials(expiresAt: number | undefined, isAntigravity: boolean, nowMs?: number): boolean; interface CloudCodeAssistRequest { project: string; model: string; request: { contents: Content[]; sessionId?: string; systemInstruction?: { role?: string; parts: { text: string; }[]; }; generationConfig?: { maxOutputTokens?: number; temperature?: number; topP?: number; topK?: number; minP?: number; presencePenalty?: number; repetitionPenalty?: number; thinkingConfig?: ThinkingConfig; }; tools?: { functionDeclarations: Record[]; }[] | undefined; toolConfig?: { functionCallingConfig: { mode: FunctionCallingConfigMode; }; }; preambleConfig?: { mode: "SYSTEM_INSTRUCTION_MODE_REPLACE"; }; }; requestType?: string; userAgent?: string; requestId?: string; } export declare const streamGoogleGeminiCli: StreamFunction<"google-gemini-cli">; export declare function buildRequest(model: Model<"google-gemini-cli">, context: Context, projectId: string, options?: GoogleGeminiCliOptions, isAntigravity?: boolean): CloudCodeAssistRequest;