Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
30 lines
1.4 KiB
Plaintext
30 lines
1.4 KiB
Plaintext
import type { GoogleGenAIOptions } from './types';
|
|
/**
|
|
* Extract model from parameters or chat context object
|
|
* For chat instances, the model is available on the chat object as 'model' (older versions) or 'modelVersion' (newer versions)
|
|
*/
|
|
export declare function extractModel(params: Record<string, unknown>, context?: unknown): string;
|
|
/**
|
|
* Instrument a Google GenAI client with Sentry tracing
|
|
* Can be used across Node.js, Cloudflare Workers, and Vercel Edge
|
|
*
|
|
* @template T - The type of the client that extends client object
|
|
* @param client - The Google GenAI client to instrument
|
|
* @param options - Optional configuration for recording inputs and outputs
|
|
* @returns The instrumented client with the same type as the input
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* import { GoogleGenAI } from '@google/genai';
|
|
* import { instrumentGoogleGenAIClient } from '@sentry/core';
|
|
*
|
|
* const genAI = new GoogleGenAI({ apiKey: process.env.GOOGLE_GENAI_API_KEY });
|
|
* const instrumentedClient = instrumentGoogleGenAIClient(genAI);
|
|
*
|
|
* // Now both chats.create and sendMessage will be instrumented
|
|
* const chat = instrumentedClient.chats.create({ model: 'gemini-1.5-pro' });
|
|
* const response = await chat.sendMessage({ message: 'Hello' });
|
|
* ```
|
|
*/
|
|
export declare function instrumentGoogleGenAIClient<T extends object>(client: T, options?: GoogleGenAIOptions): T;
|
|
//# sourceMappingURL=index.d.ts.map |