@@ -54,7 +54,7 @@ export abstract class Tracer {
5454 this . apiClient = new JudgmentApiClient (
5555 this . configuration . apiUrl ,
5656 this . configuration . apiKey ,
57- this . configuration . organizationId
57+ this . configuration . organizationId ,
5858 ) ;
5959
6060 this . _initialized = false ;
@@ -65,7 +65,7 @@ export abstract class Tracer {
6565 private async resolveProjectId ( ) : Promise < string > {
6666 try {
6767 Logger . info (
68- `Resolving project ID for project: ${ this . configuration . projectName } `
68+ `Resolving project ID for project: ${ this . configuration . projectName } ` ,
6969 ) ;
7070
7171 const response = await this . apiClient . projectsResolve ( {
@@ -76,7 +76,7 @@ export abstract class Tracer {
7676
7777 if ( ! resolvedProjectId ) {
7878 throw new Error (
79- `Project ID not found for project: ${ this . configuration . projectName } `
79+ `Project ID not found for project: ${ this . configuration . projectName } ` ,
8080 ) ;
8181 }
8282
@@ -86,15 +86,15 @@ export abstract class Tracer {
8686 return this . projectId ;
8787 } catch ( error ) {
8888 throw new Error (
89- `Failed to resolve project ID: ${ error instanceof Error ? error . message : String ( error ) } `
89+ `Failed to resolve project ID: ${ error instanceof Error ? error . message : String ( error ) } ` ,
9090 ) ;
9191 }
9292 }
9393
9494 public static getExporter (
9595 apiKey : string ,
9696 organizationId : string ,
97- projectId : string
97+ projectId : string ,
9898 ) : JudgmentSpanExporter {
9999 const endpoint = JUDGMENT_API_URL ?. endsWith ( "/" )
100100 ? `${ JUDGMENT_API_URL } otel/v1/traces`
@@ -120,7 +120,7 @@ export abstract class Tracer {
120120 this . configuration . projectName +
121121 ", please create it first at https://app.judgmentlabs.ai/org/" +
122122 ( this . configuration . organizationId || "unknown" ) +
123- "/projects. Skipping Judgment export."
123+ "/projects. Skipping Judgment export." ,
124124 ) ;
125125 return new NoOpSpanExporter ( ) ;
126126 }
@@ -135,7 +135,7 @@ export abstract class Tracer {
135135 if ( kind !== null ) {
136136 currentSpan . setAttribute (
137137 OpenTelemetryKeys . AttributeKeys . JUDGMENT_SPAN_KIND ,
138- kind
138+ kind ,
139139 ) ;
140140 }
141141 }
@@ -186,7 +186,7 @@ export abstract class Tracer {
186186 public asyncEvaluate (
187187 scorer : BaseScorer ,
188188 example : ExampleModel ,
189- model ?: string
189+ model ?: string ,
190190 ) : void {
191191 if ( ! this . _initialized ) {
192192 Logger . warn ( "Tracer not initialized, skipping asyncEvaluate" ) ;
@@ -212,15 +212,15 @@ export abstract class Tracer {
212212 const spanId = spanContext . spanId ;
213213
214214 Logger . info (
215- `asyncEvaluate: project=${ this . configuration . projectName } , traceId=${ traceId } , spanId=${ spanId } , scorer=${ scorer . name } `
215+ `asyncEvaluate: project=${ this . configuration . projectName } , traceId=${ traceId } , spanId=${ spanId } , scorer=${ scorer . name } ` ,
216216 ) ;
217217
218218 const evaluationRun = this . createEvaluationRun (
219219 scorer ,
220220 example ,
221221 model ,
222222 traceId ,
223- spanId
223+ spanId ,
224224 ) ;
225225 this . enqueueEvaluation ( evaluationRun ) ;
226226 }
@@ -250,24 +250,24 @@ export abstract class Tracer {
250250 const spanId = spanContext . spanId ;
251251
252252 Logger . info (
253- `asyncTraceEvaluate: project=${ this . configuration . projectName } , traceId=${ traceId } , spanId=${ spanId } , scorer=${ scorer . name } `
253+ `asyncTraceEvaluate: project=${ this . configuration . projectName } , traceId=${ traceId } , spanId=${ spanId } , scorer=${ scorer . name } ` ,
254254 ) ;
255255
256256 try {
257257 const traceEvaluationRun = this . createTraceEvaluationRun (
258258 scorer ,
259259 model ,
260260 traceId ,
261- spanId
261+ spanId ,
262262 ) ;
263263 const traceEvalJson = this . serializer ( traceEvaluationRun ) ;
264264 currentSpan . setAttribute (
265265 OpenTelemetryKeys . AttributeKeys . PENDING_TRACE_EVAL ,
266- traceEvalJson
266+ traceEvalJson ,
267267 ) ;
268268 } catch ( error ) {
269269 Logger . error (
270- `Failed to serialize trace evaluation: ${ error instanceof Error ? error . message : String ( error ) } `
270+ `Failed to serialize trace evaluation: ${ error instanceof Error ? error . message : String ( error ) } ` ,
271271 ) ;
272272 }
273273 }
@@ -276,7 +276,7 @@ export abstract class Tracer {
276276 scorer : BaseScorer ,
277277 model : string | undefined ,
278278 traceId : string ,
279- spanId : string
279+ spanId : string ,
280280 ) : Record < string , unknown > {
281281 const evalName = `async_trace_evaluate_${ spanId || Date . now ( ) } ` ;
282282 const modelName = model || JUDGMENT_DEFAULT_GPT_MODEL ;
@@ -312,7 +312,7 @@ export abstract class Tracer {
312312 example : ExampleModel ,
313313 model : string | undefined ,
314314 traceId : string ,
315- spanId : string
315+ spanId : string ,
316316 ) : ExampleEvaluationRun {
317317 const runId = `async_evaluate_${ spanId || Date . now ( ) } ` ;
318318 const modelName = model || JUDGMENT_DEFAULT_GPT_MODEL ;
@@ -334,7 +334,7 @@ export abstract class Tracer {
334334 }
335335
336336 private async enqueueEvaluation (
337- evaluationRun : ExampleEvaluationRun
337+ evaluationRun : ExampleEvaluationRun ,
338338 ) : Promise < void > {
339339 if ( ! this . apiClient ) {
340340 Logger . warn ( "API client not available, skipping evaluation enqueue" ) ;
@@ -346,14 +346,14 @@ export abstract class Tracer {
346346 Logger . info ( `Enqueuing evaluation run: ${ evaluationRun . eval_name } ` ) ;
347347 } catch ( error ) {
348348 Logger . error (
349- `Failed to enqueue evaluation run: ${ error instanceof Error ? error . message : String ( error ) } `
349+ `Failed to enqueue evaluation run: ${ error instanceof Error ? error . message : String ( error ) } ` ,
350350 ) ;
351351 }
352352 }
353353
354354 public observe < TArgs extends any [ ] , TResult > (
355355 func : ( ...args : TArgs ) => TResult ,
356- spanKind : SpanKind = "span"
356+ spanKind : SpanKind = "span" ,
357357 ) : ( ...args : TArgs ) => TResult {
358358 return ( ...args : TArgs ) => {
359359 const currentSpan = trace . getActiveSpan ( ) ;
@@ -373,7 +373,7 @@ export abstract class Tracer {
373373 try {
374374 span . setAttribute (
375375 OpenTelemetryKeys . AttributeKeys . JUDGMENT_SPAN_KIND ,
376- spanKind
376+ spanKind ,
377377 ) ;
378378
379379 const argNames = parseFunctionArgs ( func ) ;
@@ -384,7 +384,7 @@ export abstract class Tracer {
384384 } ) ;
385385 span . setAttribute (
386386 OpenTelemetryKeys . AttributeKeys . JUDGMENT_INPUT ,
387- this . serializer ( inputObj )
387+ this . serializer ( inputObj ) ,
388388 ) ;
389389 }
390390
@@ -395,7 +395,7 @@ export abstract class Tracer {
395395 . then ( ( res ) => {
396396 span . setAttribute (
397397 OpenTelemetryKeys . AttributeKeys . JUDGMENT_OUTPUT ,
398- this . serializer ( res )
398+ this . serializer ( res ) ,
399399 ) ;
400400 span . end ( ) ;
401401 return res ;
@@ -408,7 +408,7 @@ export abstract class Tracer {
408408 } else {
409409 span . setAttribute (
410410 OpenTelemetryKeys . AttributeKeys . JUDGMENT_OUTPUT ,
411- this . serializer ( result )
411+ this . serializer ( result ) ,
412412 ) ;
413413 span . end ( ) ;
414414 return result ;
@@ -418,7 +418,7 @@ export abstract class Tracer {
418418 span . end ( ) ;
419419 throw err ;
420420 }
421- }
421+ } ,
422422 ) ;
423423 } ) ;
424424 } ;
0 commit comments