@vertana/core 0.1.0-dev.8 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,7 @@ const issueSchema = zod.z.object({
24
24
  }).optional()
25
25
  });
26
26
  const evaluationResultSchema = zod.z.object({
27
- score: zod.z.number().min(0).max(1),
27
+ score: zod.z.number(),
28
28
  issues: zod.z.array(issueSchema)
29
29
  });
30
30
  /**
@@ -106,12 +106,13 @@ async function evaluate(model, original, translated, options) {
106
106
  description: issue.description,
107
107
  location: issue.location
108
108
  }));
109
+ const score = Math.max(0, Math.min(1, result.object.score));
109
110
  logger.debug("Evaluation result: score {score}, {issueCount} issue(s).", {
110
- score: result.object.score,
111
+ score,
111
112
  issueCount: issues.length
112
113
  });
113
114
  return {
114
- score: result.object.score,
115
+ score,
115
116
  issues
116
117
  };
117
118
  }
@@ -23,7 +23,7 @@ const issueSchema = z.object({
23
23
  }).optional()
24
24
  });
25
25
  const evaluationResultSchema = z.object({
26
- score: z.number().min(0).max(1),
26
+ score: z.number(),
27
27
  issues: z.array(issueSchema)
28
28
  });
29
29
  /**
@@ -105,12 +105,13 @@ async function evaluate(model, original, translated, options) {
105
105
  description: issue.description,
106
106
  location: issue.location
107
107
  }));
108
+ const score = Math.max(0, Math.min(1, result.object.score));
108
109
  logger.debug("Evaluation result: score {score}, {issueCount} issue(s).", {
109
- score: result.object.score,
110
+ score,
110
111
  issueCount: issues.length
111
112
  });
112
113
  return {
113
- score: result.object.score,
114
+ score,
114
115
  issues
115
116
  };
116
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertana/core",
3
- "version": "0.1.0-dev.8+2c1883ec",
3
+ "version": "0.1.1",
4
4
  "description": "The core library for Vertana, an LLM-powered natural language translation library",
5
5
  "keywords": [
6
6
  "LLM",