@eva-llm/eva-judge 1.0.6 → 1.0.8
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/dst/config.d.ts +1 -1
- package/dst/config.js +5 -7
- package/dst/config.js.map +1 -1
- package/dst/index.d.ts +4 -4
- package/dst/index.js +36 -82
- package/dst/index.js.map +1 -1
- package/dst/prompt.js +6 -9
- package/dst/prompt.js.map +1 -1
- package/dst/registry.js +31 -73
- package/dst/registry.js.map +1 -1
- package/dst/types.js +10 -13
- package/dst/types.js.map +1 -1
- package/package.json +25 -18
package/dst/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LRUCache } from 'lru-cache';
|
|
2
2
|
import { type LanguageModel } from 'ai';
|
|
3
|
-
import { type IJudgeHooks, type IStepsCache } from './types';
|
|
3
|
+
import { type IJudgeHooks, type IStepsCache } from './types.js';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
gevalMaxScore: number;
|
|
6
6
|
isModelCached: boolean;
|
package/dst/config.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lru_cache_1 = require("lru-cache");
|
|
1
|
+
import { LRUCache, } from 'lru-cache';
|
|
4
2
|
class StepsMemoryAdapter {
|
|
5
3
|
cache;
|
|
6
4
|
constructor(size) {
|
|
7
|
-
this.cache = new
|
|
5
|
+
this.cache = new LRUCache({ max: size });
|
|
8
6
|
}
|
|
9
7
|
async set(key, value) {
|
|
10
8
|
this.cache.set(key, value);
|
|
@@ -13,14 +11,14 @@ class StepsMemoryAdapter {
|
|
|
13
11
|
return this.cache.get(key);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
export default {
|
|
17
15
|
gevalMaxScore: 10,
|
|
18
16
|
isModelCached: true,
|
|
19
17
|
isStepsCached: true,
|
|
20
|
-
modelCache: new
|
|
18
|
+
modelCache: new LRUCache({ max: 100 }),
|
|
21
19
|
stepsCache: new StepsMemoryAdapter(500),
|
|
22
20
|
restartModelCache(size = 100) {
|
|
23
|
-
this.modelCache = new
|
|
21
|
+
this.modelCache = new LRUCache({ max: size });
|
|
24
22
|
},
|
|
25
23
|
restartStepsCache(size = 500) {
|
|
26
24
|
this.stepsCache = new StepsMemoryAdapter(size);
|
package/dst/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GACT,MAAM,WAAW,CAAC;AAcnB,MAAM,kBAAkB;IACd,KAAK,CAA6B;IAM1C,YAAY,IAAY;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAMD,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAe;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAMD,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF;AAOD,eAAe;IAIb,aAAa,EAAE,EAAE;IAIjB,aAAa,EAAE,IAAI;IAInB,aAAa,EAAE,IAAI;IAInB,UAAU,EAAE,IAAI,QAAQ,CAAwB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAI7D,UAAU,EAAE,IAAI,kBAAkB,CAAC,GAAG,CAAgB;IAKtD,iBAAiB,CAAC,OAAe,GAAG;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,QAAQ,CAAwB,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IACvE,CAAC;IAKD,iBAAiB,CAAC,OAAe,GAAG;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAgB,CAAC;IAChE,CAAC;IAKD,aAAa,CAAC,KAAkB;QAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAID,gBAAgB;QACd,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAID,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAID,gBAAgB;QACd,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAID,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAID,KAAK,EAAE,EAAiB;IAKxB,QAAQ,CAAC,KAAkB;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF,CAAC"}
|
package/dst/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type TVercelOptions, type TGevalInput, type TRubricResult, type TGevalEvaluateResult } from './types';
|
|
2
|
-
export * from './config';
|
|
3
|
-
export { default } from './config';
|
|
4
|
-
export * from './types';
|
|
1
|
+
import { type TVercelOptions, type TGevalInput, type TRubricResult, type TGevalEvaluateResult } from './types.js';
|
|
2
|
+
export * from './config.js';
|
|
3
|
+
export { default } from './config.js';
|
|
4
|
+
export * from './types.js';
|
|
5
5
|
export declare const llmRubric: (output: string, rubric: string, providerName: string, modelName: string, options?: TVercelOptions) => Promise<TRubricResult>;
|
|
6
6
|
export declare const gEval: (input: TGevalInput, criteria: string, providerName: string, modelName: string, options?: TVercelOptions) => Promise<TGevalEvaluateResult>;
|
|
7
7
|
export declare const bEval: (input: TGevalInput, criteria: string, providerName: string, modelName: string, options?: TVercelOptions) => Promise<TGevalEvaluateResult>;
|
package/dst/index.js
CHANGED
|
@@ -1,73 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.bEval = exports.gEval = exports.llmRubric = exports.default = void 0;
|
|
43
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
44
|
-
const Mustache = __importStar(require("mustache"));
|
|
45
|
-
const ai_1 = require("ai");
|
|
46
|
-
const config_1 = __importDefault(require("./config"));
|
|
47
|
-
const prompt_1 = require("./prompt");
|
|
48
|
-
const registry_1 = require("./registry");
|
|
49
|
-
const types_1 = require("./types");
|
|
50
|
-
__exportStar(require("./config"), exports);
|
|
51
|
-
var config_2 = require("./config");
|
|
52
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(config_2).default; } });
|
|
53
|
-
__exportStar(require("./types"), exports);
|
|
54
|
-
const getHashId = () => node_crypto_1.default.randomBytes(16).toString('hex');
|
|
55
|
-
const llmRubric = async (output, rubric, providerName, modelName, options = {}) => {
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import Mustache from 'mustache';
|
|
3
|
+
import { generateText, Output, } from 'ai';
|
|
4
|
+
import CONF from './config.js';
|
|
5
|
+
import { GEVAL_EVALUATE_PROMPT, GEVAL_EVALUATE_REPLY_PROMPT, GEVAL_STEPS_PROMPT, GEVAL_SYSTEM_PROMPT, LLM_RUBRIC_SYSTEM_PROMPT, LLM_RUBRIC_USER_PROMPT, } from './prompt.js';
|
|
6
|
+
import { getModel, getSteps, setSteps, } from './registry.js';
|
|
7
|
+
import { RubricResultSchema, GevalStepsResultSchema, GevalEvaluateResultSchema, } from './types.js';
|
|
8
|
+
export * from './config.js';
|
|
9
|
+
export { default } from './config.js';
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
const getHashId = () => crypto.randomBytes(16).toString('hex');
|
|
12
|
+
export const llmRubric = async (output, rubric, providerName, modelName, options = {}) => {
|
|
56
13
|
const start = Date.now();
|
|
57
14
|
try {
|
|
58
|
-
const userPrompt = Mustache.render(
|
|
59
|
-
const { output: result } = await
|
|
15
|
+
const userPrompt = Mustache.render(LLM_RUBRIC_USER_PROMPT, { output, rubric });
|
|
16
|
+
const { output: result } = await generateText({
|
|
60
17
|
...options,
|
|
61
18
|
messages: undefined,
|
|
62
19
|
tools: undefined,
|
|
63
|
-
model:
|
|
64
|
-
system: Mustache.render(
|
|
20
|
+
model: getModel(providerName, modelName),
|
|
21
|
+
system: Mustache.render(LLM_RUBRIC_SYSTEM_PROMPT, { hash_id: getHashId() }),
|
|
65
22
|
prompt: userPrompt,
|
|
66
|
-
output:
|
|
67
|
-
schema:
|
|
23
|
+
output: Output.object({
|
|
24
|
+
schema: RubricResultSchema,
|
|
68
25
|
}),
|
|
69
26
|
});
|
|
70
|
-
|
|
27
|
+
CONF.hooks.onSuccess?.({
|
|
71
28
|
method: 'llmRubric',
|
|
72
29
|
params: { output, rubric, providerName, modelName, options },
|
|
73
30
|
result,
|
|
@@ -76,7 +33,7 @@ const llmRubric = async (output, rubric, providerName, modelName, options = {})
|
|
|
76
33
|
return result;
|
|
77
34
|
}
|
|
78
35
|
catch (error) {
|
|
79
|
-
|
|
36
|
+
CONF.hooks.onError?.({
|
|
80
37
|
method: 'llmRubric',
|
|
81
38
|
error,
|
|
82
39
|
duration: Date.now() - start,
|
|
@@ -84,7 +41,6 @@ const llmRubric = async (output, rubric, providerName, modelName, options = {})
|
|
|
84
41
|
throw error;
|
|
85
42
|
}
|
|
86
43
|
};
|
|
87
|
-
exports.llmRubric = llmRubric;
|
|
88
44
|
const _gEval = async (input, criteria, providerName, modelName, maxScore, methodName, options = {}) => {
|
|
89
45
|
if (typeof input === 'string') {
|
|
90
46
|
input = { query: '', answer: input };
|
|
@@ -92,40 +48,40 @@ const _gEval = async (input, criteria, providerName, modelName, maxScore, method
|
|
|
92
48
|
const { query, answer } = input;
|
|
93
49
|
const start = Date.now();
|
|
94
50
|
try {
|
|
95
|
-
const model =
|
|
96
|
-
let steps = await
|
|
51
|
+
const model = getModel(providerName, modelName);
|
|
52
|
+
let steps = await getSteps(criteria);
|
|
97
53
|
if (!steps) {
|
|
98
|
-
const stepsPrompt = Mustache.render(
|
|
99
|
-
const { output: stepsResult } = await
|
|
54
|
+
const stepsPrompt = Mustache.render(GEVAL_STEPS_PROMPT, { criteria });
|
|
55
|
+
const { output: stepsResult } = await generateText({
|
|
100
56
|
...options,
|
|
101
57
|
system: undefined,
|
|
102
58
|
messages: undefined,
|
|
103
59
|
tools: undefined,
|
|
104
60
|
model,
|
|
105
61
|
prompt: stepsPrompt,
|
|
106
|
-
output:
|
|
107
|
-
schema:
|
|
62
|
+
output: Output.object({
|
|
63
|
+
schema: GevalStepsResultSchema,
|
|
108
64
|
}),
|
|
109
65
|
});
|
|
110
66
|
steps = stepsResult.steps;
|
|
111
|
-
|
|
67
|
+
setSteps(criteria, stepsResult.steps);
|
|
112
68
|
}
|
|
113
|
-
const evaluationPrompt = Mustache.render(query ?
|
|
69
|
+
const evaluationPrompt = Mustache.render(query ? GEVAL_EVALUATE_PROMPT : GEVAL_EVALUATE_REPLY_PROMPT, {
|
|
114
70
|
criteria,
|
|
115
71
|
steps: steps.join('\n- '),
|
|
116
72
|
input: query,
|
|
117
73
|
output: answer,
|
|
118
74
|
maxScore,
|
|
119
75
|
});
|
|
120
|
-
const { output: evalResult } = await
|
|
76
|
+
const { output: evalResult } = await generateText({
|
|
121
77
|
...options,
|
|
122
78
|
messages: undefined,
|
|
123
79
|
tools: undefined,
|
|
124
80
|
model,
|
|
125
|
-
system: Mustache.render(
|
|
81
|
+
system: Mustache.render(GEVAL_SYSTEM_PROMPT, { hash_id: getHashId() }),
|
|
126
82
|
prompt: evaluationPrompt,
|
|
127
|
-
output:
|
|
128
|
-
schema:
|
|
83
|
+
output: Output.object({
|
|
84
|
+
schema: GevalEvaluateResultSchema,
|
|
129
85
|
}),
|
|
130
86
|
...options,
|
|
131
87
|
});
|
|
@@ -133,7 +89,7 @@ const _gEval = async (input, criteria, providerName, modelName, maxScore, method
|
|
|
133
89
|
reason: evalResult.reason,
|
|
134
90
|
score: evalResult.score / maxScore,
|
|
135
91
|
};
|
|
136
|
-
|
|
92
|
+
CONF.hooks.onSuccess?.({
|
|
137
93
|
method: methodName,
|
|
138
94
|
params: { query, answer, criteria, providerName, modelName, options },
|
|
139
95
|
result,
|
|
@@ -142,7 +98,7 @@ const _gEval = async (input, criteria, providerName, modelName, maxScore, method
|
|
|
142
98
|
return result;
|
|
143
99
|
}
|
|
144
100
|
catch (error) {
|
|
145
|
-
|
|
101
|
+
CONF.hooks.onError?.({
|
|
146
102
|
method: methodName,
|
|
147
103
|
error,
|
|
148
104
|
duration: Date.now() - start,
|
|
@@ -150,8 +106,6 @@ const _gEval = async (input, criteria, providerName, modelName, maxScore, method
|
|
|
150
106
|
throw error;
|
|
151
107
|
}
|
|
152
108
|
};
|
|
153
|
-
const gEval = async (input, criteria, providerName, modelName, options = {}) => _gEval(input, criteria, providerName, modelName,
|
|
154
|
-
|
|
155
|
-
const bEval = async (input, criteria, providerName, modelName, options = {}) => _gEval(input, criteria, providerName, modelName, 1, 'bEval', options);
|
|
156
|
-
exports.bEval = bEval;
|
|
109
|
+
export const gEval = async (input, criteria, providerName, modelName, options = {}) => _gEval(input, criteria, providerName, modelName, CONF.gevalMaxScore, 'gEval', options);
|
|
110
|
+
export const bEval = async (input, criteria, providerName, modelName, options = {}) => _gEval(input, criteria, providerName, modelName, 1, 'bEval', options);
|
|
157
111
|
//# sourceMappingURL=index.js.map
|
package/dst/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,MAAM,GACP,MAAM,IAAI,CAAC;AAEZ,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,eAAe,CA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AK,EAAE,CAAC;QAEf,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,EAAE,UAAU;YAClB,KAAK;YACL,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;SAC7B,CAAC,CAAC;QAEH,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA;AAYD,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EACxB,KAAkB,EAClB,QAAgB,EAChB,YAAoB,EACpB,SAAiB,EACjB,UAA0B,EAAE,EACG,EAAE,CAAC,MAAM,CACxC,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,IAAI,CAAC,aAAa,EAClB,OAAO,EACP,OAAO,CACR,CAAC;AAYF,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EACxB,KAAkB,EAClB,QAAgB,EAChB,YAAoB,EACpB,SAAiB,EACjB,UAA0B,EAAE,EACG,EAAE,CAAC,MAAM,CACxC,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,CAAC,EACD,OAAO,EACP,OAAO,CACR,CAAC"}
|
package/dst/prompt.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*!
|
|
3
2
|
* Portions of this code are based on Promptfoo (MIT License)
|
|
4
3
|
* Copyright (c) 2025 Promptfoo
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
exports.GEVAL_EVALUATE_PROMPT = exports.GEVAL_EVALUATE_REPLY_PROMPT = exports.GEVAL_STEPS_PROMPT = exports.GEVAL_SYSTEM_PROMPT = exports.LLM_RUBRIC_USER_PROMPT = exports.LLM_RUBRIC_SYSTEM_PROMPT = void 0;
|
|
8
|
-
exports.LLM_RUBRIC_SYSTEM_PROMPT = `
|
|
5
|
+
export const LLM_RUBRIC_SYSTEM_PROMPT = `
|
|
9
6
|
Instruction #{{hash_id}}.
|
|
10
7
|
|
|
11
8
|
You are grading output according to a user-specified rubric. If the statement in the rubric is true, then the output passes the test. And score 1.0 indicates full compliance with the rubric, but 0.0 indicates no compliance at all. You respond with a JSON object with this structure: {reason: string, pass: boolean, score: number}
|
|
@@ -20,13 +17,13 @@ Examples:
|
|
|
20
17
|
<Rubric>Does not speak like a pirate</Rubric>
|
|
21
18
|
{"reason": "'avast ye' is a common pirate term", "pass": false, "score": 0.0}
|
|
22
19
|
`;
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export const LLM_RUBRIC_USER_PROMPT = '<Output>\n{{output}}\n</Output>\n<Rubric>\n{{rubric}}\n</Rubric>';
|
|
21
|
+
export const GEVAL_SYSTEM_PROMPT = `
|
|
25
22
|
Instruction #{{hash_id}}.
|
|
26
23
|
|
|
27
24
|
You are an impartial Judge. Your role is to perform an independent audit according to provided criteria.
|
|
28
25
|
`;
|
|
29
|
-
|
|
26
|
+
export const GEVAL_STEPS_PROMPT = `
|
|
30
27
|
Given an evaluation criteria which outlines how you should judge a piece of text, generate 3-4 concise evaluation steps applicable to any text based on the criteria below and designed to confirm the criteria.
|
|
31
28
|
|
|
32
29
|
**EVALUATION CRITERIA**
|
|
@@ -50,7 +47,7 @@ Example:
|
|
|
50
47
|
Here are the 3-4 concise evaluation steps, formatted as required in a minified JSON:
|
|
51
48
|
JSON:
|
|
52
49
|
`;
|
|
53
|
-
|
|
50
|
+
export const GEVAL_EVALUATE_REPLY_PROMPT = `
|
|
54
51
|
You will be given one Reply below. Your task is to rate the Reply on one metric.
|
|
55
52
|
Please make sure you read and understand these instructions carefully. Please keep this document open while reviewing, and refer to it as needed.
|
|
56
53
|
|
|
@@ -83,7 +80,7 @@ Example JSON:
|
|
|
83
80
|
Here is the final evaluation in the required minified JSON format:
|
|
84
81
|
JSON:
|
|
85
82
|
`;
|
|
86
|
-
|
|
83
|
+
export const GEVAL_EVALUATE_PROMPT = `
|
|
87
84
|
You will be given one Reply for a Prompt below. Your task is to rate the Reply on one metric.
|
|
88
85
|
Please make sure you read and understand these instructions carefully. Please keep this document open while reviewing, and refer to it as needed.
|
|
89
86
|
|
package/dst/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;CAcvC,CAAC;AAKF,MAAM,CAAC,MAAM,sBAAsB,GAAG,kEAAkE,CAAC;AAEzG,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;CAIlC,CAAC;AAKF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBjC,CAAC;AAKF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC1C,CAAC;AAKF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCpC,CAAC"}
|
package/dst/registry.js
CHANGED
|
@@ -1,94 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.setSteps = exports.getSteps = exports.getModel = void 0;
|
|
40
|
-
const crypto = __importStar(require("node:crypto"));
|
|
41
|
-
const openai_1 = require("@ai-sdk/openai");
|
|
42
|
-
const anthropic_1 = require("@ai-sdk/anthropic");
|
|
43
|
-
const google_1 = require("@ai-sdk/google");
|
|
44
|
-
const mistral_1 = require("@ai-sdk/mistral");
|
|
45
|
-
const amazon_bedrock_1 = require("@ai-sdk/amazon-bedrock");
|
|
46
|
-
const azure_1 = require("@ai-sdk/azure");
|
|
47
|
-
const deepseek_1 = require("@ai-sdk/deepseek");
|
|
48
|
-
const groq_1 = require("@ai-sdk/groq");
|
|
49
|
-
const perplexity_1 = require("@ai-sdk/perplexity");
|
|
50
|
-
const xai_1 = require("@ai-sdk/xai");
|
|
51
|
-
const config_1 = __importDefault(require("./config"));
|
|
1
|
+
import * as crypto from 'node:crypto';
|
|
2
|
+
import { openai, } from '@ai-sdk/openai';
|
|
3
|
+
import { anthropic, } from '@ai-sdk/anthropic';
|
|
4
|
+
import { google, } from '@ai-sdk/google';
|
|
5
|
+
import { mistral, } from '@ai-sdk/mistral';
|
|
6
|
+
import { bedrock, } from '@ai-sdk/amazon-bedrock';
|
|
7
|
+
import { azure, } from '@ai-sdk/azure';
|
|
8
|
+
import { deepseek, } from '@ai-sdk/deepseek';
|
|
9
|
+
import { groq, } from '@ai-sdk/groq';
|
|
10
|
+
import { perplexity, } from '@ai-sdk/perplexity';
|
|
11
|
+
import { xai, } from '@ai-sdk/xai';
|
|
12
|
+
import CONF from './config.js';
|
|
52
13
|
const PROVIDERS = {
|
|
53
|
-
openai
|
|
54
|
-
anthropic
|
|
55
|
-
google
|
|
56
|
-
mistral
|
|
57
|
-
bedrock
|
|
58
|
-
azure
|
|
59
|
-
deepseek
|
|
60
|
-
groq
|
|
61
|
-
perplexity
|
|
62
|
-
xai
|
|
14
|
+
openai,
|
|
15
|
+
anthropic,
|
|
16
|
+
google,
|
|
17
|
+
mistral,
|
|
18
|
+
bedrock,
|
|
19
|
+
azure,
|
|
20
|
+
deepseek,
|
|
21
|
+
groq,
|
|
22
|
+
perplexity,
|
|
23
|
+
xai,
|
|
63
24
|
};
|
|
64
|
-
const getModel = (providerName, modelName) => {
|
|
25
|
+
export const getModel = (providerName, modelName) => {
|
|
65
26
|
const cacheKey = `${providerName}:${modelName}`;
|
|
66
|
-
let model =
|
|
27
|
+
let model = CONF.isModelCached ? CONF.modelCache.get(cacheKey) : undefined;
|
|
67
28
|
if (!model) {
|
|
68
29
|
const provider = PROVIDERS[providerName];
|
|
69
30
|
if (!provider) {
|
|
70
31
|
throw new Error(`Unknown provider: "${providerName}". Available providers: ${Object.keys(PROVIDERS).join(', ')}`);
|
|
71
32
|
}
|
|
72
33
|
model = provider(modelName);
|
|
73
|
-
if (
|
|
74
|
-
|
|
34
|
+
if (CONF.isModelCached) {
|
|
35
|
+
CONF.modelCache.set(cacheKey, model);
|
|
75
36
|
}
|
|
76
37
|
}
|
|
77
38
|
return model;
|
|
78
39
|
};
|
|
79
|
-
exports.getModel = getModel;
|
|
80
40
|
const md5 = (str) => {
|
|
81
41
|
return crypto.createHash('md5').update(str).digest('hex');
|
|
82
42
|
};
|
|
83
|
-
const getSteps = (criteria) => {
|
|
84
|
-
return
|
|
43
|
+
export const getSteps = (criteria) => {
|
|
44
|
+
return CONF.isStepsCached ? CONF.stepsCache.get(md5(criteria)) : Promise.resolve(undefined);
|
|
85
45
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return config_1.default.stepsCache.set(md5(criteria), steps);
|
|
46
|
+
export const setSteps = (criteria, steps) => {
|
|
47
|
+
if (CONF.isStepsCached) {
|
|
48
|
+
return CONF.stepsCache.set(md5(criteria), steps);
|
|
90
49
|
}
|
|
91
50
|
return Promise.resolve();
|
|
92
51
|
};
|
|
93
|
-
exports.setSteps = setSteps;
|
|
94
52
|
//# sourceMappingURL=registry.js.map
|
package/dst/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAItC,OAAO,EACL,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,OAAO,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,OAAO,GACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,GACN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,GAAG,GACJ,MAAM,aAAa,CAAC;AAErB,OAAO,IAAI,MAAM,aAAa,CAAC;AAM/B,MAAM,SAAS,GAA6B;IAC1C,MAAM;IACN,SAAS;IACT,MAAM;IACN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C,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC9F,CAAC,CAAA;AAQD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,KAAe,EAAiB,EAAE;IAC3E,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC,CAAA"}
|
package/dst/types.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
reason: zod_1.z.string().describe('Detailed explanation of the score based on the rubric'),
|
|
7
|
-
pass: zod_1.z.boolean().describe('Whether the output satisfies the minimum requirements'),
|
|
8
|
-
score: zod_1.z.number().min(0).max(1).describe('Numeric representation of quality'),
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const RubricResultSchema = z.object({
|
|
3
|
+
reason: z.string().describe('Detailed explanation of the score based on the rubric'),
|
|
4
|
+
pass: z.boolean().describe('Whether the output satisfies the minimum requirements'),
|
|
5
|
+
score: z.number().min(0).max(1).describe('Numeric representation of quality'),
|
|
9
6
|
});
|
|
10
|
-
|
|
11
|
-
steps:
|
|
7
|
+
export const GevalStepsResultSchema = z.object({
|
|
8
|
+
steps: z.array(z.string()).describe('List of concise evaluation steps derived from the criteria'),
|
|
12
9
|
});
|
|
13
|
-
|
|
14
|
-
reason:
|
|
15
|
-
score:
|
|
10
|
+
export const GevalEvaluateResultSchema = z.object({
|
|
11
|
+
reason: z.string().describe('Detailed explanation of the score based on the rubric'),
|
|
12
|
+
score: z.number().min(0).describe('Numeric representation of quality'),
|
|
16
13
|
});
|
|
17
14
|
//# sourceMappingURL=types.js.map
|
package/dst/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+DxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAEzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAEpF,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAEnF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CAC9E,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAE7C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,4DAA4D,CAAC;CAClG,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAEhD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAEpF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CACvE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva-llm/eva-judge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "LLM-as-a-Judge abstraction layer using ai-sdk and plugins",
|
|
5
5
|
"main": "dst/index.js",
|
|
6
6
|
"types": "dst/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"engines": {
|
|
8
9
|
"node": ">=22"
|
|
9
10
|
},
|
|
@@ -21,33 +22,39 @@
|
|
|
21
22
|
},
|
|
22
23
|
"homepage": "https://eva-llm.github.io/eva-judge",
|
|
23
24
|
"devDependencies": {
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
24
26
|
"@types/jest": "^30.0.0",
|
|
25
27
|
"@types/mustache": "^4.2.6",
|
|
26
|
-
"@types/node": "^
|
|
27
|
-
"
|
|
28
|
-
"
|
|
28
|
+
"@types/node": "^26.0.1",
|
|
29
|
+
"eslint": "^10.5.0",
|
|
30
|
+
"husky": "^9.1.7",
|
|
31
|
+
"jest": "^30.4.2",
|
|
32
|
+
"ts-jest": "^29.4.11",
|
|
29
33
|
"ts-node": "^10.9.2",
|
|
30
|
-
"typescript": "^
|
|
34
|
+
"typescript": "^6.0.3",
|
|
35
|
+
"typescript-eslint": "^8.62.0"
|
|
31
36
|
},
|
|
32
37
|
"dependencies": {
|
|
33
|
-
"@ai-sdk/amazon-bedrock": "^
|
|
34
|
-
"@ai-sdk/anthropic": "^
|
|
35
|
-
"@ai-sdk/azure": "^
|
|
36
|
-
"@ai-sdk/deepseek": "^
|
|
37
|
-
"@ai-sdk/google": "^
|
|
38
|
-
"@ai-sdk/groq": "^
|
|
39
|
-
"@ai-sdk/mistral": "^
|
|
40
|
-
"@ai-sdk/openai": "^
|
|
41
|
-
"@ai-sdk/perplexity": "^
|
|
42
|
-
"@ai-sdk/xai": "^
|
|
43
|
-
"ai": "^
|
|
44
|
-
"lru-cache": "^11.
|
|
38
|
+
"@ai-sdk/amazon-bedrock": "^5.0.0",
|
|
39
|
+
"@ai-sdk/anthropic": "^4.0.0",
|
|
40
|
+
"@ai-sdk/azure": "^4.0.0",
|
|
41
|
+
"@ai-sdk/deepseek": "^3.0.0",
|
|
42
|
+
"@ai-sdk/google": "^4.0.0",
|
|
43
|
+
"@ai-sdk/groq": "^4.0.0",
|
|
44
|
+
"@ai-sdk/mistral": "^4.0.0",
|
|
45
|
+
"@ai-sdk/openai": "^4.0.0",
|
|
46
|
+
"@ai-sdk/perplexity": "^4.0.0",
|
|
47
|
+
"@ai-sdk/xai": "^4.0.0",
|
|
48
|
+
"ai": "^7.0.0",
|
|
49
|
+
"lru-cache": "^11.5.1",
|
|
45
50
|
"mustache": "^4.2.0",
|
|
46
|
-
"zod": "^4.3
|
|
51
|
+
"zod": "^4.4.3"
|
|
47
52
|
},
|
|
48
53
|
"scripts": {
|
|
49
54
|
"build": "tsc",
|
|
50
55
|
"example": "ts-node scripts/example.ts",
|
|
56
|
+
"lint": "eslint src",
|
|
57
|
+
"lint:fix": "eslint src --fix",
|
|
51
58
|
"test": "jest",
|
|
52
59
|
"test:coverage": "jest --coverage"
|
|
53
60
|
}
|