vieval 0.0.7 → 0.0.9
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/README.md +24 -2
- package/dist/bin/vieval.mjs +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/{cli-ImxGpoYQ.mjs → cli-Dao25VxV.mjs} +2 -2
- package/dist/cli-Dao25VxV.mjs.map +1 -0
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/core/assertions/index.d.mts +1 -1
- package/dist/core/inference-executors/index.d.mts +1 -1
- package/dist/core/inference-executors/index.mjs +10 -4
- package/dist/core/inference-executors/index.mjs.map +1 -1
- package/dist/core/processors/results/index.d.mts +1 -1
- package/dist/core/runner/index.d.mts +2 -2
- package/dist/core/runner/index.mjs +6 -40
- package/dist/core/runner/index.mjs.map +1 -1
- package/dist/{env-BeHv_5mo.d.mts → env-DfWZy_n4.d.mts} +14 -9
- package/dist/env-nV5rVErX.mjs +35 -0
- package/dist/env-nV5rVErX.mjs.map +1 -0
- package/dist/{index-5R1_k2nv.d.mts → index-BkjyCInx.d.mts} +12 -37
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/{models-DIGdOUpJ.mjs → models-pBSRUZhY.mjs} +1 -1
- package/dist/{models-DIGdOUpJ.mjs.map → models-pBSRUZhY.mjs.map} +1 -1
- package/dist/plugins/chat-models/index.d.mts +63 -6
- package/dist/plugins/chat-models/index.mjs +74 -18
- package/dist/plugins/chat-models/index.mjs.map +1 -1
- package/dist/registry-BHGMxjpA.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/cli-ImxGpoYQ.mjs.map +0 -1
- package/dist/env--94B0UtW.mjs +0 -41
- package/dist/env--94B0UtW.mjs.map +0 -1
package/dist/env--94B0UtW.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region src/core/inference-executors/env.ts
|
|
2
|
-
function assertNonEmptyString(value, options) {
|
|
3
|
-
if (value == null || value.trim().length === 0) {
|
|
4
|
-
if (options.required === true) {
|
|
5
|
-
const label = options.name ?? "environment variable";
|
|
6
|
-
throw new Error(`Missing required ${label}.`);
|
|
7
|
-
}
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Parses one env value with optional required behavior.
|
|
14
|
-
*
|
|
15
|
-
* Example:
|
|
16
|
-
* `const apiKey = envFrom(process.env.OPENAI_API_KEY, { type: 'string', required: true, name: 'OPENAI_API_KEY' })`
|
|
17
|
-
*/
|
|
18
|
-
function envFrom(value, options) {
|
|
19
|
-
if (options.type === "string") return assertNonEmptyString(value, options);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Parses one required env value.
|
|
23
|
-
*
|
|
24
|
-
* Example:
|
|
25
|
-
* `const apiKey = requiredEnvFrom(process.env.OPENAI_API_KEY, { type: 'string', name: 'OPENAI_API_KEY' })`
|
|
26
|
-
*/
|
|
27
|
-
function requiredEnvFrom(value, options) {
|
|
28
|
-
const parsed = envFrom(value, {
|
|
29
|
-
...options,
|
|
30
|
-
required: true
|
|
31
|
-
});
|
|
32
|
-
if (parsed == null) {
|
|
33
|
-
const label = options.name ?? "environment variable";
|
|
34
|
-
throw new Error(`Missing required ${label}.`);
|
|
35
|
-
}
|
|
36
|
-
return parsed;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
export { requiredEnvFrom as n, envFrom as t };
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=env--94B0UtW.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env--94B0UtW.mjs","names":[],"sources":["../src/core/inference-executors/env.ts"],"sourcesContent":["/**\n * Supported env value coercion types.\n */\nexport type EnvValueType = 'string'\n\n/**\n * Common options for env readers.\n */\nexport interface EnvFromOptions {\n /**\n * Expected env value type.\n */\n type: EnvValueType\n /**\n * Whether an empty or missing value should throw.\n *\n * @default false\n */\n required?: boolean\n /**\n * Optional key name used for clearer error messages.\n */\n name?: string\n}\n\n/**\n * Env options used by the required helper.\n *\n * `required` is intentionally omitted because this helper is always required.\n */\nexport type RequiredEnvFromOptions = Omit<EnvFromOptions, 'required'>\n\nfunction assertNonEmptyString(value: string | undefined, options: EnvFromOptions): string | undefined {\n if (value == null || value.trim().length === 0) {\n if (options.required === true) {\n const label = options.name ?? 'environment variable'\n throw new Error(`Missing required ${label}.`)\n }\n\n return undefined\n }\n\n return value\n}\n\n/**\n * Parses one env value with optional required behavior.\n *\n * Example:\n * `const apiKey = envFrom(process.env.OPENAI_API_KEY, { type: 'string', required: true, name: 'OPENAI_API_KEY' })`\n */\nexport function envFrom(\n value: string | undefined,\n options: EnvFromOptions,\n): string | undefined {\n if (options.type === 'string') {\n return assertNonEmptyString(value, options)\n }\n\n return undefined\n}\n\n/**\n * Parses one required env value.\n *\n * Example:\n * `const apiKey = requiredEnvFrom(process.env.OPENAI_API_KEY, { type: 'string', name: 'OPENAI_API_KEY' })`\n */\nexport function requiredEnvFrom(\n value: string | undefined,\n options: RequiredEnvFromOptions,\n): string {\n const parsed = envFrom(value, {\n ...options,\n required: true,\n })\n\n if (parsed == null) {\n const label = options.name ?? 'environment variable'\n throw new Error(`Missing required ${label}.`)\n }\n\n return parsed\n}\n"],"mappings":";AAgCA,SAAS,qBAAqB,OAA2B,SAA6C;AACpG,KAAI,SAAS,QAAQ,MAAM,MAAM,CAAC,WAAW,GAAG;AAC9C,MAAI,QAAQ,aAAa,MAAM;GAC7B,MAAM,QAAQ,QAAQ,QAAQ;AAC9B,SAAM,IAAI,MAAM,oBAAoB,MAAM,GAAG;;AAG/C;;AAGF,QAAO;;;;;;;;AAST,SAAgB,QACd,OACA,SACoB;AACpB,KAAI,QAAQ,SAAS,SACnB,QAAO,qBAAqB,OAAO,QAAQ;;;;;;;;AAY/C,SAAgB,gBACd,OACA,SACQ;CACR,MAAM,SAAS,QAAQ,OAAO;EAC5B,GAAG;EACH,UAAU;EACX,CAAC;AAEF,KAAI,UAAU,MAAM;EAClB,MAAM,QAAQ,QAAQ,QAAQ;AAC9B,QAAM,IAAI,MAAM,oBAAoB,MAAM,GAAG;;AAG/C,QAAO"}
|