File tree Expand file tree Collapse file tree
packages/langbase/src/langbase Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -640,7 +640,7 @@ export class Langbase {
640640 } ;
641641 } ;
642642
643- public workflow : ( config : { debug ?: boolean ; name ?: string } ) => Workflow ;
643+ public workflow : ( config ? : { debug ?: boolean ; name ?: string } ) => Workflow ;
644644
645645 public traces : {
646646 create : ( trace : any ) => Promise < any > ;
@@ -731,7 +731,8 @@ export class Langbase {
731731 run : this . runAgent . bind ( this ) ,
732732 } ;
733733
734- this . workflow = config => new Workflow ( { ...config , langbase : this } ) ;
734+ this . workflow = ( config = { } ) =>
735+ new Workflow ( { ...config , langbase : this } ) ;
735736
736737 this . traces = {
737738 create : this . createTrace . bind ( this ) ,
Original file line number Diff line number Diff line change @@ -131,10 +131,11 @@ export class Workflow {
131131
132132 // Notify collector if traceId was found
133133 if ( traceId && _global . _activeTraceCollector ) {
134- if ( debug )
134+ if ( debug ) {
135135 console . log (
136136 `🔍 Trace ID extracted: ${ traceId } ` ,
137137 ) ;
138+ }
138139 _global . _activeTraceCollector ( traceId ) ;
139140 }
140141 }
@@ -391,7 +392,9 @@ export class Workflow {
391392 if ( ! this . langbase || ! this . traceManager || ! this . traceId ) return ;
392393 // Finalise and grab the trace
393394 this . traceManager . endTrace ( this . traceId ) ;
394- this . traceManager . printTrace ( this . traceId ) ;
395+ if ( this . debug ) {
396+ this . traceManager . printTrace ( this . traceId ) ;
397+ }
395398 const traceData = this . traceManager . getTrace ( this . traceId ) ;
396399
397400 // --- send to LB API v1/traces/create using SDK method ---
You can’t perform that action at this time.
0 commit comments