vieval 0.0.1 → 0.0.3
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 +8 -5
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +1204 -61
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{config-D2fe1SnT.mjs → config-CHN24egi.mjs} +1 -1
- package/dist/{config-D2fe1SnT.mjs.map → config-CHN24egi.mjs.map} +1 -1
- package/dist/config.d.mts +2 -3
- package/dist/config.mjs +2 -2
- package/dist/core/assertions/index.d.mts +1 -1
- package/dist/core/inference-executors/index.d.mts +1 -45
- package/dist/core/inference-executors/index.mjs +1 -38
- 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 +2 -2
- package/dist/env-C7X81PWa.mjs +41 -0
- package/dist/env-C7X81PWa.mjs.map +1 -0
- package/dist/env-DtpjACOW.d.mts +47 -0
- package/dist/expect-B2vaoRVZ.d.mts +10 -0
- package/dist/{expect-i9WZWGrA.mjs → expect-CaXiUkwY.mjs} +3 -3
- package/dist/expect-CaXiUkwY.mjs.map +1 -0
- package/dist/expect-extensions-BOzwV5EJ.mjs +197 -0
- package/dist/expect-extensions-BOzwV5EJ.mjs.map +1 -0
- package/dist/expect.d.mts +1 -1
- package/dist/expect.mjs +1 -1
- package/dist/{index-DP7jsORl.d.mts → index-BDMEAmf2.d.mts} +246 -3
- package/dist/{index-oSXhM1zx.d.mts → index-C3gPFmcR.d.mts} +2 -2
- package/dist/index.d.mts +326 -6
- package/dist/index.mjs +65 -23
- package/dist/index.mjs.map +1 -1
- package/dist/{models-D_MsBtYw.mjs → models-DIGdOUpJ.mjs} +1 -1
- package/dist/{models-D_MsBtYw.mjs.map → models-DIGdOUpJ.mjs.map} +1 -1
- package/dist/plugins/chat-models/index.d.mts +465 -6
- package/dist/plugins/chat-models/index.mjs +469 -6
- package/dist/plugins/chat-models/index.mjs.map +1 -1
- package/dist/{registry-ChOjjdEC.mjs → registry-CHJcTN2W.mjs} +75 -16
- package/dist/registry-CHJcTN2W.mjs.map +1 -0
- package/dist/{runner-4ZsOveoY.mjs → runner-Dpy-eivM.mjs} +177 -21
- package/dist/runner-Dpy-eivM.mjs.map +1 -0
- package/dist/testing/expect-extensions.d.mts +44 -38
- package/dist/testing/expect-extensions.mjs +1 -1
- package/package.json +11 -4
- package/dist/expect-0jPJ7Zio.d.mts +0 -2318
- package/dist/expect-extensions-CwPtgTz8.mjs +0 -13471
- package/dist/expect-extensions-CwPtgTz8.mjs.map +0 -1
- package/dist/expect-i9WZWGrA.mjs.map +0 -1
- package/dist/magic-string.es-CH1jwzMg.mjs +0 -1013
- package/dist/magic-string.es-CH1jwzMg.mjs.map +0 -1
- package/dist/plugin-DVaRZY2x.d.mts +0 -84
- package/dist/registry-ChOjjdEC.mjs.map +0 -1
- package/dist/runner-4ZsOveoY.mjs.map +0 -1
|
@@ -1,5 +1,288 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as ModelDefinition, l as MatrixDefinition, t as ConfigHookPlugin, x as TaskRunContext } from "../../index-BDMEAmf2.mjs";
|
|
2
2
|
|
|
3
|
+
//#region src/plugins/chat-models/runtime-config.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Runtime config consumed by OpenAI-compatible provider constructors.
|
|
6
|
+
*/
|
|
7
|
+
interface OpenAIChatModelRuntimeConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Resolved inference executor kind.
|
|
10
|
+
*/
|
|
11
|
+
inferenceExecutor: 'openai';
|
|
12
|
+
/**
|
|
13
|
+
* Concrete model name.
|
|
14
|
+
*/
|
|
15
|
+
model: string;
|
|
16
|
+
/**
|
|
17
|
+
* Required API key.
|
|
18
|
+
*/
|
|
19
|
+
apiKey: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional base URL override.
|
|
22
|
+
*/
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional request headers.
|
|
26
|
+
*/
|
|
27
|
+
headers?: ChatModelHeaders;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runtime config consumed by Ollama provider constructors.
|
|
31
|
+
*/
|
|
32
|
+
interface OllamaChatModelRuntimeConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Resolved inference executor kind.
|
|
35
|
+
*/
|
|
36
|
+
inferenceExecutor: 'ollama';
|
|
37
|
+
/**
|
|
38
|
+
* Concrete model name.
|
|
39
|
+
*/
|
|
40
|
+
model: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optional base URL override.
|
|
43
|
+
*/
|
|
44
|
+
baseURL?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional request headers.
|
|
47
|
+
*/
|
|
48
|
+
headers?: ChatModelHeaders;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Runtime config consumed by OpenRouter provider constructors.
|
|
52
|
+
*/
|
|
53
|
+
interface OpenRouterChatModelRuntimeConfig {
|
|
54
|
+
/**
|
|
55
|
+
* Resolved inference executor kind.
|
|
56
|
+
*/
|
|
57
|
+
inferenceExecutor: 'openrouter';
|
|
58
|
+
/**
|
|
59
|
+
* Concrete model name.
|
|
60
|
+
*/
|
|
61
|
+
model: string;
|
|
62
|
+
/**
|
|
63
|
+
* Required API key.
|
|
64
|
+
*/
|
|
65
|
+
apiKey: string;
|
|
66
|
+
/**
|
|
67
|
+
* Optional base URL override.
|
|
68
|
+
*/
|
|
69
|
+
baseURL?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional request headers.
|
|
72
|
+
*/
|
|
73
|
+
headers?: ChatModelHeaders;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Union of normalized runtime configs for supported chat-model executors.
|
|
77
|
+
*/
|
|
78
|
+
type ChatModelRuntimeConfig = OpenAIChatModelRuntimeConfig | OllamaChatModelRuntimeConfig | OpenRouterChatModelRuntimeConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Normalizes one configured chat model into runtime executor config.
|
|
81
|
+
*
|
|
82
|
+
* Use when:
|
|
83
|
+
* - eval code needs typed provider constructor options from `context.model()`
|
|
84
|
+
* - model parameters should be validated once with clear error messages
|
|
85
|
+
*
|
|
86
|
+
* Expects:
|
|
87
|
+
* - `model.inferenceExecutorId` to be one of the supported executor ids
|
|
88
|
+
* - required OpenAI fields (apiKey) to exist in `model.parameters`
|
|
89
|
+
*
|
|
90
|
+
* Returns:
|
|
91
|
+
* - validated runtime config union for OpenAI or Ollama
|
|
92
|
+
*/
|
|
93
|
+
declare function toChatModelRuntimeConfig(model: ModelDefinition): ChatModelRuntimeConfig;
|
|
94
|
+
/**
|
|
95
|
+
* Resolves OpenAI runtime config from one resolved run-context model.
|
|
96
|
+
*
|
|
97
|
+
* Use when:
|
|
98
|
+
* - task execution already has `context.model()` output
|
|
99
|
+
* - eval code wants typed OpenAI provider options with a concise helper name
|
|
100
|
+
*
|
|
101
|
+
* Expects:
|
|
102
|
+
* - `model` to resolve to an OpenAI-backed chat model
|
|
103
|
+
*
|
|
104
|
+
* Returns:
|
|
105
|
+
* - validated OpenAI runtime config
|
|
106
|
+
*/
|
|
107
|
+
declare function openaiFromRunContext(model: ModelDefinition): OpenAIChatModelRuntimeConfig;
|
|
108
|
+
/**
|
|
109
|
+
* Resolves Ollama runtime config from one resolved run-context model.
|
|
110
|
+
*
|
|
111
|
+
* Use when:
|
|
112
|
+
* - task execution already has `context.model()` output
|
|
113
|
+
* - eval code wants typed Ollama provider options with a concise helper name
|
|
114
|
+
*
|
|
115
|
+
* Expects:
|
|
116
|
+
* - `model` to resolve to an Ollama-backed chat model
|
|
117
|
+
*
|
|
118
|
+
* Returns:
|
|
119
|
+
* - validated Ollama runtime config
|
|
120
|
+
*/
|
|
121
|
+
declare function ollamaFromRunContext(model: ModelDefinition): OllamaChatModelRuntimeConfig;
|
|
122
|
+
/**
|
|
123
|
+
* Resolves OpenRouter runtime config from one resolved run-context model.
|
|
124
|
+
*
|
|
125
|
+
* Use when:
|
|
126
|
+
* - task execution already has `context.model()` output
|
|
127
|
+
* - eval code wants typed OpenRouter provider options with a concise helper name
|
|
128
|
+
*
|
|
129
|
+
* Expects:
|
|
130
|
+
* - `model` to resolve to an OpenRouter-backed chat model
|
|
131
|
+
*
|
|
132
|
+
* Returns:
|
|
133
|
+
* - validated OpenRouter runtime config
|
|
134
|
+
*/
|
|
135
|
+
declare function openrouterFromRunContext(model: ModelDefinition): OpenRouterChatModelRuntimeConfig;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/plugins/chat-models/telemetry.d.ts
|
|
138
|
+
/**
|
|
139
|
+
* Represents one normalized chat-model tool call.
|
|
140
|
+
*
|
|
141
|
+
* Use when:
|
|
142
|
+
* - report events need tool-call level payloads that remain provider-neutral
|
|
143
|
+
*
|
|
144
|
+
* Expects:
|
|
145
|
+
* - `name` to be stable enough for aggregation and assertion checks
|
|
146
|
+
* - `args` to be JSON-serializable
|
|
147
|
+
*/
|
|
148
|
+
interface ChatModelToolCall {
|
|
149
|
+
/**
|
|
150
|
+
* Optional provider-assigned tool-call identifier.
|
|
151
|
+
*/
|
|
152
|
+
id?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Tool name.
|
|
155
|
+
*/
|
|
156
|
+
name: string;
|
|
157
|
+
/**
|
|
158
|
+
* Parsed tool arguments object/value.
|
|
159
|
+
*/
|
|
160
|
+
args: unknown;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Provider identity attached to chat-model telemetry events.
|
|
164
|
+
*/
|
|
165
|
+
interface ChatModelTelemetryProvider {
|
|
166
|
+
/**
|
|
167
|
+
* Provider id, for example `openai`.
|
|
168
|
+
*/
|
|
169
|
+
id: string;
|
|
170
|
+
/**
|
|
171
|
+
* Optional concrete model id/name.
|
|
172
|
+
*/
|
|
173
|
+
model?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Input options for response telemetry emission.
|
|
177
|
+
*/
|
|
178
|
+
interface EmitChatModelResponseTelemetryOptions {
|
|
179
|
+
/**
|
|
180
|
+
* Optional case id for case-scoped telemetry events.
|
|
181
|
+
*/
|
|
182
|
+
caseId?: string;
|
|
183
|
+
/**
|
|
184
|
+
* Optional response latency in milliseconds.
|
|
185
|
+
*/
|
|
186
|
+
latencyMs?: number;
|
|
187
|
+
/**
|
|
188
|
+
* Optional provider identity payload.
|
|
189
|
+
*/
|
|
190
|
+
provider?: ChatModelTelemetryProvider;
|
|
191
|
+
/**
|
|
192
|
+
* Raw chat-model response object from the inference library/provider.
|
|
193
|
+
*/
|
|
194
|
+
response: unknown;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Input options for request telemetry emission.
|
|
198
|
+
*/
|
|
199
|
+
interface EmitChatModelRequestTelemetryOptions {
|
|
200
|
+
/**
|
|
201
|
+
* Optional case id for case-scoped telemetry events.
|
|
202
|
+
*/
|
|
203
|
+
caseId?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Optional request payload metadata.
|
|
206
|
+
*/
|
|
207
|
+
data?: unknown;
|
|
208
|
+
/**
|
|
209
|
+
* Optional provider identity payload.
|
|
210
|
+
*/
|
|
211
|
+
provider?: ChatModelTelemetryProvider;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Input options for error telemetry emission.
|
|
215
|
+
*/
|
|
216
|
+
interface EmitChatModelErrorTelemetryOptions {
|
|
217
|
+
/**
|
|
218
|
+
* Optional case id for case-scoped telemetry events.
|
|
219
|
+
*/
|
|
220
|
+
caseId?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Error payload emitted by the inference client/runtime.
|
|
223
|
+
*/
|
|
224
|
+
error: unknown;
|
|
225
|
+
/**
|
|
226
|
+
* Optional provider identity payload.
|
|
227
|
+
*/
|
|
228
|
+
provider?: ChatModelTelemetryProvider;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Extracts normalized tool calls from one chat-model response shape.
|
|
232
|
+
*
|
|
233
|
+
* Use when:
|
|
234
|
+
* - downstream scoring, reporting, or analysis should inspect tool call usage
|
|
235
|
+
* - provider payload differences should stay hidden behind one stable shape
|
|
236
|
+
*
|
|
237
|
+
* Returns:
|
|
238
|
+
* - normalized list of `{ id?, name, args }` tool calls
|
|
239
|
+
*/
|
|
240
|
+
declare function extractChatModelToolCalls(response: unknown): ChatModelToolCall[];
|
|
241
|
+
/**
|
|
242
|
+
* Extracts numeric metering dimensions from one chat-model response usage block.
|
|
243
|
+
*
|
|
244
|
+
* Use when:
|
|
245
|
+
* - report events should capture usage dimensions in a modality-neutral map
|
|
246
|
+
*
|
|
247
|
+
* Returns:
|
|
248
|
+
* - numeric dimensions keyed by provider usage field names
|
|
249
|
+
*/
|
|
250
|
+
declare function extractMeteringDimensions(response: unknown): Record<string, number>;
|
|
251
|
+
/**
|
|
252
|
+
* Emits chat-model response telemetry as reportable task events.
|
|
253
|
+
*
|
|
254
|
+
* Use when:
|
|
255
|
+
* - task code receives one chat-model response and wants standardized report events
|
|
256
|
+
* - `ToolCall*` and metering metrics should be persisted in `events.jsonl`
|
|
257
|
+
*
|
|
258
|
+
* Expects:
|
|
259
|
+
* - `context.reporterHooks?.onEvent` to be available in CLI execution paths
|
|
260
|
+
*
|
|
261
|
+
* Returns:
|
|
262
|
+
* - no return value; this is a best-effort reporting helper
|
|
263
|
+
*/
|
|
264
|
+
declare function emitChatModelResponseTelemetry(context: TaskRunContext, options: EmitChatModelResponseTelemetryOptions): void;
|
|
265
|
+
/**
|
|
266
|
+
* Emits chat-model request telemetry as a reportable task event.
|
|
267
|
+
*
|
|
268
|
+
* Use when:
|
|
269
|
+
* - task code submits one model request and wants request-side traceability
|
|
270
|
+
*
|
|
271
|
+
* Expects:
|
|
272
|
+
* - `context.reporterHooks?.onEvent` to be available in CLI execution paths
|
|
273
|
+
*/
|
|
274
|
+
declare function emitChatModelRequestTelemetry(context: TaskRunContext, options: EmitChatModelRequestTelemetryOptions): void;
|
|
275
|
+
/**
|
|
276
|
+
* Emits chat-model failure telemetry as a reportable task event.
|
|
277
|
+
*
|
|
278
|
+
* Use when:
|
|
279
|
+
* - one inference call fails and report artifacts should include normalized error context
|
|
280
|
+
*
|
|
281
|
+
* Expects:
|
|
282
|
+
* - `context.reporterHooks?.onEvent` to be available in CLI execution paths
|
|
283
|
+
*/
|
|
284
|
+
declare function emitChatModelErrorTelemetry(context: TaskRunContext, options: EmitChatModelErrorTelemetryOptions): void;
|
|
285
|
+
//#endregion
|
|
3
286
|
//#region src/plugins/chat-models/index.d.ts
|
|
4
287
|
/**
|
|
5
288
|
* Minimal inference-executor shape expected by chat model runtime callers.
|
|
@@ -12,13 +295,73 @@ interface ChatModelExecutorLike {
|
|
|
12
295
|
*/
|
|
13
296
|
type ChatModelExecutorInput = string | ChatModelExecutorLike;
|
|
14
297
|
/**
|
|
15
|
-
*
|
|
298
|
+
* Chat-model header payload accepted by executor parameters.
|
|
299
|
+
*/
|
|
300
|
+
type ChatModelHeaders = Record<string, string | string[]>;
|
|
301
|
+
/**
|
|
302
|
+
* Runtime env context passed to model callback resolvers.
|
|
303
|
+
*/
|
|
304
|
+
interface ChatModelResolverContext {
|
|
305
|
+
env: Record<string, string>;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Value-or-callback resolver used by model runtime fields.
|
|
309
|
+
*/
|
|
310
|
+
type ChatModelResolverValue<TValue> = TValue | ((config: ChatModelResolverContext) => Promise<TValue> | TValue);
|
|
311
|
+
/**
|
|
312
|
+
* OpenAI-specific inference executor config shape.
|
|
313
|
+
*/
|
|
314
|
+
interface OpenAIChatModelInferenceExecutor {
|
|
315
|
+
inferenceExecutor: 'openai';
|
|
316
|
+
apiKey?: ChatModelResolverValue<string>;
|
|
317
|
+
baseURL?: ChatModelResolverValue<string>;
|
|
318
|
+
headers?: ChatModelResolverValue<ChatModelHeaders>;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Ollama-specific inference executor config shape.
|
|
322
|
+
*/
|
|
323
|
+
interface OllamaChatModelInferenceExecutor {
|
|
324
|
+
inferenceExecutor: 'ollama';
|
|
325
|
+
baseURL?: ChatModelResolverValue<string>;
|
|
326
|
+
headers?: ChatModelResolverValue<ChatModelHeaders>;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* OpenRouter-specific inference executor config shape.
|
|
16
330
|
*/
|
|
17
|
-
interface
|
|
331
|
+
interface OpenRouterChatModelInferenceExecutor {
|
|
332
|
+
inferenceExecutor: 'openrouter';
|
|
333
|
+
apiKey?: ChatModelResolverValue<string>;
|
|
334
|
+
baseURL?: ChatModelResolverValue<string>;
|
|
335
|
+
headers?: ChatModelResolverValue<ChatModelHeaders>;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Generic inference executor config shape.
|
|
339
|
+
*/
|
|
340
|
+
interface GenericChatModelInferenceExecutor {
|
|
341
|
+
inferenceExecutor?: ChatModelExecutorInput;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Union of supported inference executor config shapes for `chatModelFrom`.
|
|
345
|
+
*/
|
|
346
|
+
type ChatModelInferenceExecutor = OpenAIChatModelInferenceExecutor | OllamaChatModelInferenceExecutor | OpenRouterChatModelInferenceExecutor | GenericChatModelInferenceExecutor;
|
|
347
|
+
/**
|
|
348
|
+
* Common builder input fields for `chatModelFrom`.
|
|
349
|
+
*/
|
|
350
|
+
interface ChatModelFromBaseOptions {
|
|
351
|
+
/**
|
|
352
|
+
* Provider id registered through `ChatProviders`.
|
|
353
|
+
*
|
|
354
|
+
* Use when:
|
|
355
|
+
* - model runtime transport and credentials should be delegated to a named provider preset
|
|
356
|
+
*
|
|
357
|
+
* Expects:
|
|
358
|
+
* - one `ChatProviders` plugin entry to expose the same id
|
|
359
|
+
*/
|
|
360
|
+
provider?: string;
|
|
18
361
|
/**
|
|
19
362
|
* Inference-executor id or inference-executor instance.
|
|
20
363
|
*/
|
|
21
|
-
inferenceExecutor
|
|
364
|
+
inferenceExecutor?: ChatModelExecutorInput;
|
|
22
365
|
/**
|
|
23
366
|
* Optional explicit inference-executor id for inference-executor instances.
|
|
24
367
|
*
|
|
@@ -44,16 +387,102 @@ interface ChatModelFromOptions {
|
|
|
44
387
|
*/
|
|
45
388
|
parameters?: Record<string, unknown>;
|
|
46
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Builder input for `chatModelFrom`.
|
|
392
|
+
*/
|
|
393
|
+
type ChatModelFromOptions = ChatModelInferenceExecutor & ChatModelFromBaseOptions;
|
|
47
394
|
/**
|
|
48
395
|
* Chat-model specific specialization of the canonical `ModelDefinition`.
|
|
49
396
|
*/
|
|
50
397
|
type ChatModelDefinition = Omit<ModelDefinition, 'inferenceExecutor'> & {
|
|
51
398
|
inferenceExecutor: ChatModelExecutorInput;
|
|
399
|
+
provider?: string;
|
|
400
|
+
runtimeResolvers?: {
|
|
401
|
+
apiKey?: ChatModelResolverValue<string>;
|
|
402
|
+
baseURL?: ChatModelResolverValue<string>;
|
|
403
|
+
headers?: ChatModelResolverValue<ChatModelHeaders>;
|
|
404
|
+
};
|
|
52
405
|
};
|
|
406
|
+
/**
|
|
407
|
+
* Env-key map for optional provider parameters.
|
|
408
|
+
*
|
|
409
|
+
* Use when:
|
|
410
|
+
* - provider parameter values should be read from env keys
|
|
411
|
+
* - missing keys should resolve to `undefined`
|
|
412
|
+
*/
|
|
413
|
+
type OptionalProviderEnvMap = Record<string, string>;
|
|
414
|
+
/**
|
|
415
|
+
* Env-key map for required provider parameters.
|
|
416
|
+
*
|
|
417
|
+
* Use when:
|
|
418
|
+
* - provider parameter values must exist before model execution
|
|
419
|
+
* - missing keys should throw with key-aware error messages
|
|
420
|
+
*/
|
|
421
|
+
type RequiredProviderEnvMap = Record<string, string>;
|
|
422
|
+
/**
|
|
423
|
+
* One provider definition consumed by chat model presets.
|
|
424
|
+
*/
|
|
425
|
+
interface ChatProviderDefinition {
|
|
426
|
+
/**
|
|
427
|
+
* Stable provider id referenced by `chatModelFrom({ provider })`.
|
|
428
|
+
*/
|
|
429
|
+
id: string;
|
|
430
|
+
/**
|
|
431
|
+
* Inference-executor id or instance used by this provider preset.
|
|
432
|
+
*/
|
|
433
|
+
inferenceExecutor: ChatModelExecutorInput;
|
|
434
|
+
/**
|
|
435
|
+
* Optional explicit inference-executor id for inference-executor instances.
|
|
436
|
+
*
|
|
437
|
+
* @default 'custom'
|
|
438
|
+
*/
|
|
439
|
+
inferenceExecutorId?: string;
|
|
440
|
+
/**
|
|
441
|
+
* Optional literal provider-level parameters.
|
|
442
|
+
*/
|
|
443
|
+
parameters?: Record<string, unknown>;
|
|
444
|
+
/**
|
|
445
|
+
* Optional provider parameters resolved via `envFrom`.
|
|
446
|
+
*
|
|
447
|
+
* Expects:
|
|
448
|
+
* - map key is the provider parameter name
|
|
449
|
+
* - map value is the env key name
|
|
450
|
+
*/
|
|
451
|
+
optionalEnv?: OptionalProviderEnvMap;
|
|
452
|
+
/**
|
|
453
|
+
* Required provider parameters resolved via `requiredEnvFrom`.
|
|
454
|
+
*
|
|
455
|
+
* Expects:
|
|
456
|
+
* - map key is the provider parameter name
|
|
457
|
+
* - map value is the env key name
|
|
458
|
+
*/
|
|
459
|
+
requiredEnv?: RequiredProviderEnvMap;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Builder input for `chatProviderFrom`.
|
|
463
|
+
*/
|
|
464
|
+
interface ChatProviderFromOptions extends ChatProviderDefinition {}
|
|
465
|
+
/**
|
|
466
|
+
* Options for the built-in `ChatProviders` plugin.
|
|
467
|
+
*/
|
|
468
|
+
interface ChatProvidersPluginOptions {
|
|
469
|
+
/**
|
|
470
|
+
* Provider definitions to append to config.
|
|
471
|
+
*/
|
|
472
|
+
providers: readonly ChatProviderDefinition[];
|
|
473
|
+
/**
|
|
474
|
+
* Optional explicit env source used for env-backed provider parameters.
|
|
475
|
+
*
|
|
476
|
+
* @default process.env
|
|
477
|
+
*/
|
|
478
|
+
env?: NodeJS.ProcessEnv;
|
|
479
|
+
}
|
|
53
480
|
/**
|
|
54
481
|
* Partial config shape needed by the chat models plugin.
|
|
55
482
|
*/
|
|
56
483
|
interface PluginConfig {
|
|
484
|
+
env?: NodeJS.ProcessEnv;
|
|
485
|
+
chatProviders?: ChatProviderDefinition[];
|
|
57
486
|
models?: ModelDefinition[];
|
|
58
487
|
}
|
|
59
488
|
/**
|
|
@@ -68,6 +497,14 @@ type Plugin = ConfigHookPlugin<PluginConfig>;
|
|
|
68
497
|
* - a single model needs aliases for matrix selection or judge lookup
|
|
69
498
|
*/
|
|
70
499
|
declare function chatModelFrom(options: ChatModelFromOptions): ChatModelDefinition;
|
|
500
|
+
/**
|
|
501
|
+
* Builds one normalized chat provider definition.
|
|
502
|
+
*
|
|
503
|
+
* Use when:
|
|
504
|
+
* - one provider preset should be reused across multiple chat models
|
|
505
|
+
* - provider configuration should support required/optional env-backed parameters
|
|
506
|
+
*/
|
|
507
|
+
declare function chatProviderFrom(options: ChatProviderFromOptions): ChatProviderDefinition;
|
|
71
508
|
/**
|
|
72
509
|
* Options for the built-in `ChatModels` plugin.
|
|
73
510
|
*/
|
|
@@ -75,8 +512,30 @@ interface ChatModelsPluginOptions {
|
|
|
75
512
|
/**
|
|
76
513
|
* Chat model definitions to append to config.
|
|
77
514
|
*/
|
|
78
|
-
models: readonly
|
|
515
|
+
models: readonly ChatModelDefinition[];
|
|
79
516
|
}
|
|
517
|
+
/**
|
|
518
|
+
* Creates a run-matrix `model` axis from configured chat model names.
|
|
519
|
+
*
|
|
520
|
+
* Use when:
|
|
521
|
+
* - run matrix should iterate over explicit chat model ids/aliases
|
|
522
|
+
* - project configs want a concise model-axis helper
|
|
523
|
+
*
|
|
524
|
+
* Expects:
|
|
525
|
+
* - each provided name to match a configured model id or alias at runtime
|
|
526
|
+
*
|
|
527
|
+
* Returns:
|
|
528
|
+
* - matrix axis object compatible with `runMatrix.extend/override`
|
|
529
|
+
*/
|
|
530
|
+
declare function chatModelMatrix(...names: string[]): MatrixDefinition;
|
|
531
|
+
/**
|
|
532
|
+
* Built-in chat providers plugin that contributes provider presets to config.
|
|
533
|
+
*
|
|
534
|
+
* Use when:
|
|
535
|
+
* - provider runtime config should be centralized and reusable
|
|
536
|
+
* - provider parameters should be resolved from env via `envFrom`/`requiredEnvFrom`
|
|
537
|
+
*/
|
|
538
|
+
declare function ChatProviders(options: ChatProvidersPluginOptions): Plugin;
|
|
80
539
|
/**
|
|
81
540
|
* Built-in chat models plugin that contributes model definitions to vieval config.
|
|
82
541
|
*
|
|
@@ -86,5 +545,5 @@ interface ChatModelsPluginOptions {
|
|
|
86
545
|
*/
|
|
87
546
|
declare function ChatModels(options: ChatModelsPluginOptions): Plugin;
|
|
88
547
|
//#endregion
|
|
89
|
-
export { ChatModelDefinition, ChatModelExecutorInput, ChatModelExecutorLike, ChatModelFromOptions, ChatModels, ChatModelsPluginOptions, Plugin, PluginConfig, chatModelFrom };
|
|
548
|
+
export { ChatModelDefinition, ChatModelExecutorInput, ChatModelExecutorLike, ChatModelFromBaseOptions, ChatModelFromOptions, ChatModelHeaders, ChatModelInferenceExecutor, ChatModelResolverContext, ChatModelResolverValue, ChatModelRuntimeConfig, ChatModelTelemetryProvider, ChatModelToolCall, ChatModels, ChatModelsPluginOptions, ChatProviderDefinition, ChatProviderFromOptions, ChatProviders, ChatProvidersPluginOptions, EmitChatModelErrorTelemetryOptions, EmitChatModelRequestTelemetryOptions, EmitChatModelResponseTelemetryOptions, GenericChatModelInferenceExecutor, OllamaChatModelInferenceExecutor, OllamaChatModelRuntimeConfig, OpenAIChatModelInferenceExecutor, OpenAIChatModelRuntimeConfig, OpenRouterChatModelInferenceExecutor, OpenRouterChatModelRuntimeConfig, OptionalProviderEnvMap, Plugin, PluginConfig, RequiredProviderEnvMap, chatModelFrom, chatModelMatrix, chatProviderFrom, emitChatModelErrorTelemetry, emitChatModelRequestTelemetry, emitChatModelResponseTelemetry, extractChatModelToolCalls, extractMeteringDimensions, ollamaFromRunContext, openaiFromRunContext, openrouterFromRunContext, toChatModelRuntimeConfig };
|
|
90
549
|
//# sourceMappingURL=index.d.mts.map
|