llm-testrunner-components 1.2.4 → 1.3.0

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.
Files changed (78) hide show
  1. package/README.md +9 -5
  2. package/dist/cjs/app-chips_5.cjs.entry.js +1 -1
  3. package/dist/cjs/app-chips_5.cjs.entry.js.map +1 -1
  4. package/dist/cjs/index.cjs.js +464 -66
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/llm-testrunner.cjs.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/llm-test-runner/llm-test-runner.js +46 -13
  9. package/dist/collection/components/llm-test-runner/llm-test-runner.js.map +1 -1
  10. package/dist/collection/components/llm-test-runner/test-cases/chat-history.css +5 -5
  11. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js +45 -5
  12. package/dist/collection/components/llm-test-runner/test-cases/expected-outcome-renderer.js.map +1 -1
  13. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.css +21 -0
  14. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js +2 -2
  15. package/dist/collection/components/llm-test-runner/test-cases/llm-test-case-row.js.map +1 -1
  16. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js +2 -2
  17. package/dist/collection/components/llm-test-runner/test-cases/llm-test-cases.js.map +1 -1
  18. package/dist/collection/components/llm-test-runner/test-cases/output/response-output.js +1 -1
  19. package/dist/collection/components/llm-test-runner/test-cases/output/response-output.js.map +1 -1
  20. package/dist/collection/lib/evaluation/actual-value-resolver.js +52 -0
  21. package/dist/collection/lib/evaluation/actual-value-resolver.js.map +1 -0
  22. package/dist/collection/lib/evaluation/evaluation-engine.js +1 -1
  23. package/dist/collection/lib/evaluation/evaluation-engine.js.map +1 -1
  24. package/dist/collection/lib/evaluation/evaluation-service.js +55 -17
  25. package/dist/collection/lib/evaluation/evaluation-service.js.map +1 -1
  26. package/dist/collection/lib/evaluation/types.js.map +1 -1
  27. package/dist/collection/lib/import-export/test-suite-importer.js +7 -1
  28. package/dist/collection/lib/import-export/test-suite-importer.js.map +1 -1
  29. package/dist/collection/lib/test-cases/test-case-factory.js +5 -0
  30. package/dist/collection/lib/test-cases/test-case-factory.js.map +1 -1
  31. package/dist/collection/lib/test-cases/test-case-mutations.js +58 -23
  32. package/dist/collection/lib/test-cases/test-case-mutations.js.map +1 -1
  33. package/dist/collection/schemas/expected-outcome.js +39 -0
  34. package/dist/collection/schemas/expected-outcome.js.map +1 -1
  35. package/dist/collection/schemas/model-response.js +7 -0
  36. package/dist/collection/schemas/model-response.js.map +1 -0
  37. package/dist/collection/schemas/test-case.js +2 -1
  38. package/dist/collection/schemas/test-case.js.map +1 -1
  39. package/dist/collection/types/expected-outcome.js.map +1 -1
  40. package/dist/collection/types/llm-test-runner.js.map +1 -1
  41. package/dist/components/chat-history.js +1 -1
  42. package/dist/components/index.js +1 -1
  43. package/dist/components/llm-test-runner.js +1 -1
  44. package/dist/components/p-kmtfMXcQ.js +2 -0
  45. package/dist/components/p-kmtfMXcQ.js.map +1 -0
  46. package/dist/components/{p-B87Lt3z4.js → p-wzA48RFK.js} +3 -3
  47. package/dist/components/p-wzA48RFK.js.map +1 -0
  48. package/dist/esm/app-chips_5.entry.js +1 -1
  49. package/dist/esm/app-chips_5.entry.js.map +1 -1
  50. package/dist/esm/index.js +464 -66
  51. package/dist/esm/index.js.map +1 -1
  52. package/dist/esm/llm-testrunner.js +1 -1
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/llm-testrunner/index.esm.js +2 -2
  55. package/dist/llm-testrunner/index.esm.js.map +1 -1
  56. package/dist/llm-testrunner/llm-testrunner.esm.js +1 -1
  57. package/dist/llm-testrunner/{p-21202f12.entry.js → p-5bf1fc78.entry.js} +2 -2
  58. package/dist/llm-testrunner/{p-21202f12.entry.js.map → p-5bf1fc78.entry.js.map} +1 -1
  59. package/dist/types/components/llm-test-runner/llm-test-runner.d.ts +3 -4
  60. package/dist/types/components/llm-test-runner/test-cases/expected-outcome-renderer.d.ts +1 -0
  61. package/dist/types/components/llm-test-runner/test-cases/llm-test-case-row.d.ts +1 -0
  62. package/dist/types/components/llm-test-runner/test-cases/llm-test-cases.d.ts +1 -0
  63. package/dist/types/components/llm-test-runner/test-cases/output/response-output.d.ts +2 -1
  64. package/dist/types/components.d.ts +4 -2
  65. package/dist/types/lib/evaluation/actual-value-resolver.d.ts +9 -0
  66. package/dist/types/lib/evaluation/evaluation-service.d.ts +2 -2
  67. package/dist/types/lib/evaluation/types.d.ts +1 -1
  68. package/dist/types/lib/import-export/test-suite-importer.d.ts +1 -1
  69. package/dist/types/lib/test-cases/test-case-mutations.d.ts +10 -1
  70. package/dist/types/schemas/expected-outcome.d.ts +116 -0
  71. package/dist/types/schemas/model-response.d.ts +7 -0
  72. package/dist/types/schemas/test-case.d.ts +76 -1
  73. package/dist/types/types/expected-outcome.d.ts +1 -1
  74. package/dist/types/types/llm-test-runner.d.ts +4 -2
  75. package/package.json +1 -1
  76. package/dist/components/p-B87Lt3z4.js.map +0 -1
  77. package/dist/components/p-Bx2jqguC.js +0 -2
  78. package/dist/components/p-Bx2jqguC.js.map +0 -1
@@ -10,6 +10,12 @@ export declare const testCaseInputSchema: z.ZodObject<{
10
10
  expectedOutcome: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
11
11
  label: z.ZodString;
12
12
  placeholder: z.ZodOptional<z.ZodString>;
13
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
14
+ type: z.ZodLiteral<"text">;
15
+ }, z.core.$strip>, z.ZodObject<{
16
+ type: z.ZodLiteral<"custom">;
17
+ extractorId: z.ZodString;
18
+ }, z.core.$strip>], "type">>;
13
19
  type: z.ZodLiteral<"text">;
14
20
  evaluationParameters: z.ZodOptional<z.ZodObject<{
15
21
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -19,6 +25,12 @@ export declare const testCaseInputSchema: z.ZodObject<{
19
25
  }, z.core.$strip>, z.ZodObject<{
20
26
  label: z.ZodString;
21
27
  placeholder: z.ZodOptional<z.ZodString>;
28
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ type: z.ZodLiteral<"text">;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ type: z.ZodLiteral<"custom">;
32
+ extractorId: z.ZodString;
33
+ }, z.core.$strip>], "type">>;
22
34
  type: z.ZodLiteral<"textarea">;
23
35
  rows: z.ZodOptional<z.ZodNumber>;
24
36
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -34,6 +46,12 @@ export declare const testCaseInputSchema: z.ZodObject<{
34
46
  }, z.core.$strip>, z.ZodObject<{
35
47
  label: z.ZodString;
36
48
  placeholder: z.ZodOptional<z.ZodString>;
49
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
50
+ type: z.ZodLiteral<"text">;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<"custom">;
53
+ extractorId: z.ZodString;
54
+ }, z.core.$strip>], "type">>;
37
55
  type: z.ZodLiteral<"chips-input">;
38
56
  evaluationParameters: z.ZodOptional<z.ZodObject<{
39
57
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -43,6 +61,12 @@ export declare const testCaseInputSchema: z.ZodObject<{
43
61
  }, z.core.$strip>, z.ZodObject<{
44
62
  label: z.ZodString;
45
63
  placeholder: z.ZodOptional<z.ZodString>;
64
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
65
+ type: z.ZodLiteral<"text">;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ type: z.ZodLiteral<"custom">;
68
+ extractorId: z.ZodString;
69
+ }, z.core.$strip>], "type">>;
46
70
  type: z.ZodLiteral<"select">;
47
71
  options: z.ZodArray<z.ZodString>;
48
72
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -62,6 +86,12 @@ export declare const testCaseInputArraySchema: z.ZodArray<z.ZodObject<{
62
86
  expectedOutcome: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
63
87
  label: z.ZodString;
64
88
  placeholder: z.ZodOptional<z.ZodString>;
89
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ type: z.ZodLiteral<"text">;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ type: z.ZodLiteral<"custom">;
93
+ extractorId: z.ZodString;
94
+ }, z.core.$strip>], "type">>;
65
95
  type: z.ZodLiteral<"text">;
66
96
  evaluationParameters: z.ZodOptional<z.ZodObject<{
67
97
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -71,6 +101,12 @@ export declare const testCaseInputArraySchema: z.ZodArray<z.ZodObject<{
71
101
  }, z.core.$strip>, z.ZodObject<{
72
102
  label: z.ZodString;
73
103
  placeholder: z.ZodOptional<z.ZodString>;
104
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
105
+ type: z.ZodLiteral<"text">;
106
+ }, z.core.$strip>, z.ZodObject<{
107
+ type: z.ZodLiteral<"custom">;
108
+ extractorId: z.ZodString;
109
+ }, z.core.$strip>], "type">>;
74
110
  type: z.ZodLiteral<"textarea">;
75
111
  rows: z.ZodOptional<z.ZodNumber>;
76
112
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -86,6 +122,12 @@ export declare const testCaseInputArraySchema: z.ZodArray<z.ZodObject<{
86
122
  }, z.core.$strip>, z.ZodObject<{
87
123
  label: z.ZodString;
88
124
  placeholder: z.ZodOptional<z.ZodString>;
125
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
126
+ type: z.ZodLiteral<"text">;
127
+ }, z.core.$strip>, z.ZodObject<{
128
+ type: z.ZodLiteral<"custom">;
129
+ extractorId: z.ZodString;
130
+ }, z.core.$strip>], "type">>;
89
131
  type: z.ZodLiteral<"chips-input">;
90
132
  evaluationParameters: z.ZodOptional<z.ZodObject<{
91
133
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -95,6 +137,12 @@ export declare const testCaseInputArraySchema: z.ZodArray<z.ZodObject<{
95
137
  }, z.core.$strip>, z.ZodObject<{
96
138
  label: z.ZodString;
97
139
  placeholder: z.ZodOptional<z.ZodString>;
140
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
141
+ type: z.ZodLiteral<"text">;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ type: z.ZodLiteral<"custom">;
144
+ extractorId: z.ZodString;
145
+ }, z.core.$strip>], "type">>;
98
146
  type: z.ZodLiteral<"select">;
99
147
  options: z.ZodArray<z.ZodString>;
100
148
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -114,6 +162,12 @@ export declare const testCaseSchema: z.ZodObject<{
114
162
  expectedOutcome: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
115
163
  label: z.ZodString;
116
164
  placeholder: z.ZodOptional<z.ZodString>;
165
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
166
+ type: z.ZodLiteral<"text">;
167
+ }, z.core.$strip>, z.ZodObject<{
168
+ type: z.ZodLiteral<"custom">;
169
+ extractorId: z.ZodString;
170
+ }, z.core.$strip>], "type">>;
117
171
  type: z.ZodLiteral<"text">;
118
172
  evaluationParameters: z.ZodOptional<z.ZodObject<{
119
173
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -123,6 +177,12 @@ export declare const testCaseSchema: z.ZodObject<{
123
177
  }, z.core.$strip>, z.ZodObject<{
124
178
  label: z.ZodString;
125
179
  placeholder: z.ZodOptional<z.ZodString>;
180
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
181
+ type: z.ZodLiteral<"text">;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ type: z.ZodLiteral<"custom">;
184
+ extractorId: z.ZodString;
185
+ }, z.core.$strip>], "type">>;
126
186
  type: z.ZodLiteral<"textarea">;
127
187
  rows: z.ZodOptional<z.ZodNumber>;
128
188
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -138,6 +198,12 @@ export declare const testCaseSchema: z.ZodObject<{
138
198
  }, z.core.$strip>, z.ZodObject<{
139
199
  label: z.ZodString;
140
200
  placeholder: z.ZodOptional<z.ZodString>;
201
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
202
+ type: z.ZodLiteral<"text">;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ type: z.ZodLiteral<"custom">;
205
+ extractorId: z.ZodString;
206
+ }, z.core.$strip>], "type">>;
141
207
  type: z.ZodLiteral<"chips-input">;
142
208
  evaluationParameters: z.ZodOptional<z.ZodObject<{
143
209
  approach: z.ZodEnum<typeof import("../lib/evaluation/constants").EvaluationApproach>;
@@ -147,6 +213,12 @@ export declare const testCaseSchema: z.ZodObject<{
147
213
  }, z.core.$strip>, z.ZodObject<{
148
214
  label: z.ZodString;
149
215
  placeholder: z.ZodOptional<z.ZodString>;
216
+ evaluationSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
217
+ type: z.ZodLiteral<"text">;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ type: z.ZodLiteral<"custom">;
220
+ extractorId: z.ZodString;
221
+ }, z.core.$strip>], "type">>;
150
222
  type: z.ZodLiteral<"select">;
151
223
  options: z.ZodArray<z.ZodString>;
152
224
  evaluationParameters: z.ZodOptional<z.ZodObject<{
@@ -155,11 +227,14 @@ export declare const testCaseSchema: z.ZodObject<{
155
227
  }, z.core.$strip>>;
156
228
  value: z.ZodString;
157
229
  }, z.core.$strip>], "type">>;
230
+ output: z.ZodOptional<z.ZodObject<{
231
+ text: z.ZodOptional<z.ZodString>;
232
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
233
+ }, z.core.$strip>>;
158
234
  chatHistory: z.ZodObject<{
159
235
  enabled: z.ZodBoolean;
160
236
  value: z.ZodString;
161
237
  }, z.core.$strip>;
162
- output: z.ZodOptional<z.ZodString>;
163
238
  isRunning: z.ZodOptional<z.ZodBoolean>;
164
239
  error: z.ZodOptional<z.ZodString>;
165
240
  evaluationResult: z.ZodOptional<z.ZodCustom<EvaluationResult, EvaluationResult>>;
@@ -1 +1 @@
1
- export type { ExpectedOutcomeMode, ExpectedOutcomeSchemaField, ExpectedOutcomeSchema, ExpectedOutcomeField, ExpectedOutcomeFieldType, ExpectedOutcomeBase, TextExpectedOutcomeSchemaField, TextareaExpectedOutcomeSchemaField, ChipsExpectedOutcomeSchemaField, SelectExpectedOutcomeSchemaField, TextExpectedOutcomeField, TextareaExpectedOutcomeField, ChipsExpectedOutcomeField, SelectExpectedOutcomeField, } from '../schemas/expected-outcome';
1
+ export type { EvaluationSource, EvaluationSourceExtractor, EvaluationSourceExtractors, ExpectedOutcomeMode, ExpectedOutcomeSchemaField, ExpectedOutcomeSchema, ExpectedOutcomeField, ExpectedOutcomeFieldType, ExpectedOutcomeBase, TextExpectedOutcomeSchemaField, TextareaExpectedOutcomeSchemaField, ChipsExpectedOutcomeSchemaField, SelectExpectedOutcomeSchemaField, TextExpectedOutcomeField, TextareaExpectedOutcomeField, ChipsExpectedOutcomeField, SelectExpectedOutcomeField, } from '../schemas/expected-outcome';
@@ -1,10 +1,12 @@
1
1
  import type { TestCase } from './test-case';
2
- export type { ExpectedOutcomeMode, ExpectedOutcomeFieldType, ExpectedOutcomeBase, ExpectedOutcomeSchema, ExpectedOutcomeSchemaField, ExpectedOutcomeField, TextExpectedOutcomeSchemaField, TextareaExpectedOutcomeSchemaField, ChipsExpectedOutcomeSchemaField, SelectExpectedOutcomeSchemaField, TextExpectedOutcomeField, TextareaExpectedOutcomeField, ChipsExpectedOutcomeField, SelectExpectedOutcomeField, } from './expected-outcome';
2
+ import type { ModelResponsePayload } from '../schemas/model-response';
3
+ export type { EvaluationSource, EvaluationSourceExtractor, EvaluationSourceExtractors, ExpectedOutcomeMode, ExpectedOutcomeFieldType, ExpectedOutcomeBase, ExpectedOutcomeSchema, ExpectedOutcomeSchemaField, ExpectedOutcomeField, TextExpectedOutcomeSchemaField, TextareaExpectedOutcomeSchemaField, ChipsExpectedOutcomeSchemaField, SelectExpectedOutcomeSchemaField, TextExpectedOutcomeField, TextareaExpectedOutcomeField, ChipsExpectedOutcomeField, SelectExpectedOutcomeField, } from './expected-outcome';
4
+ export type { ModelResponsePayload, } from '../schemas/model-response';
3
5
  export type { TestCaseChatHistory, TestCase, TestCaseInput, } from './test-case';
4
6
  export interface LLMRequestPayload {
5
7
  prompt: string;
8
+ resolve: (result: ModelResponsePayload) => void;
6
9
  chatHistory?: string;
7
- resolve: (result: string) => void;
8
10
  reject: (err: Error | unknown) => void;
9
11
  }
10
12
  export interface SavePayload {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-testrunner-components",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "description": "A Stencil web component library for LLM test runner functionality",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",