@arizeai/phoenix-evals 0.5.1 → 0.6.1

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 (194) hide show
  1. package/README.md +42 -0
  2. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  3. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  4. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +37 -0
  5. package/dist/esm/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  6. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  7. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  8. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +43 -0
  9. package/dist/esm/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  10. package/dist/esm/__generated__/default_templates/index.d.ts +3 -0
  11. package/dist/esm/__generated__/default_templates/index.d.ts.map +1 -0
  12. package/dist/esm/__generated__/default_templates/index.js +4 -0
  13. package/dist/esm/__generated__/default_templates/index.js.map +1 -0
  14. package/dist/esm/__generated__/types.d.ts +9 -0
  15. package/dist/esm/__generated__/types.d.ts.map +1 -0
  16. package/dist/esm/__generated__/types.js +3 -0
  17. package/dist/esm/__generated__/types.js.map +1 -0
  18. package/dist/esm/core/EvaluatorBase.d.ts +19 -0
  19. package/dist/esm/core/EvaluatorBase.d.ts.map +1 -0
  20. package/dist/esm/core/EvaluatorBase.js +18 -0
  21. package/dist/esm/core/EvaluatorBase.js.map +1 -0
  22. package/dist/esm/index.d.ts +1 -0
  23. package/dist/esm/index.d.ts.map +1 -1
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/index.js.map +1 -1
  26. package/dist/esm/llm/ClassificationEvaluator.d.ts +19 -2
  27. package/dist/esm/llm/ClassificationEvaluator.d.ts.map +1 -1
  28. package/dist/esm/llm/ClassificationEvaluator.js +29 -2
  29. package/dist/esm/llm/ClassificationEvaluator.js.map +1 -1
  30. package/dist/esm/llm/LLMEvaluator.d.ts +4 -7
  31. package/dist/esm/llm/LLMEvaluator.d.ts.map +1 -1
  32. package/dist/esm/llm/LLMEvaluator.js +4 -7
  33. package/dist/esm/llm/LLMEvaluator.js.map +1 -1
  34. package/dist/esm/llm/createClassificationEvaluator.d.ts +1 -1
  35. package/dist/esm/llm/createClassificationEvaluator.d.ts.map +1 -1
  36. package/dist/esm/llm/createClassificationEvaluator.js.map +1 -1
  37. package/dist/esm/llm/createDocumentRelevanceEvaluator.d.ts +44 -0
  38. package/dist/esm/llm/createDocumentRelevanceEvaluator.d.ts.map +1 -0
  39. package/dist/esm/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +11 -12
  40. package/dist/esm/llm/createDocumentRelevanceEvaluator.js.map +1 -0
  41. package/dist/esm/llm/createHallucinationEvaluator.d.ts +6 -7
  42. package/dist/esm/llm/createHallucinationEvaluator.d.ts.map +1 -1
  43. package/dist/esm/llm/createHallucinationEvaluator.js +3 -4
  44. package/dist/esm/llm/createHallucinationEvaluator.js.map +1 -1
  45. package/dist/esm/llm/index.d.ts +1 -1
  46. package/dist/esm/llm/index.js +1 -1
  47. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  48. package/dist/esm/types/data.d.ts +194 -0
  49. package/dist/esm/types/data.d.ts.map +1 -0
  50. package/dist/esm/types/data.js +2 -0
  51. package/dist/esm/types/data.js.map +1 -0
  52. package/dist/esm/types/evals.d.ts +17 -3
  53. package/dist/esm/types/evals.d.ts.map +1 -1
  54. package/dist/esm/types/index.d.ts +1 -0
  55. package/dist/esm/types/index.d.ts.map +1 -1
  56. package/dist/esm/types/index.js +1 -0
  57. package/dist/esm/types/index.js.map +1 -1
  58. package/dist/esm/types/otel.d.ts +14 -13
  59. package/dist/esm/types/otel.d.ts.map +1 -1
  60. package/dist/esm/utils/bindEvaluator.d.ts +219 -0
  61. package/dist/esm/utils/bindEvaluator.d.ts.map +1 -0
  62. package/dist/esm/utils/bindEvaluator.js +163 -0
  63. package/dist/esm/utils/bindEvaluator.js.map +1 -0
  64. package/dist/esm/utils/index.d.ts +2 -0
  65. package/dist/esm/utils/index.d.ts.map +1 -0
  66. package/dist/esm/utils/index.js +2 -0
  67. package/dist/esm/utils/index.js.map +1 -0
  68. package/dist/esm/utils/objectMappingUtils.d.ts +166 -0
  69. package/dist/esm/utils/objectMappingUtils.d.ts.map +1 -0
  70. package/dist/esm/utils/objectMappingUtils.js +191 -0
  71. package/dist/esm/utils/objectMappingUtils.js.map +1 -0
  72. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  73. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  74. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js +40 -0
  75. package/dist/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  76. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts +3 -0
  77. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.d.ts.map +1 -0
  78. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js +46 -0
  79. package/dist/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.js.map +1 -0
  80. package/dist/src/__generated__/default_templates/index.d.ts +3 -0
  81. package/dist/src/__generated__/default_templates/index.d.ts.map +1 -0
  82. package/dist/src/__generated__/default_templates/index.js +9 -0
  83. package/dist/src/__generated__/default_templates/index.js.map +1 -0
  84. package/dist/src/__generated__/types.d.ts +9 -0
  85. package/dist/src/__generated__/types.d.ts.map +1 -0
  86. package/dist/src/__generated__/types.js +4 -0
  87. package/dist/src/__generated__/types.js.map +1 -0
  88. package/dist/src/core/EvaluatorBase.d.ts +19 -0
  89. package/dist/src/core/EvaluatorBase.d.ts.map +1 -0
  90. package/dist/src/core/EvaluatorBase.js +17 -0
  91. package/dist/src/core/EvaluatorBase.js.map +1 -0
  92. package/dist/src/index.d.ts +1 -0
  93. package/dist/src/index.d.ts.map +1 -1
  94. package/dist/src/index.js +1 -0
  95. package/dist/src/index.js.map +1 -1
  96. package/dist/src/llm/ClassificationEvaluator.d.ts +19 -2
  97. package/dist/src/llm/ClassificationEvaluator.d.ts.map +1 -1
  98. package/dist/src/llm/ClassificationEvaluator.js +13 -2
  99. package/dist/src/llm/ClassificationEvaluator.js.map +1 -1
  100. package/dist/src/llm/LLMEvaluator.d.ts +4 -7
  101. package/dist/src/llm/LLMEvaluator.d.ts.map +1 -1
  102. package/dist/src/llm/LLMEvaluator.js +16 -5
  103. package/dist/src/llm/LLMEvaluator.js.map +1 -1
  104. package/dist/src/llm/createClassificationEvaluator.d.ts +1 -1
  105. package/dist/src/llm/createClassificationEvaluator.d.ts.map +1 -1
  106. package/dist/src/llm/createClassificationEvaluator.js.map +1 -1
  107. package/dist/src/llm/createDocumentRelevanceEvaluator.d.ts +44 -0
  108. package/dist/src/llm/createDocumentRelevanceEvaluator.d.ts.map +1 -0
  109. package/dist/src/llm/{createDocumentRelevancyEvaluator.js → createDocumentRelevanceEvaluator.js} +13 -13
  110. package/dist/src/llm/createDocumentRelevanceEvaluator.js.map +1 -0
  111. package/dist/src/llm/createHallucinationEvaluator.d.ts +6 -7
  112. package/dist/src/llm/createHallucinationEvaluator.d.ts.map +1 -1
  113. package/dist/src/llm/createHallucinationEvaluator.js +4 -4
  114. package/dist/src/llm/createHallucinationEvaluator.js.map +1 -1
  115. package/dist/src/llm/index.d.ts +1 -1
  116. package/dist/src/llm/index.js +1 -1
  117. package/dist/src/types/data.d.ts +194 -0
  118. package/dist/src/types/data.d.ts.map +1 -0
  119. package/dist/src/types/data.js +3 -0
  120. package/dist/src/types/data.js.map +1 -0
  121. package/dist/src/types/evals.d.ts +17 -3
  122. package/dist/src/types/evals.d.ts.map +1 -1
  123. package/dist/src/types/index.d.ts +1 -0
  124. package/dist/src/types/index.d.ts.map +1 -1
  125. package/dist/src/types/index.js +1 -0
  126. package/dist/src/types/index.js.map +1 -1
  127. package/dist/src/types/otel.d.ts +14 -13
  128. package/dist/src/types/otel.d.ts.map +1 -1
  129. package/dist/src/utils/bindEvaluator.d.ts +219 -0
  130. package/dist/src/utils/bindEvaluator.d.ts.map +1 -0
  131. package/dist/src/utils/bindEvaluator.js +166 -0
  132. package/dist/src/utils/bindEvaluator.js.map +1 -0
  133. package/dist/src/utils/index.d.ts +2 -0
  134. package/dist/src/utils/index.d.ts.map +1 -0
  135. package/dist/src/{default_templates → utils}/index.js +1 -2
  136. package/dist/src/utils/index.js.map +1 -0
  137. package/dist/src/utils/objectMappingUtils.d.ts +166 -0
  138. package/dist/src/utils/objectMappingUtils.d.ts.map +1 -0
  139. package/dist/src/utils/objectMappingUtils.js +191 -0
  140. package/dist/src/utils/objectMappingUtils.js.map +1 -0
  141. package/dist/tsconfig.tsbuildinfo +1 -1
  142. package/package.json +2 -1
  143. package/src/__generated__/default_templates/DOCUMENT_RELEVANCE_CLASSIFICATION_EVALUATOR_CONFIG.ts +39 -0
  144. package/src/__generated__/default_templates/HALLUCINATION_CLASSIFICATION_EVALUATOR_CONFIG.ts +45 -0
  145. package/src/__generated__/default_templates/index.ts +4 -0
  146. package/src/__generated__/types.ts +11 -0
  147. package/src/core/EvaluatorBase.ts +43 -0
  148. package/src/index.ts +1 -0
  149. package/src/llm/ClassificationEvaluator.ts +39 -3
  150. package/src/llm/LLMEvaluator.ts +7 -16
  151. package/src/llm/createClassificationEvaluator.ts +1 -1
  152. package/src/llm/createDocumentRelevanceEvaluator.ts +79 -0
  153. package/src/llm/createHallucinationEvaluator.ts +17 -19
  154. package/src/llm/index.ts +1 -1
  155. package/src/types/data.ts +200 -0
  156. package/src/types/evals.ts +25 -5
  157. package/src/types/index.ts +1 -0
  158. package/src/types/otel.ts +15 -13
  159. package/src/utils/bindEvaluator.ts +229 -0
  160. package/src/utils/index.ts +1 -0
  161. package/src/utils/objectMappingUtils.ts +202 -0
  162. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
  163. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
  164. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -25
  165. package/dist/esm/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
  166. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
  167. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
  168. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js +0 -31
  169. package/dist/esm/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
  170. package/dist/esm/default_templates/index.d.ts +0 -3
  171. package/dist/esm/default_templates/index.d.ts.map +0 -1
  172. package/dist/esm/default_templates/index.js +0 -3
  173. package/dist/esm/default_templates/index.js.map +0 -1
  174. package/dist/esm/llm/createDocumentRelevancyEvaluator.d.ts +0 -43
  175. package/dist/esm/llm/createDocumentRelevancyEvaluator.d.ts.map +0 -1
  176. package/dist/esm/llm/createDocumentRelevancyEvaluator.js.map +0 -1
  177. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts +0 -6
  178. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map +0 -1
  179. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js +0 -28
  180. package/dist/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.js.map +0 -1
  181. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts +0 -6
  182. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.d.ts.map +0 -1
  183. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js +0 -34
  184. package/dist/src/default_templates/HALLUCINATION_TEMPLATE.js.map +0 -1
  185. package/dist/src/default_templates/index.d.ts +0 -3
  186. package/dist/src/default_templates/index.d.ts.map +0 -1
  187. package/dist/src/default_templates/index.js.map +0 -1
  188. package/dist/src/llm/createDocumentRelevancyEvaluator.d.ts +0 -43
  189. package/dist/src/llm/createDocumentRelevancyEvaluator.d.ts.map +0 -1
  190. package/dist/src/llm/createDocumentRelevancyEvaluator.js.map +0 -1
  191. package/src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts +0 -25
  192. package/src/default_templates/HALLUCINATION_TEMPLATE.ts +0 -31
  193. package/src/default_templates/index.ts +0 -2
  194. package/src/llm/createDocumentRelevancyEvaluator.ts +0 -77
@@ -0,0 +1,229 @@
1
+ import { EvaluatorBase } from "../core/EvaluatorBase";
2
+ import { ObjectMapping } from "../types/data";
3
+
4
+ /**
5
+ * Context for binding an evaluator with input mapping configuration.
6
+ *
7
+ * This type defines the structure for binding an evaluator to a specific data shape
8
+ * by mapping the evaluator's expected input fields to the actual data structure.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Map evaluator fields to your data structure
13
+ * const context: BindingContext<MyDataType> = {
14
+ * inputMapping: {
15
+ * input: "userQuery", // Maps "input" to "userQuery" field
16
+ * reference: "context", // Maps "reference" to "context" field
17
+ * output: "modelResponse", // Maps "output" to "modelResponse" field
18
+ * },
19
+ * };
20
+ * ```
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Using nested property access
25
+ * const context: BindingContext<ApiResponse> = {
26
+ * inputMapping: {
27
+ * input: "request.body.query",
28
+ * reference: "request.body.context",
29
+ * output: "response.data.text",
30
+ * },
31
+ * };
32
+ * ```
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * // Using function-based mapping for transformations
37
+ * const context: BindingContext<RawData> = {
38
+ * inputMapping: {
39
+ * input: "question",
40
+ * reference: (data) => data.context.join("\n"), // Transform array to string
41
+ * output: "answer",
42
+ * },
43
+ * };
44
+ * ```
45
+ *
46
+ * @typeParam RecordType - The type of the data record that will be evaluated
47
+ */
48
+ export type BindingContext<RecordType extends Record<string, unknown>> = {
49
+ /**
50
+ * Mapping of evaluator input fields to data source fields.
51
+ *
52
+ * The keys represent the field names expected by the evaluator (e.g., "input", "output", "reference"),
53
+ * and the values specify how to extract those fields from your data structure.
54
+ *
55
+ * Supports:
56
+ * - Simple property names: `"fieldName"`
57
+ * - Dot notation: `"user.profile.name"`
58
+ * - Array access: `"items[0].id"`
59
+ * - JSONPath expressions: `"$.items[*].id"`
60
+ * - Function extractors: `(data) => data.customField.toUpperCase()`
61
+ */
62
+ inputMapping: ObjectMapping<RecordType>;
63
+ };
64
+
65
+ /**
66
+ * Binds an evaluator to a specific data structure using input mapping.
67
+ *
68
+ * This function creates a new evaluator instance that automatically transforms
69
+ * your data structure to match what the evaluator expects. This is particularly
70
+ * useful when your data schema doesn't match the evaluator's expected input format.
71
+ *
72
+ * @param evaluator - The evaluator to bind (e.g., a hallucination evaluator)
73
+ * @param context - The binding context containing the input mapping configuration
74
+ * @returns A new evaluator instance with the input mapping applied
75
+ *
76
+ * @example
77
+ * **Basic usage with simple field mapping:**
78
+ * ```typescript
79
+ * import { bindEvaluator, createHallucinationEvaluator } from "@arizeai/phoenix-evals";
80
+ * import { openai } from "@ai-sdk/openai";
81
+ *
82
+ * type MyData = {
83
+ * question: string;
84
+ * context: string;
85
+ * answer: string;
86
+ * };
87
+ *
88
+ * const evaluator = bindEvaluator<MyData>(
89
+ * createHallucinationEvaluator({ model: openai("gpt-4") }),
90
+ * {
91
+ * inputMapping: {
92
+ * input: "question", // Evaluator expects "input", map from "question"
93
+ * reference: "context", // Evaluator expects "reference", map from "context"
94
+ * output: "answer", // Evaluator expects "output", map from "answer"
95
+ * },
96
+ * }
97
+ * );
98
+ *
99
+ * // Now you can evaluate with your data structure
100
+ * const result = await evaluator.evaluate({
101
+ * question: "What is AI?",
102
+ * context: "AI is artificial intelligence...",
103
+ * answer: "AI stands for artificial intelligence",
104
+ * });
105
+ * ```
106
+ *
107
+ * @example
108
+ * **Using nested property access:**
109
+ * ```typescript
110
+ * type ApiResponse = {
111
+ * request: {
112
+ * body: {
113
+ * query: string;
114
+ * context: string;
115
+ * };
116
+ * };
117
+ * response: {
118
+ * data: {
119
+ * text: string;
120
+ * };
121
+ * };
122
+ * };
123
+ *
124
+ * const evaluator = bindEvaluator<ApiResponse>(
125
+ * createHallucinationEvaluator({ model: openai("gpt-4") }),
126
+ * {
127
+ * inputMapping: {
128
+ * input: "request.body.query",
129
+ * reference: "request.body.context",
130
+ * output: "response.data.text",
131
+ * },
132
+ * }
133
+ * );
134
+ * ```
135
+ *
136
+ * @example
137
+ * **Using function-based mapping for data transformation:**
138
+ * ```typescript
139
+ * type RawData = {
140
+ * question: string;
141
+ * contexts: string[]; // Array of context strings
142
+ * answer: string;
143
+ * };
144
+ *
145
+ * const evaluator = bindEvaluator<RawData>(
146
+ * createHallucinationEvaluator({ model: openai("gpt-4") }),
147
+ * {
148
+ * inputMapping: {
149
+ * input: "question",
150
+ * // Transform array to single string
151
+ * reference: (data) => data.contexts.join("\n\n"),
152
+ * output: "answer",
153
+ * },
154
+ * }
155
+ * );
156
+ * ```
157
+ *
158
+ * @example
159
+ * **Using JSONPath for complex queries:**
160
+ * ```typescript
161
+ * type ComplexData = {
162
+ * conversation: {
163
+ * messages: Array<{ role: string; content: string }>;
164
+ * };
165
+ * metadata: {
166
+ * sources: string[];
167
+ * };
168
+ * };
169
+ *
170
+ * const evaluator = bindEvaluator<ComplexData>(
171
+ * createHallucinationEvaluator({ model: openai("gpt-4") }),
172
+ * {
173
+ * inputMapping: {
174
+ * // Extract last user message
175
+ * input: "$.conversation.messages[?(@.role=='user')].content[-1]",
176
+ * // Extract all sources
177
+ * reference: "$.metadata.sources[*]",
178
+ * // Extract last assistant message
179
+ * output: "$.conversation.messages[?(@.role=='assistant')].content[-1]",
180
+ * },
181
+ * }
182
+ * );
183
+ * ```
184
+ *
185
+ * @example
186
+ * **Binding multiple evaluators with different mappings:**
187
+ * ```typescript
188
+ * type EvaluationData = {
189
+ * userQuery: string;
190
+ * systemContext: string;
191
+ * modelOutput: string;
192
+ * expectedOutput?: string;
193
+ * };
194
+ *
195
+ * // Hallucination evaluator
196
+ * const hallucinationEvaluator = bindEvaluator<EvaluationData>(
197
+ * createHallucinationEvaluator({ model: openai("gpt-4") }),
198
+ * {
199
+ * inputMapping: {
200
+ * input: "userQuery",
201
+ * reference: "systemContext",
202
+ * output: "modelOutput",
203
+ * },
204
+ * }
205
+ * );
206
+ *
207
+ * // Document relevancy evaluator (if it exists)
208
+ * const relevancyEvaluator = bindEvaluator<EvaluationData>(
209
+ * createDocumentRelevanceEvaluator({ model: openai("gpt-4") }),
210
+ * {
211
+ * inputMapping: {
212
+ * query: "userQuery",
213
+ * document: "systemContext",
214
+ * output: "modelOutput",
215
+ * },
216
+ * }
217
+ * );
218
+ * ```
219
+ */
220
+ export function bindEvaluator<RecordType extends Record<string, unknown>>(
221
+ evaluator: EvaluatorBase<RecordType>,
222
+ context: BindingContext<RecordType>
223
+ ): EvaluatorBase<RecordType> {
224
+ let boundEvaluator: EvaluatorBase<RecordType> = evaluator;
225
+ if (context.inputMapping) {
226
+ boundEvaluator = boundEvaluator.bindInputMapping(context.inputMapping);
227
+ }
228
+ return boundEvaluator;
229
+ }
@@ -0,0 +1 @@
1
+ export * from "./bindEvaluator";
@@ -0,0 +1,202 @@
1
+ import { ObjectMapping, ValueGetter } from "../types/data";
2
+
3
+ import { JSONPath } from "jsonpath-plus";
4
+
5
+ /**
6
+ * Remaps an object by applying field mappings while preserving original data.
7
+ *
8
+ * This function takes your original data object and a mapping configuration,
9
+ * then returns a new object that contains:
10
+ * - All original fields from the input data
11
+ * - Additional/overridden fields based on the mapping
12
+ *
13
+ * The mapping allows you to extract values using:
14
+ * - Simple property names: `"fieldName"`
15
+ * - Dot notation: `"user.profile.name"`
16
+ * - Array access: `"items[0].id"`
17
+ * - JSONPath expressions: `"$.items[*].id"`
18
+ * - Function extractors: `(data) => data.customField`
19
+ *
20
+ * @param data - The input data object to remap
21
+ * @param mapping - The mapping configuration defining how to extract/transform values
22
+ * @returns A new object with original fields plus mapped fields
23
+ *
24
+ * @example
25
+ * **Basic remapping:**
26
+ * ```typescript
27
+ * const data = {
28
+ * name: "John",
29
+ * age: 30,
30
+ * email: "john@example.com",
31
+ * };
32
+ *
33
+ * const mapping: ObjectMapping<typeof data> = {
34
+ * userName: "name",
35
+ * userAge: "age",
36
+ * };
37
+ *
38
+ * const result = remapObject(data, mapping);
39
+ * // Result: {
40
+ * // name: "John",
41
+ * // age: 30,
42
+ * // email: "john@example.com",
43
+ * // userName: "John", // Added from mapping
44
+ * // userAge: 30, // Added from mapping
45
+ * // }
46
+ * ```
47
+ *
48
+ * @example
49
+ * **Nested property extraction:**
50
+ * ```typescript
51
+ * const data = {
52
+ * user: {
53
+ * profile: {
54
+ * firstName: "John",
55
+ * lastName: "Doe",
56
+ * },
57
+ * email: "john@example.com",
58
+ * },
59
+ * };
60
+ *
61
+ * const mapping: ObjectMapping<typeof data> = {
62
+ * firstName: "user.profile.firstName",
63
+ * lastName: "user.profile.lastName",
64
+ * email: "user.email",
65
+ * };
66
+ *
67
+ * const result = remapObject(data, mapping);
68
+ * // Result includes original data plus:
69
+ * // {
70
+ * // firstName: "John",
71
+ * // lastName: "Doe",
72
+ * // email: "john@example.com",
73
+ * // }
74
+ * ```
75
+ *
76
+ * @example
77
+ * **Array element access:**
78
+ * ```typescript
79
+ * const data = {
80
+ * items: [
81
+ * { id: 1, name: "Apple" },
82
+ * { id: 2, name: "Banana" },
83
+ * ],
84
+ * };
85
+ *
86
+ * const mapping: ObjectMapping<typeof data> = {
87
+ * firstItemId: "items[0].id",
88
+ * firstItemName: "items[0].name",
89
+ * };
90
+ *
91
+ * const result = remapObject(data, mapping);
92
+ * // Result includes:
93
+ * // {
94
+ * // firstItemId: 1,
95
+ * // firstItemName: "Apple",
96
+ * // }
97
+ * ```
98
+ *
99
+ * @example
100
+ * **Function-based transformation:**
101
+ * ```typescript
102
+ * const data = {
103
+ * firstName: "John",
104
+ * lastName: "Doe",
105
+ * scores: [85, 92, 78],
106
+ * };
107
+ *
108
+ * const mapping: ObjectMapping<typeof data> = {
109
+ * fullName: (data) => `${data.firstName} ${data.lastName}`,
110
+ * averageScore: (data) =>
111
+ * data.scores.reduce((a, b) => a + b, 0) / data.scores.length,
112
+ * };
113
+ *
114
+ * const result = remapObject(data, mapping);
115
+ * // Result includes:
116
+ * // {
117
+ * // fullName: "John Doe",
118
+ * // averageScore: 85,
119
+ * // }
120
+ * ```
121
+ *
122
+ * @example
123
+ * **Field override:**
124
+ * ```typescript
125
+ * const data = {
126
+ * name: "John",
127
+ * status: "inactive",
128
+ * };
129
+ *
130
+ * const mapping: ObjectMapping<typeof data> = {
131
+ * // Override existing field
132
+ * status: (data) => data.name === "John" ? "active" : "inactive",
133
+ * // Add new field
134
+ * displayName: (data) => `User: ${data.name}`,
135
+ * };
136
+ *
137
+ * const result = remapObject(data, mapping);
138
+ * // Result:
139
+ * // {
140
+ * // name: "John",
141
+ * // status: "active", // Overridden
142
+ * // displayName: "User: John", // Added
143
+ * // }
144
+ * ```
145
+ *
146
+ * @example
147
+ * **Real-world evaluator usage:**
148
+ * ```typescript
149
+ * // Your data structure
150
+ * const example = {
151
+ * question: "What is AI?",
152
+ * context: "AI is artificial intelligence...",
153
+ * answer: "AI stands for artificial intelligence",
154
+ * };
155
+ *
156
+ * // Evaluator expects: { input, reference, output }
157
+ * const mapping: ObjectMapping<typeof example> = {
158
+ * input: "question",
159
+ * reference: "context",
160
+ * output: "answer",
161
+ * };
162
+ *
163
+ * const remapped = remapObject(example, mapping);
164
+ * // Now remapped has: { question, context, answer, input, reference, output }
165
+ * // The evaluator can access input, reference, and output fields
166
+ * ```
167
+ */
168
+ export function remapObject<DataType extends Record<string, unknown>>(
169
+ data: DataType,
170
+ mapping: ObjectMapping<DataType>
171
+ ): DataType {
172
+ return {
173
+ ...data,
174
+ ...Object.fromEntries(
175
+ Object.entries(mapping).map(([key, value]) => [
176
+ key,
177
+ getMappedObjectValue(data, value),
178
+ ])
179
+ ),
180
+ };
181
+ }
182
+
183
+ /**
184
+ * Extracts a value from a data object using a value getter.
185
+ *
186
+ * This internal function handles the actual extraction logic, supporting both
187
+ * string-based paths (including JSONPath) and function-based extractors.
188
+ *
189
+ * @param data - The data object to extract from
190
+ * @param valueGetter - The value getter (string path or function)
191
+ * @returns The extracted value
192
+ *
193
+ * @internal
194
+ */
195
+ function getMappedObjectValue<DataType extends Record<string, unknown>>(
196
+ data: DataType,
197
+ valueGetter: ValueGetter<DataType>
198
+ ): DataType[keyof DataType] {
199
+ return typeof valueGetter === "function"
200
+ ? valueGetter(data)
201
+ : JSONPath({ path: valueGetter, json: data, wrap: false });
202
+ }
@@ -1,6 +0,0 @@
1
- export declare const DOCUMENT_RELEVANCY_TEMPLATE = "\nYou are comparing a document to a question and trying to determine if the document text\ncontains information relevant to answering the question. Here is the data:\n\n [BEGIN DATA]\n ************\n [Question]: {{input}}\n ************\n [Document text]: {{documentText}}\n ************\n [END DATA]\n\nCompare the Question above to the Document text. You must determine whether the Document text\ncontains information that can answer the Question. Please focus on whether the very specific\nquestion can be answered by the information in the Document text.\nYour response must be single word, either \"relevant\" or \"unrelated\",\nand should not contain any text or characters aside from that word.\n\"unrelated\" means that the document text does not contain an answer to the Question.\n\"relevant\" means the document text contains an answer to the Question.\n";
2
- export declare const DOCUMENT_RELEVANCY_CHOICES: {
3
- relevant: number;
4
- unrelated: number;
5
- };
6
- //# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,23BAmBvC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC"}
@@ -1,25 +0,0 @@
1
- export const DOCUMENT_RELEVANCY_TEMPLATE = `
2
- You are comparing a document to a question and trying to determine if the document text
3
- contains information relevant to answering the question. Here is the data:
4
-
5
- [BEGIN DATA]
6
- ************
7
- [Question]: {{input}}
8
- ************
9
- [Document text]: {{documentText}}
10
- ************
11
- [END DATA]
12
-
13
- Compare the Question above to the Document text. You must determine whether the Document text
14
- contains information that can answer the Question. Please focus on whether the very specific
15
- question can be answered by the information in the Document text.
16
- Your response must be single word, either "relevant" or "unrelated",
17
- and should not contain any text or characters aside from that word.
18
- "unrelated" means that the document text does not contain an answer to the Question.
19
- "relevant" means the document text contains an answer to the Question.
20
- `;
21
- export const DOCUMENT_RELEVANCY_CHOICES = {
22
- relevant: 1,
23
- unrelated: 0,
24
- };
25
- //# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;CAmB1C,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACb,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const HALLUCINATION_TEMPLATE = "\nIn this task, you will be presented with a query, a reference text and an answer. The answer is\ngenerated to the question based on the reference text. The answer may contain false information. You\nmust use the reference text to determine if the answer to the question contains false information,\nif the answer is a hallucination of facts. Your objective is to determine whether the answer text\ncontains factual information and is not a hallucination. A 'hallucination' refers to\nan answer that is not based on the reference text or assumes information that is not available in\nthe reference text. Your response should be a single word: either \"factual\" or \"hallucinated\", and\nit should not include any other text or characters. \"hallucinated\" indicates that the answer\nprovides factually inaccurate information to the query based on the reference text. \"factual\"\nindicates that the answer to the question is correct relative to the reference text, and does not\ncontain made up information. Please read the query and reference text carefully before determining\nyour response.\n\n [BEGIN DATA]\n ************\n [Query]: {{input}}\n ************\n [Reference text]: {{reference}}\n ************\n [Answer]: {{output}}\n ************\n [END DATA]\n\nIs the answer above factual or hallucinated based on the query and reference text?\n";
2
- export declare const HALLUCINATION_CHOICES: {
3
- hallucinated: number;
4
- factual: number;
5
- };
6
- //# sourceMappingURL=HALLUCINATION_TEMPLATE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HALLUCINATION_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,u2CAyBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
@@ -1,31 +0,0 @@
1
- export const HALLUCINATION_TEMPLATE = `
2
- In this task, you will be presented with a query, a reference text and an answer. The answer is
3
- generated to the question based on the reference text. The answer may contain false information. You
4
- must use the reference text to determine if the answer to the question contains false information,
5
- if the answer is a hallucination of facts. Your objective is to determine whether the answer text
6
- contains factual information and is not a hallucination. A 'hallucination' refers to
7
- an answer that is not based on the reference text or assumes information that is not available in
8
- the reference text. Your response should be a single word: either "factual" or "hallucinated", and
9
- it should not include any other text or characters. "hallucinated" indicates that the answer
10
- provides factually inaccurate information to the query based on the reference text. "factual"
11
- indicates that the answer to the question is correct relative to the reference text, and does not
12
- contain made up information. Please read the query and reference text carefully before determining
13
- your response.
14
-
15
- [BEGIN DATA]
16
- ************
17
- [Query]: {{input}}
18
- ************
19
- [Reference text]: {{reference}}
20
- ************
21
- [Answer]: {{output}}
22
- ************
23
- [END DATA]
24
-
25
- Is the answer above factual or hallucinated based on the query and reference text?
26
- `;
27
- export const HALLUCINATION_CHOICES = {
28
- hallucinated: 1,
29
- factual: 0,
30
- };
31
- //# sourceMappingURL=HALLUCINATION_TEMPLATE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HALLUCINATION_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;CACX,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE.js";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./HALLUCINATION_TEMPLATE.js";
2
- export * from "./DOCUMENT_RELEVANCY_TEMPLATE.js";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/default_templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC"}
@@ -1,43 +0,0 @@
1
- import { CreateClassificationEvaluatorArgs, Evaluator } from "../types/evals.js";
2
- export interface DocumentRelevancyEvaluatorArgs extends Omit<CreateClassificationEvaluatorArgs, "promptTemplate" | "choices" | "optimizationDirection" | "name"> {
3
- optimizationDirection?: CreateClassificationEvaluatorArgs["optimizationDirection"];
4
- name?: CreateClassificationEvaluatorArgs["name"];
5
- choices?: CreateClassificationEvaluatorArgs["choices"];
6
- promptTemplate?: CreateClassificationEvaluatorArgs["promptTemplate"];
7
- }
8
- /**
9
- * A record to be evaluated by the document relevancy evaluator.
10
- */
11
- export interface DocumentRelevancyEvaluationRecord {
12
- input: string;
13
- documentText: string;
14
- [key: string]: unknown;
15
- }
16
- /**
17
- * Creates a document relevancy evaluator function.
18
- *
19
- * This function returns an evaluator that determines whether a given document text
20
- * is relevant to a provided input question. The evaluator uses a classification model
21
- * and a prompt template to make its determination.
22
- *
23
- * @param args - The arguments for creating the document relevancy evaluator.
24
- * @param args.model - The model to use for classification.
25
- * @param args.choices - The possible classification choices (defaults to DOCUMENT_RELEVANCY_CHOICES).
26
- * @param args.promptTemplate - The prompt template to use (defaults to DOCUMENT_RELEVANCY_TEMPLATE).
27
- * @param args.telemetry - The telemetry to use for the evaluator.
28
- *
29
- * @returns An evaluator function that takes a {@link DocumentRelevancyExample} and returns a classification result
30
- * indicating whether the document is relevant to the input question.
31
- *
32
- * @example
33
- * ```ts
34
- * const evaluator = createDocumentRelevancyEvaluator({ model: openai("gpt-4o-mini") });
35
- * const result = await evaluator.evaluate({
36
- * input: "What is the capital of France?",
37
- * documentText: "Paris is the capital and most populous city of France.",
38
- * });
39
- * console.log(result.label); // "relevant" or "unrelated"
40
- * ```
41
- */
42
- export declare function createDocumentRelevancyEvaluator<RecordType extends Record<string, unknown> = DocumentRelevancyEvaluationRecord>(args: DocumentRelevancyEvaluatorArgs): Evaluator<RecordType>;
43
- //# sourceMappingURL=createDocumentRelevancyEvaluator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDocumentRelevancyEvaluator.d.ts","sourceRoot":"","sources":["../../../src/llm/createDocumentRelevancyEvaluator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAiC,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI9E,MAAM,WAAW,8BACf,SAAQ,IAAI,CACV,iCAAiC,EACjC,gBAAgB,GAAG,SAAS,GAAG,uBAAuB,GAAG,MAAM,CAChE;IACD,qBAAqB,CAAC,EAAE,iCAAiC,CAAC,uBAAuB,CAAC,CAAC;IACnF,IAAI,CAAC,EAAE,iCAAiC,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,iCAAiC,CAAC,SAAS,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,iCAAiC,CAAC,gBAAgB,CAAC,CAAC;CACtE;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,SAAS,MAAM,CACvB,MAAM,EACN,OAAO,CACR,GAAG,iCAAiC,EACrC,IAAI,EAAE,8BAA8B,GAAG,SAAS,CAAC,UAAU,CAAC,CAiB7D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDocumentRelevancyEvaluator.js","sourceRoot":"","sources":["../../../src/llm/createDocumentRelevancyEvaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,kDAAkD,CAAC;AAG1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAsBhF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,gCAAgC,CAK9C,IAAoC;IACpC,MAAM,EACJ,OAAO,GAAG,0BAA0B,EACpC,cAAc,GAAG,2BAA2B,EAC5C,qBAAqB,GAAG,UAAU,EAClC,IAAI,GAAG,oBAAoB,EAC3B,GAAG,IAAI,EACR,GAAG,IAAI,CAAC;IAET,OAAO,6BAA6B,CAAa;QAC/C,GAAG,IAAI;QACP,cAAc;QACd,OAAO;QACP,qBAAqB;QACrB,IAAI;QACJ,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const DOCUMENT_RELEVANCY_TEMPLATE = "\nYou are comparing a document to a question and trying to determine if the document text\ncontains information relevant to answering the question. Here is the data:\n\n [BEGIN DATA]\n ************\n [Question]: {{input}}\n ************\n [Document text]: {{documentText}}\n ************\n [END DATA]\n\nCompare the Question above to the Document text. You must determine whether the Document text\ncontains information that can answer the Question. Please focus on whether the very specific\nquestion can be answered by the information in the Document text.\nYour response must be single word, either \"relevant\" or \"unrelated\",\nand should not contain any text or characters aside from that word.\n\"unrelated\" means that the document text does not contain an answer to the Question.\n\"relevant\" means the document text contains an answer to the Question.\n";
2
- export declare const DOCUMENT_RELEVANCY_CHOICES: {
3
- relevant: number;
4
- unrelated: number;
5
- };
6
- //# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,23BAmBvC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DOCUMENT_RELEVANCY_CHOICES = exports.DOCUMENT_RELEVANCY_TEMPLATE = void 0;
4
- exports.DOCUMENT_RELEVANCY_TEMPLATE = `
5
- You are comparing a document to a question and trying to determine if the document text
6
- contains information relevant to answering the question. Here is the data:
7
-
8
- [BEGIN DATA]
9
- ************
10
- [Question]: {{input}}
11
- ************
12
- [Document text]: {{documentText}}
13
- ************
14
- [END DATA]
15
-
16
- Compare the Question above to the Document text. You must determine whether the Document text
17
- contains information that can answer the Question. Please focus on whether the very specific
18
- question can be answered by the information in the Document text.
19
- Your response must be single word, either "relevant" or "unrelated",
20
- and should not contain any text or characters aside from that word.
21
- "unrelated" means that the document text does not contain an answer to the Question.
22
- "relevant" means the document text contains an answer to the Question.
23
- `;
24
- exports.DOCUMENT_RELEVANCY_CHOICES = {
25
- relevant: 1,
26
- unrelated: 0,
27
- };
28
- //# sourceMappingURL=DOCUMENT_RELEVANCY_TEMPLATE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DOCUMENT_RELEVANCY_TEMPLATE.js","sourceRoot":"","sources":["../../../src/default_templates/DOCUMENT_RELEVANCY_TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;CAmB1C,CAAC;AAEW,QAAA,0BAA0B,GAAG;IACxC,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;CACb,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const HALLUCINATION_TEMPLATE = "\nIn this task, you will be presented with a query, a reference text and an answer. The answer is\ngenerated to the question based on the reference text. The answer may contain false information. You\nmust use the reference text to determine if the answer to the question contains false information,\nif the answer is a hallucination of facts. Your objective is to determine whether the answer text\ncontains factual information and is not a hallucination. A 'hallucination' refers to\nan answer that is not based on the reference text or assumes information that is not available in\nthe reference text. Your response should be a single word: either \"factual\" or \"hallucinated\", and\nit should not include any other text or characters. \"hallucinated\" indicates that the answer\nprovides factually inaccurate information to the query based on the reference text. \"factual\"\nindicates that the answer to the question is correct relative to the reference text, and does not\ncontain made up information. Please read the query and reference text carefully before determining\nyour response.\n\n [BEGIN DATA]\n ************\n [Query]: {{input}}\n ************\n [Reference text]: {{reference}}\n ************\n [Answer]: {{output}}\n ************\n [END DATA]\n\nIs the answer above factual or hallucinated based on the query and reference text?\n";
2
- export declare const HALLUCINATION_CHOICES: {
3
- hallucinated: number;
4
- factual: number;
5
- };
6
- //# sourceMappingURL=HALLUCINATION_TEMPLATE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HALLUCINATION_TEMPLATE.d.ts","sourceRoot":"","sources":["../../../src/default_templates/HALLUCINATION_TEMPLATE.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,u2CAyBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}