@@ -4,16 +4,11 @@ import {
44 InstrumentationBase ,
55 InstrumentationNodeModuleDefinition ,
66} from '@opentelemetry/instrumentation' ;
7- import type { GoogleGenAIClient , Integration } from '@sentry/core' ;
7+ import type { GoogleGenAIClient , GoogleGenAIOptions , Integration } from '@sentry/core' ;
88import { getCurrentScope , GOOGLE_GENAI_INTEGRATION_NAME , instrumentGoogleGenAIClient , SDK_VERSION } from '@sentry/core' ;
99
1010const supportedVersions = [ '>=0.10.0 <2' ] ;
1111
12- interface GoogleGenAIOptions {
13- recordInputs ?: boolean ;
14- recordOutputs ?: boolean ;
15- }
16-
1712export interface GoogleGenAIIntegration extends Integration {
1813 options : GoogleGenAIOptions ;
1914}
@@ -33,11 +28,9 @@ function determineRecordingSettings(
3328 integrationOptions : GoogleGenAIOptions | undefined ,
3429 defaultEnabled : boolean ,
3530) : { recordInputs : boolean ; recordOutputs : boolean } {
36- if ( ! integrationOptions ?. recordInputs || ! integrationOptions . recordOutputs ) {
37- return { recordInputs : defaultEnabled , recordOutputs : defaultEnabled } ;
38- }
39-
40- return { recordInputs : integrationOptions . recordInputs , recordOutputs : integrationOptions . recordOutputs } ;
31+ const recordInputs = integrationOptions ?. recordInputs ?? defaultEnabled ;
32+ const recordOutputs = integrationOptions ?. recordOutputs ?? defaultEnabled ;
33+ return { recordInputs, recordOutputs } ;
4134}
4235
4336/**
0 commit comments