@mastra/evals 0.1.0-alpha.47 → 0.1.0-alpha.49

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/evals
2
2
 
3
+ ## 0.1.0-alpha.49
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [66a5392]
8
+ - @mastra/core@0.2.0-alpha.107
9
+
10
+ ## 0.1.0-alpha.48
11
+
12
+ ### Patch Changes
13
+
14
+ - a8a459a: Updated Evals table UI
15
+ - Updated dependencies [6f2c0f5]
16
+ - Updated dependencies [a8a459a]
17
+ - @mastra/core@0.2.0-alpha.106
18
+
3
19
  ## 0.1.0-alpha.47
4
20
 
5
21
  ### Patch Changes
@@ -1251,7 +1251,7 @@ var ToxicityJudge = class extends MastraAgentJudge {
1251
1251
  reason: z.string()
1252
1252
  })
1253
1253
  });
1254
- return result.object;
1254
+ return result.object.reason;
1255
1255
  }
1256
1256
  };
1257
1257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/evals",
3
- "version": "0.1.0-alpha.47",
3
+ "version": "0.1.0-alpha.49",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "sentiment": "^5.0.2",
38
38
  "string-similarity": "^4.0.4",
39
39
  "zod": "^3.24.1",
40
- "@mastra/core": "^0.2.0-alpha.105"
40
+ "@mastra/core": "^0.2.0-alpha.107"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "ai": "^4.0.0"
@@ -1,7 +1,7 @@
1
1
  import { createOpenAI } from '@ai-sdk/openai';
2
2
  import { describe, it, expect } from 'vitest';
3
3
 
4
- import { TestCaseWithContext } from '../utils';
4
+ import { isCloserTo, TestCaseWithContext } from '../utils';
5
5
 
6
6
  import { ContextPositionMetric } from './index';
7
7
 
@@ -184,7 +184,7 @@ describe(
184
184
  context: testCase.context,
185
185
  });
186
186
  const result = await metric.measure(testCase.input, testCase.output);
187
- expect(result.score).toBeCloseTo(testCase.expectedResult.score, 1);
187
+ expect(isCloserTo(result.score, testCase.expectedResult.score, 0.5)).toBe(true);
188
188
  });
189
189
 
190
190
  it('should handle mixed relevance with good ordering', async () => {
@@ -34,6 +34,6 @@ export class ToxicityJudge extends MastraAgentJudge {
34
34
  }),
35
35
  });
36
36
 
37
- return result.object;
37
+ return result.object.reason;
38
38
  }
39
39
  }