File tree Expand file tree Collapse file tree
packages/core/src/tracing/langchain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,14 +62,9 @@ export function instrumentEmbeddingMethod(
6262 originalMethod : ( ...args : unknown [ ] ) => Promise < unknown > ,
6363 options : LangChainOptions = { } ,
6464) : ( ...args : unknown [ ] ) => Promise < unknown > {
65- // Already instrumented
66- if ( ( originalMethod as { __sentry_wrapped__ ?: boolean } ) . __sentry_wrapped__ ) {
67- return originalMethod ;
68- }
69-
7065 const { recordInputs } = resolveAIRecordingOptions ( options ) ;
7166
72- const proxy = new Proxy ( originalMethod , {
67+ return new Proxy ( originalMethod , {
7368 apply ( target , thisArg , args : unknown [ ] ) : Promise < unknown > {
7469 const attributes = extractEmbeddingAttributes ( thisArg ) ;
7570 const modelName = attributes [ GEN_AI_REQUEST_MODEL_ATTRIBUTE ] || 'unknown' ;
@@ -98,10 +93,6 @@ export function instrumentEmbeddingMethod(
9893 ) ;
9994 } ,
10095 } ) as ( ...args : unknown [ ] ) => Promise < unknown > ;
101-
102- ( proxy as { __sentry_wrapped__ ?: boolean } ) . __sentry_wrapped__ = true ;
103-
104- return proxy ;
10596}
10697
10798/**
You can’t perform that action at this time.
0 commit comments