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>(
236236 if ( finalOptions . recordInputs && args [ 0 ] && typeof args [ 0 ] === 'object' ) {
237237 addPrivateRequestAttributes ( span , args [ 0 ] as Record < string , unknown > ) ;
238238 }
239- const result = ( originalMethod as ( ...args : T ) => R ) . apply ( context , args ) ;
240-
239+ const result = originalMethod . apply ( context , args ) ;
241240 // No response attributes for create (returns object of chat instance, not generated content)
242241 return result ;
243242 } catch ( error ) {
@@ -263,8 +262,8 @@ function instrumentMethod<T extends unknown[], R>(
263262 addPrivateRequestAttributes ( span , args [ 0 ] as Record < string , unknown > ) ;
264263 }
265264
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 ) ;
268267 return result ;
269268 } catch ( error ) {
270269 captureException ( error , {
You can’t perform that action at this time.
0 commit comments