File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/core/src/utils/google-genai Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -236,8 +236,7 @@ function instrumentMethod<T extends unknown[], R>(
236
236
if ( finalOptions . recordInputs && args [ 0 ] && typeof args [ 0 ] === 'object' ) {
237
237
addPrivateRequestAttributes ( span , args [ 0 ] as Record < string , unknown > ) ;
238
238
}
239
- const result = ( originalMethod as ( ...args : T ) => R ) . apply ( context , args ) ;
240
-
239
+ const result = originalMethod . apply ( context , args ) ;
241
240
// No response attributes for create (returns object of chat instance, not generated content)
242
241
return result ;
243
242
} catch ( error ) {
@@ -263,8 +262,8 @@ function instrumentMethod<T extends unknown[], R>(
263
262
addPrivateRequestAttributes ( span , args [ 0 ] as Record < string , unknown > ) ;
264
263
}
265
264
266
- const result = await Promise . resolve ( ( originalMethod as ( ... args : T ) => Promise < R > ) . apply ( context , args ) ) ;
267
- addResponseAttributes ( span , result as GoogleGenAIResponse , finalOptions . recordOutputs ) ;
265
+ const result = await originalMethod . apply ( context , args ) ;
266
+ addResponseAttributes ( span , result , finalOptions . recordOutputs ) ;
268
267
return result ;
269
268
} catch ( error ) {
270
269
captureException ( error , {
You can’t perform that action at this time.
0 commit comments