n8n-nodes-base 1.100.1 → 1.101.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 (75) hide show
  1. package/dist/nodes/EmailReadImap/EmailReadImap.node.d.ts.map +1 -1
  2. package/dist/nodes/EmailReadImap/EmailReadImap.node.js +2 -1
  3. package/dist/nodes/EmailReadImap/EmailReadImap.node.js.map +1 -1
  4. package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
  5. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.d.ts.map +1 -1
  6. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +39 -15
  7. package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
  8. package/dist/nodes/EmailReadImap/v2/utils.d.ts +10 -3
  9. package/dist/nodes/EmailReadImap/v2/utils.d.ts.map +1 -1
  10. package/dist/nodes/EmailReadImap/v2/utils.js +120 -99
  11. package/dist/nodes/EmailReadImap/v2/utils.js.map +1 -1
  12. package/dist/nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.d.ts +5 -0
  13. package/dist/nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.d.ts.map +1 -0
  14. package/dist/nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.js +155 -0
  15. package/dist/nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.js.map +1 -0
  16. package/dist/nodes/Evaluation/Evaluation/Description.node.d.ts.map +1 -1
  17. package/dist/nodes/Evaluation/Evaluation/Description.node.js +253 -1
  18. package/dist/nodes/Evaluation/Evaluation/Description.node.js.map +1 -1
  19. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.d.ts.map +1 -1
  20. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js +2 -3
  21. package/dist/nodes/Evaluation/Evaluation/Evaluation.node.ee.js.map +1 -1
  22. package/dist/nodes/Evaluation/utils/evaluationUtils.d.ts +9 -0
  23. package/dist/nodes/Evaluation/utils/evaluationUtils.d.ts.map +1 -1
  24. package/dist/nodes/Evaluation/utils/evaluationUtils.js +17 -16
  25. package/dist/nodes/Evaluation/utils/evaluationUtils.js.map +1 -1
  26. package/dist/nodes/Evaluation/utils/metricHandlers.d.ts +10 -0
  27. package/dist/nodes/Evaluation/utils/metricHandlers.d.ts.map +1 -0
  28. package/dist/nodes/Evaluation/utils/metricHandlers.js +255 -0
  29. package/dist/nodes/Evaluation/utils/metricHandlers.js.map +1 -0
  30. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.d.ts.map +1 -1
  31. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js +11 -1
  32. package/dist/nodes/ExecuteWorkflow/ExecuteWorkflow/ExecuteWorkflow.node.js.map +1 -1
  33. package/dist/nodes/Form/Form.node.js +1 -1
  34. package/dist/nodes/Form/Form.node.js.map +1 -1
  35. package/dist/nodes/Github/Github.node.d.ts.map +1 -1
  36. package/dist/nodes/Github/Github.node.js +3 -2
  37. package/dist/nodes/Github/Github.node.js.map +1 -1
  38. package/dist/nodes/Github/SearchFunctions.d.ts.map +1 -1
  39. package/dist/nodes/Github/SearchFunctions.js +10 -1
  40. package/dist/nodes/Github/SearchFunctions.js.map +1 -1
  41. package/dist/nodes/Google/Gmail/v2/GmailV2.node.js +1 -1
  42. package/dist/nodes/Google/Gmail/v2/GmailV2.node.js.map +1 -1
  43. package/dist/nodes/Google/Gmail/v2/utils/draft.d.ts.map +1 -1
  44. package/dist/nodes/Google/Gmail/v2/utils/draft.js +14 -6
  45. package/dist/nodes/Google/Gmail/v2/utils/draft.js.map +1 -1
  46. package/dist/nodes/Linear/IssueDescription.d.ts.map +1 -1
  47. package/dist/nodes/Linear/IssueDescription.js +89 -0
  48. package/dist/nodes/Linear/IssueDescription.js.map +1 -1
  49. package/dist/nodes/Linear/Linear.node.js +1 -1
  50. package/dist/nodes/Linear/Linear.node.js.map +1 -1
  51. package/dist/nodes/Perplexity/descriptions/chat/complete.operation.js +2 -2
  52. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.d.ts.map +1 -1
  53. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js +68 -17
  54. package/dist/nodes/RespondToWebhook/RespondToWebhook.node.js.map +1 -1
  55. package/dist/nodes/RespondToWebhook/utils/binary.d.ts +6 -0
  56. package/dist/nodes/RespondToWebhook/utils/binary.d.ts.map +1 -0
  57. package/dist/nodes/RespondToWebhook/utils/binary.js +38 -0
  58. package/dist/nodes/RespondToWebhook/utils/binary.js.map +1 -0
  59. package/dist/nodes/RespondToWebhook/{utils.d.ts → utils/outputs.d.ts} +1 -1
  60. package/dist/nodes/RespondToWebhook/utils/outputs.d.ts.map +1 -0
  61. package/dist/nodes/RespondToWebhook/{utils.js → utils/outputs.js} +1 -1
  62. package/dist/nodes/RespondToWebhook/utils/outputs.js.map +1 -0
  63. package/dist/nodes/Webhook/utils.js +1 -1
  64. package/dist/nodes/Webhook/utils.js.map +1 -1
  65. package/dist/typecheck.tsbuildinfo +1 -1
  66. package/dist/types/nodes.json +10 -10
  67. package/dist/utils/sendAndWait/interfaces.d.ts +1 -0
  68. package/dist/utils/sendAndWait/interfaces.d.ts.map +1 -1
  69. package/dist/utils/workflow-backtracking.d.ts +8 -0
  70. package/dist/utils/workflow-backtracking.d.ts.map +1 -0
  71. package/dist/utils/workflow-backtracking.js +86 -0
  72. package/dist/utils/workflow-backtracking.js.map +1 -0
  73. package/package.json +8 -7
  74. package/dist/nodes/RespondToWebhook/utils.d.ts.map +0 -1
  75. package/dist/nodes/RespondToWebhook/utils.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CannedMetricPrompts.ee.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,g+JAqEwC,CAAC;AAExE,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAK5C,CAAC;AAEF,eAAO,MAAM,kBAAkB,2lIAoEoD,CAAC;AAEpF,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAK5C,CAAC"}
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HELPFULNESS_INPUT_PROMPT = exports.HELPFULNESS_PROMPT = exports.CORRECTNESS_INPUT_PROMPT = exports.CORRECTNESS_PROMPT = void 0;
4
+ exports.CORRECTNESS_PROMPT = `You are an expert factual evaluator assessing the accuracy of answers compared to established ground truths.
5
+
6
+ Evaluate the factual correctness of a given output compared to the provided ground truth on a scale from 1 to 5. Use detailed reasoning to thoroughly analyze all claims before determining the final score.
7
+
8
+ # Scoring Criteria
9
+
10
+ - 5: Highly similar - The output and ground truth are nearly identical, with only minor, insignificant differences.
11
+ - 4: Somewhat similar - The output is largely similar to the ground truth but has few noticeable differences.
12
+ - 3: Moderately similar - There are some evident differences, but the core essence is captured in the output.
13
+ - 2: Slightly similar - The output only captures a few elements of the ground truth and contains several differences.
14
+ - 1: Not similar - The output is significantly different from the ground truth, with few or no matching elements.
15
+
16
+ # Evaluation Steps
17
+
18
+ 1. Identify and list the key elements present in both the output and the ground truth.
19
+ 2. Compare these key elements to evaluate their similarities and differences, considering both content and structure.
20
+ 3. Analyze the semantic meaning conveyed by both the output and the ground truth, noting any significant deviations.
21
+ 4. Consider factual accuracy of specific details, including names, dates, numbers, and relationships.
22
+ 5. Assess whether the output maintains the factual integrity of the ground truth, even if phrased differently.
23
+ 6. Determine the overall level of similarity and accuracy according to the defined criteria.
24
+
25
+ # Output Format
26
+
27
+ Provide:
28
+ - A detailed analysis of the comparison (extended reasoning)
29
+ - A one-sentence summary highlighting key differences (not similarities)
30
+ - The final similarity score as an integer (1, 2, 3, 4, or 5)
31
+
32
+ Always follow the JSON format below and return nothing else:
33
+ {
34
+ "extended_reasoning": "<detailed step-by-step analysis of factual accuracy and similarity>",
35
+ "reasoning_summary": "<one sentence summary focusing on key differences>",
36
+ "score": <number: integer from 1 to 5>
37
+ }
38
+
39
+ # Examples
40
+
41
+ **Example 1:**
42
+
43
+ Input:
44
+ - Output: "The cat sat on the mat."
45
+ - Ground Truth: "The feline is sitting on the rug."
46
+
47
+ Expected Output:
48
+ {
49
+ "extended_reasoning": "I need to compare 'The cat sat on the mat' with 'The feline is sitting on the rug.' First, let me identify the key elements: both describe an animal ('cat' vs 'feline') in a position ('sat' vs 'sitting') on a surface ('mat' vs 'rug'). The subject is semantically identical - 'cat' and 'feline' refer to the same animal. The action is also semantically equivalent - 'sat' and 'sitting' both describe the same position, though one is past tense and one is present continuous. The location differs in specific wording ('mat' vs 'rug') but both refer to floor coverings that serve the same function. The basic structure and meaning of both sentences are preserved, though they use different vocabulary and slightly different tense. The core information being conveyed is the same, but there are noticeable wording differences.",
50
+ "reasoning_summary": "The sentences differ in vocabulary choice ('cat' vs 'feline', 'mat' vs 'rug') and verb tense ('sat' vs 'is sitting').",
51
+ "score": 3
52
+ }
53
+
54
+ **Example 2:**
55
+
56
+ Input:
57
+ - Output: "The quick brown fox jumps over the lazy dog."
58
+ - Ground Truth: "A fast brown animal leaps over a sleeping canine."
59
+
60
+ Expected Output:
61
+ {
62
+ "extended_reasoning": "I need to compare 'The quick brown fox jumps over the lazy dog' with 'A fast brown animal leaps over a sleeping canine.' Starting with the subjects: 'quick brown fox' vs 'fast brown animal'. Both describe the same entity (a fox is a type of animal) with the same attributes (quick/fast and brown). The action is described as 'jumps' vs 'leaps', which are synonymous verbs describing the same motion. The object in both sentences is a dog, described as 'lazy' in one and 'sleeping' in the other, which are related concepts (a sleeping dog could be perceived as lazy). The structure follows the same pattern: subject + action + over + object. The sentences convey the same scene with slightly different word choices that maintain the core meaning. The level of specificity differs slightly ('fox' vs 'animal', 'dog' vs 'canine'), but the underlying information and imagery remain very similar.",
63
+ "reasoning_summary": "The sentences use different but synonymous terminology ('quick' vs 'fast', 'jumps' vs 'leaps', 'lazy' vs 'sleeping') and varying levels of specificity ('fox' vs 'animal', 'dog' vs 'canine').",
64
+ "score": 4
65
+ }
66
+
67
+ # Notes
68
+
69
+ - Focus primarily on factual accuracy and semantic similarity, not writing style or phrasing differences.
70
+ - Identify specific differences rather than making general assessments.
71
+ - Pay special attention to dates, numbers, names, locations, and causal relationships when present.
72
+ - Consider the significance of each difference in the context of the overall information.
73
+ - Be consistent in your scoring approach across different evaluations.`;
74
+ exports.CORRECTNESS_INPUT_PROMPT = [
75
+ `Output: {actual_answer}
76
+
77
+ Ground truth: {expected_answer}`,
78
+ 'Requires the placeholders <code>{actual_answer}</code> and <code>{expected_answer}</code>',
79
+ ];
80
+ exports.HELPFULNESS_PROMPT = `You are an expert evaluator assessing the helpfulness of responses to user queries.
81
+
82
+ Evaluate how helpful and useful a given response is to the user's question or request on a scale from 1 to 5. Consider whether the response addresses the user's needs, provides actionable information, and is relevant to their query.
83
+
84
+ # Scoring Criteria
85
+
86
+ - 5: Extremely helpful - The response fully addresses the user's needs, provides comprehensive and actionable information, and goes above and beyond to be useful.
87
+ - 4: Very helpful - The response addresses most of the user's needs, provides useful information, and is highly relevant.
88
+ - 3: Moderately helpful - The response addresses some of the user's needs, provides some useful information, but may lack completeness or depth.
89
+ - 2: Slightly helpful - The response provides minimal useful information and only partially addresses the user's needs.
90
+ - 1: Not helpful - The response fails to address the user's needs, provides no useful information, or is irrelevant.
91
+
92
+ # Evaluation Steps
93
+
94
+ 1. Analyze the user's question or request to understand what they're looking for.
95
+ 2. Evaluate how well the response addresses the specific needs expressed in the query.
96
+ 3. Assess the completeness and quality of the information provided.
97
+ 4. Consider the relevance and applicability of the response to the user's situation.
98
+ 5. Evaluate whether the response provides actionable insights or next steps.
99
+ 6. Determine the overall helpfulness according to the defined criteria.
100
+
101
+ # Output Format
102
+
103
+ Provide:
104
+ - A detailed analysis of the response's helpfulness (extended reasoning)
105
+ - A one-sentence summary highlighting the key strengths or weaknesses
106
+ - The final helpfulness score as an integer (1, 2, 3, 4, or 5)
107
+
108
+ Always follow the JSON format below and return nothing else:
109
+ {
110
+ "extended_reasoning": "<detailed step-by-step analysis of the response's helpfulness>",
111
+ "reasoning_summary": "<one sentence summary of the response's helpfulness>",
112
+ "score": <number: integer from 1 to 5>
113
+ }
114
+
115
+ # Examples
116
+
117
+ **Example 1:**
118
+
119
+ Input:
120
+ - Query: "How do I fix a leaky faucet?"
121
+ - Response: "A leaky faucet is usually caused by a worn washer or O-ring. Turn off the water supply, remove the handle, replace the washer or O-ring, and reassemble. If the leak persists, you may need to replace the entire cartridge."
122
+
123
+ Expected Output:
124
+ {
125
+ "extended_reasoning": "The user asked for help fixing a leaky faucet, which is a practical home maintenance question. The response directly addresses the query by identifying the most common cause (worn washer or O-ring) and provides a clear step-by-step solution. It includes important safety information (turning off water supply) and offers a backup solution if the initial fix doesn't work. The response is concise, actionable, and comprehensive for this common problem.",
126
+ "reasoning_summary": "The response provides a complete, actionable solution with clear steps and troubleshooting advice.",
127
+ "score": 5
128
+ }
129
+
130
+ **Example 2:**
131
+
132
+ Input:
133
+ - Query: "What's the weather like?"
134
+ - Response: "Weather can be sunny, rainy, cloudy, or snowy depending on various atmospheric conditions."
135
+
136
+ Expected Output:
137
+ {
138
+ "extended_reasoning": "The user asked about the weather, which typically implies they want current weather conditions for their location or a specific place. However, the response provides only generic information about weather types without addressing the specific query. It doesn't provide current conditions, forecasts, or ask for location clarification. The response is factually correct but completely unhelpful for the user's actual need.",
139
+ "reasoning_summary": "The response provides generic weather information instead of addressing the user's likely need for current conditions.",
140
+ "score": 1
141
+ }
142
+
143
+ # Notes
144
+
145
+ - Focus on practical utility and how well the response serves the user's actual needs
146
+ - Consider completeness, accuracy, and actionability of the information
147
+ - Pay attention to whether the response asks for clarification when needed
148
+ - Evaluate whether the response is appropriately detailed for the query complexity`;
149
+ exports.HELPFULNESS_INPUT_PROMPT = [
150
+ `Query: {user_query}
151
+
152
+ Response: {actual_answer}`,
153
+ 'Requires the placeholders <code>{user_query}</code> and <code>{actual_answer}</code>',
154
+ ];
155
+ //# sourceMappingURL=CannedMetricPrompts.ee.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CannedMetricPrompts.ee.js","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/CannedMetricPrompts.ee.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAqEqC,CAAC;AAE3D,QAAA,wBAAwB,GAAa;IACjD;;gCAE+B;IAC/B,2FAA2F;CAC3F,CAAC;AAEW,QAAA,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mFAoEiD,CAAC;AAEvE,QAAA,wBAAwB,GAAa;IACjD;;0BAEyB;IACzB,sFAAsF;CACtF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Description.node.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Description.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,mBAAmB,EAAE,eAAe,EA6DhD,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,eAAe,EAa3D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,EAsCjD,CAAC"}
1
+ {"version":3,"file":"Description.node.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Description.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAUpD,eAAO,MAAM,mBAAmB,EAAE,eAAe,EA6DhD,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,eAAe,EAa3D,CAAC;AAmLF,eAAO,MAAM,oBAAoB,EAAE,eAAe,EA+HjD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setMetricsProperties = exports.setCheckIfEvaluatingProperties = exports.setOutputProperties = void 0;
4
+ const CannedMetricPrompts_ee_1 = require("./CannedMetricPrompts.ee");
4
5
  const GoogleSheetsTrigger_node_1 = require("../../Google/Sheet/GoogleSheetsTrigger.node");
5
6
  exports.setOutputProperties = [
6
7
  {
@@ -77,15 +78,260 @@ exports.setCheckIfEvaluatingProperties = [
77
78
  },
78
79
  },
79
80
  ];
81
+ const correctnessFields = [
82
+ {
83
+ displayName: 'Expected Answer',
84
+ name: 'expectedAnswer',
85
+ type: 'string',
86
+ default: '',
87
+ description: 'The expected output defined in your evaluation dataset, used as ground truth',
88
+ displayOptions: {
89
+ show: {
90
+ operation: ['setMetrics'],
91
+ metric: ['correctness', 'stringSimilarity', 'categorization'],
92
+ },
93
+ },
94
+ },
95
+ {
96
+ displayName: 'Actual Answer',
97
+ name: 'actualAnswer',
98
+ type: 'string',
99
+ default: '',
100
+ description: 'The real response generated by AI (e.g. an agent or LLM in the workflow)',
101
+ displayOptions: {
102
+ show: {
103
+ operation: ['setMetrics'],
104
+ metric: ['correctness', 'stringSimilarity', 'categorization'],
105
+ },
106
+ },
107
+ },
108
+ ];
109
+ const helpfulnessFields = [
110
+ {
111
+ displayName: 'User Query',
112
+ name: 'userQuery',
113
+ type: 'string',
114
+ default: '',
115
+ description: 'The original input or question submitted by the user',
116
+ displayOptions: {
117
+ show: {
118
+ operation: ['setMetrics'],
119
+ metric: ['helpfulness'],
120
+ },
121
+ },
122
+ },
123
+ {
124
+ displayName: 'Response',
125
+ name: 'actualAnswer',
126
+ type: 'string',
127
+ default: '',
128
+ description: 'The response generated by AI (e.g. an agent or LLM in the workflow)',
129
+ displayOptions: {
130
+ show: {
131
+ operation: ['setMetrics'],
132
+ metric: ['helpfulness'],
133
+ },
134
+ },
135
+ },
136
+ ];
137
+ function promptFieldForMetric(metric, prompt) {
138
+ return [
139
+ {
140
+ displayName: 'Prompt',
141
+ name: 'prompt',
142
+ type: 'string',
143
+ default: prompt,
144
+ description: `Instruction used to guide the model in scoring the actual answer’s ${metric} against the expected answer`,
145
+ typeOptions: {
146
+ rows: 4,
147
+ },
148
+ displayOptions: {
149
+ show: {
150
+ operation: ['setMetrics'],
151
+ metric: [metric],
152
+ },
153
+ },
154
+ },
155
+ ];
156
+ }
157
+ function optionsForMetric(metric, prompt, defaultName) {
158
+ return [
159
+ {
160
+ displayName: 'Options',
161
+ name: 'options',
162
+ type: 'collection',
163
+ default: {},
164
+ placeholder: 'Add Option',
165
+ options: [
166
+ {
167
+ displayName: 'Metric Name',
168
+ name: 'metricName',
169
+ type: 'string',
170
+ default: defaultName,
171
+ description: 'Set this parameter if you want to set a custom name to the metric',
172
+ },
173
+ // eslint-disable-next-line n8n-nodes-base/node-param-default-missing
174
+ {
175
+ displayName: 'Input Prompt',
176
+ name: 'inputPrompt',
177
+ type: 'string',
178
+ default: prompt[0] ?? '',
179
+ typeOptions: {
180
+ rows: 4,
181
+ },
182
+ hint: prompt[1],
183
+ },
184
+ ],
185
+ displayOptions: {
186
+ show: {
187
+ operation: ['setMetrics'],
188
+ metric: [metric],
189
+ },
190
+ },
191
+ },
192
+ ];
193
+ }
194
+ function optionsForMetricBasic(metric, defaultName) {
195
+ return [
196
+ {
197
+ displayName: 'Options',
198
+ name: 'options',
199
+ type: 'collection',
200
+ default: {},
201
+ placeholder: 'Add Option',
202
+ options: [
203
+ {
204
+ displayName: 'Metric Name',
205
+ name: 'metricName',
206
+ type: 'string',
207
+ default: defaultName,
208
+ },
209
+ ],
210
+ displayOptions: {
211
+ show: {
212
+ operation: ['setMetrics'],
213
+ metric: [metric],
214
+ },
215
+ },
216
+ },
217
+ ];
218
+ }
219
+ const toolsUsedFields = [
220
+ {
221
+ displayName: 'Expected Tools',
222
+ name: 'expectedTools',
223
+ type: 'string',
224
+ default: '',
225
+ description: 'Enter the name(s) of the tool(s) you expect the AI to call (separated by commas)',
226
+ placeholder: 'Get Events, Send Email, Search Database',
227
+ displayOptions: {
228
+ show: {
229
+ operation: ['setMetrics'],
230
+ metric: ['toolsUsed'],
231
+ },
232
+ },
233
+ },
234
+ {
235
+ displayName: 'Intermediate Steps (of Agent)',
236
+ name: 'intermediateSteps',
237
+ type: 'string',
238
+ default: '',
239
+ hint: 'The output field of the agent containing the tools called. To see it, enable returning intermediate steps in the agent’s options',
240
+ displayOptions: {
241
+ show: {
242
+ operation: ['setMetrics'],
243
+ metric: ['toolsUsed'],
244
+ },
245
+ },
246
+ },
247
+ ];
80
248
  exports.setMetricsProperties = [
81
249
  {
82
- displayName: "Calculate the score(s) for the evaluation, then map them into this node. They will be displayed in the ‘evaluations’ tab, not the Google Sheet. <a href='https://docs.n8n.io/advanced-ai/evaluations/metric-based-evaluations/#2-calculate-metrics' target='_blank'>View metric examples</a>",
250
+ displayName: 'Metrics measure the quality of an execution. They will be displayed in the ‘evaluations’ tab, not the Google Sheet.',
251
+ // "Calculate the score(s) for the evaluation, then map them into this node. They will be displayed in the ‘evaluations’ tab, not the Google Sheet. <a href='https://docs.n8n.io/advanced-ai/evaluations/metric-based-evaluations/#2-calculate-metrics' target='_blank'>View metric examples</a>",
252
+ name: 'notice',
253
+ type: 'notice',
254
+ default: '',
255
+ displayOptions: {
256
+ show: {
257
+ operation: ['setMetrics'],
258
+ },
259
+ },
260
+ },
261
+ {
262
+ displayName: 'Metric',
263
+ name: 'metric',
264
+ type: 'hidden',
265
+ default: 'customMetrics',
266
+ displayOptions: {
267
+ show: {
268
+ operation: ['setMetrics'],
269
+ '@version': [4.6],
270
+ },
271
+ },
272
+ },
273
+ {
274
+ displayName: 'Metric',
275
+ name: 'metric',
276
+ type: 'options',
277
+ noDataExpression: true,
278
+ // eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
279
+ options: [
280
+ {
281
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
282
+ name: 'Correctness (AI-based)',
283
+ value: 'correctness',
284
+ description: 'Whether the answer’s meaning is consistent with a reference answer. Uses a scale of 1 (worst) to 5 (best).',
285
+ },
286
+ {
287
+ // eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
288
+ name: 'Helpfulness (AI-based)',
289
+ value: 'helpfulness',
290
+ description: 'Whether the response addresses the query. Uses a scale of 1 (worst) to 5 (best).',
291
+ },
292
+ {
293
+ name: 'String Similarity',
294
+ value: 'stringSimilarity',
295
+ description: 'How close the answer is to a reference answer, measured character-by-character (edit distance). Returns a score between 0 and 1.',
296
+ },
297
+ {
298
+ name: 'Categorization',
299
+ value: 'categorization',
300
+ description: 'Whether the answer exactly matches the reference answer. Returns 1 if so and 0 otherwise.',
301
+ },
302
+ {
303
+ name: 'Tools Used',
304
+ value: 'toolsUsed',
305
+ description: 'Whether tool(s) were used or not. Returns a score between 0 and 1.',
306
+ },
307
+ {
308
+ name: 'Custom Metrics',
309
+ value: 'customMetrics',
310
+ description: 'Define your own metric(s)',
311
+ },
312
+ ],
313
+ default: 'correctness',
314
+ displayOptions: {
315
+ show: {
316
+ operation: ['setMetrics'],
317
+ '@version': [{ _cnd: { gte: 4.7 } }],
318
+ },
319
+ },
320
+ },
321
+ ...correctnessFields,
322
+ ...helpfulnessFields,
323
+ ...toolsUsedFields,
324
+ ...promptFieldForMetric('correctness', CannedMetricPrompts_ee_1.CORRECTNESS_PROMPT),
325
+ ...promptFieldForMetric('helpfulness', CannedMetricPrompts_ee_1.HELPFULNESS_PROMPT),
326
+ {
327
+ displayName: "Calculate the custom metrics before this node, then map them below. <a href='https://docs.n8n.io/advanced-ai/evaluations/metric-based-evaluations/#2-calculate-metrics' target='_blank'>View metric examples</a>",
83
328
  name: 'notice',
84
329
  type: 'notice',
85
330
  default: '',
86
331
  displayOptions: {
87
332
  show: {
88
333
  operation: ['setMetrics'],
334
+ metric: ['customMetrics'],
89
335
  },
90
336
  },
91
337
  },
@@ -111,8 +357,14 @@ exports.setMetricsProperties = [
111
357
  displayOptions: {
112
358
  show: {
113
359
  operation: ['setMetrics'],
360
+ metric: ['customMetrics'],
114
361
  },
115
362
  },
116
363
  },
364
+ ...optionsForMetric('correctness', CannedMetricPrompts_ee_1.CORRECTNESS_INPUT_PROMPT, 'Correctness'),
365
+ ...optionsForMetric('helpfulness', CannedMetricPrompts_ee_1.HELPFULNESS_INPUT_PROMPT, 'Helpfulness'),
366
+ ...optionsForMetricBasic('categorization', 'Categorization'),
367
+ ...optionsForMetricBasic('stringSimilarity', 'String similarity'),
368
+ ...optionsForMetricBasic('toolsUsed', 'Tools Used'),
117
369
  ];
118
370
  //# sourceMappingURL=Description.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Description.node.js","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Description.node.ts"],"names":[],"mappings":";;;AAEA,0FAA8E;AAEjE,QAAA,mBAAmB,GAAsB;IACrD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,EAAE;KACX;IACD;QACC,GAAG,mCAAQ;QACX,WAAW,EAAE,6BAA6B;QAC1C,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;IACD;QACC,GAAG,gCAAK;QACR,WAAW,EAAE,0BAA0B;QACvC,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,uBAAuB,EAAE,YAAY;YACrC,cAAc,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACP;wBACC,WAAW,EAAE,MAAM;wBACnB,IAAI,EAAE,YAAY;wBAClB,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;qBACX;oBACD;wBACC,WAAW,EAAE,OAAO;wBACpB,IAAI,EAAE,aAAa;wBACnB,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;qBACX;iBACD;aACD;SACD;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;CACD,CAAC;AAEW,QAAA,8BAA8B,GAAsB;IAChE;QACC,WAAW,EACV,iIAAiI;QAClI,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,mBAAmB,CAAC;aAChC;SACD;KACD;CACD,CAAC;AAEW,QAAA,oBAAoB,GAAsB;IACtD;QACC,WAAW,EACV,8RAA8R;QAC/R,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;IACD;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE;YACR,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,EAAE;oBACR,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACd;aACD;SACD;QACD,WAAW,EAAE;YACZ,UAAU,EAAE;gBACX,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,QAAQ;aACrB;SACD;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"Description.node.js","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Description.node.ts"],"names":[],"mappings":";;;AAEA,qE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,EACV,kNAAkN;QACnN,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;gBACzB,MAAM,EAAE,CAAC,eAAe,CAAC;aACzB;SACD;KACD;IACD;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE;YACR,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,EAAE;oBACR,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACd;aACD;SACD;QACD,WAAW,EAAE;YACZ,UAAU,EAAE;gBACX,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,QAAQ;aACrB;SACD;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;gBACzB,MAAM,EAAE,CAAC,eAAe,CAAC;aACzB;SACD;KACD;IACD,GAAG,gBAAgB,CAAC,aAAa,EAAE,iDAAwB,EAAE,aAAa,CAAC;IAC3E,GAAG,gBAAgB,CAAC,aAAa,EAAE,iDAAwB,EAAE,aAAa,CAAC;IAC3E,GAAG,qBAAqB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5D,GAAG,qBAAqB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IACjE,GAAG,qBAAqB,CAAC,WAAW,EAAE,YAAY,CAAC;CACnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Evaluation.node.ee.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Evaluation.node.ee.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGrE,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CAoE/B;IAEF,OAAO;;;;MAA+C;IAEhD,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAYvE"}
1
+ {"version":3,"file":"Evaluation.node.ee.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Evaluation.node.ee.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,MAAM,cAAc,CAAC;AAQtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AASrE,qBAAa,UAAW,YAAW,SAAS;IAC3C,WAAW,EAAE,oBAAoB,CAoE/B;IAEF,OAAO;;;;MAA+C;IAEhD,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAYvE"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Evaluation = void 0;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
4
  const Description_node_1 = require("./Description.node");
6
5
  const versionDescription_1 = require("../../Google/Sheet/v2/actions/versionDescription");
7
6
  const methods_1 = require("../methods");
@@ -12,7 +11,7 @@ class Evaluation {
12
11
  icon: 'fa:check-double',
13
12
  name: 'evaluation',
14
13
  group: ['transform'],
15
- version: 4.6,
14
+ version: [4.6, 4.7],
16
15
  description: 'Runs an evaluation',
17
16
  eventTriggerDescription: '',
18
17
  subtitle: '={{$parameter["operation"]}}',
@@ -20,7 +19,7 @@ class Evaluation {
20
19
  name: 'Evaluation',
21
20
  color: '#c3c9d5',
22
21
  },
23
- inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
22
+ inputs: `={{(${evaluationUtils_1.setInputs})($parameter)}}`,
24
23
  outputs: `={{(${evaluationUtils_1.setOutputs})($parameter)}}`,
25
24
  codex: {
26
25
  alias: ['Test', 'Metrics', 'Evals', 'Set Output', 'Set Metrics'],
@@ -1 +1 @@
1
- {"version":3,"file":"Evaluation.node.ee.js","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Evaluation.node.ee.ts"],"names":[],"mappings":";;;AAOA,+CAAmD;AAEnD,yDAI4B;AAC5B,yFAAkF;AAClF,wCAAqE;AACrE,8DAAgG;AAEhG,MAAa,UAAU;IACtB,WAAW,GAAyB;QACnC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,oBAAoB;QACjC,uBAAuB,EAAE,EAAE;QAC3B,QAAQ,EAAE,8BAA8B;QACxC,QAAQ,EAAE;YACT,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,SAAS;SAChB;QACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,OAAO,4BAAU,iBAAiB;QAC3C,KAAK,EAAE;YACN,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC;SAChE;QACD,WAAW,EAAE;YACZ;gBACC,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,cAAc,EAAE,CAAC,gBAAgB,CAAC;wBAClC,SAAS,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACD;gBACD,QAAQ,EAAE,yBAAyB;aACnC;YACD;gBACC,IAAI,EAAE,uBAAuB;gBAC7B,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,cAAc,EAAE,CAAC,QAAQ,CAAC;wBAC1B,SAAS,EAAE,CAAC,YAAY,CAAC;qBACzB;iBACD;aACD;SACD;QACD,UAAU,EAAE;YACX;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;gBACf,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,aAAa;wBACnB,KAAK,EAAE,YAAY;qBACnB;oBACD;wBACC,IAAI,EAAE,aAAa;wBACnB,KAAK,EAAE,YAAY;qBACnB;oBACD;wBACC,IAAI,EAAE,qBAAqB;wBAC3B,KAAK,EAAE,mBAAmB;qBAC1B;iBACD;gBACD,OAAO,EAAE,YAAY;aACrB;YACD,mCAAc;YACd,GAAG,sCAAmB;YACtB,GAAG,uCAAoB;YACvB,GAAG,iDAA8B;SACjC;KACD,CAAC;IAEF,OAAO,GAAG,EAAE,WAAW,EAAX,qBAAW,EAAE,UAAU,EAAV,oBAAU,EAAE,cAAc,EAAd,wBAAc,EAAE,CAAC;IAEtD,KAAK,CAAC,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAExD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAChC,OAAO,MAAM,2BAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;aAAM,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YACvC,OAAO,MAAM,4BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,oCAAoC;YACpC,OAAO,MAAM,mCAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;CACD;AArFD,gCAqFC"}
1
+ {"version":3,"file":"Evaluation.node.ee.js","sourceRoot":"","sources":["../../../../nodes/Evaluation/Evaluation/Evaluation.node.ee.ts"],"names":[],"mappings":";;;AAQA,yDAI4B;AAC5B,yFAAkF;AAClF,wCAAqE;AACrE,8DAMkC;AAElC,MAAa,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AI,EAAE,qBAAqB;wBAC3B,KAAK,EAAE,mBAAmB;qBAC1B;iBACD;gBACD,OAAO,EAAE,YAAY;aACrB;YACD,mCAAc;YACd,GAAG,sCAAmB;YACtB,GAAG,uCAAoB;YACvB,GAAG,iDAA8B;SACjC;KACD,CAAC;IAEF,OAAO,GAAG,EAAE,WAAW,EAAX,qBAAW,EAAE,UAAU,EAAV,oBAAU,EAAE,cAAc,EAAd,wBAAc,EAAE,CAAC;IAEtD,KAAK,CAAC,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAExD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAChC,OAAO,MAAM,2BAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;aAAM,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YACvC,OAAO,MAAM,4BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,oCAAoC;YACpC,OAAO,MAAM,mCAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;CACD;AArFD,gCAqFC"}
@@ -8,4 +8,13 @@ export declare function setOutputs(parameters: INodeParameters): {
8
8
  }[] | {
9
9
  type: string;
10
10
  }[];
11
+ export declare function setInputs(parameters: INodeParameters): ({
12
+ type: string;
13
+ displayName?: undefined;
14
+ maxConnections?: undefined;
15
+ } | {
16
+ type: string;
17
+ displayName: string;
18
+ maxConnections: number;
19
+ })[];
11
20
  //# sourceMappingURL=evaluationUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluationUtils.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/utils/evaluationUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEX,eAAe,EAGf,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,cAAc,CAAC;AAKtB,wBAAsB,SAAS,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CA8ExF;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CA0DzF;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAiBhG;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,eAAe;;;;;IASrD"}
1
+ {"version":3,"file":"evaluationUtils.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/utils/evaluationUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,eAAe,EAEf,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,cAAc,CAAC;AAMtB,wBAAsB,SAAS,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CA8ExF;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CA4BzF;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAiBhG;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,eAAe;;;;;IASrD;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,eAAe;;;;;;;;KAYpD"}
@@ -4,7 +4,9 @@ exports.setOutput = setOutput;
4
4
  exports.setMetrics = setMetrics;
5
5
  exports.checkIfEvaluating = checkIfEvaluating;
6
6
  exports.setOutputs = setOutputs;
7
+ exports.setInputs = setInputs;
7
8
  const n8n_workflow_1 = require("n8n-workflow");
9
+ const metricHandlers_1 = require("./metricHandlers");
8
10
  const evaluationTriggerUtils_1 = require("./evaluationTriggerUtils");
9
11
  const utils_1 = require("../../Set/v2/helpers/utils");
10
12
  async function setOutput() {
@@ -56,26 +58,15 @@ async function setMetrics() {
56
58
  const items = this.getInputData();
57
59
  const metrics = [];
58
60
  for (let i = 0; i < items.length; i++) {
59
- const dataToSave = this.getNodeParameter('metrics', i, {});
61
+ const metric = this.getNodeParameter('metric', i, {});
62
+ if (!metricHandlers_1.metricHandlers.hasOwnProperty(metric)) {
63
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unknown metric');
64
+ }
65
+ const newData = await metricHandlers_1.metricHandlers[metric].call(this, i);
60
66
  const newItem = {
61
67
  json: {},
62
68
  pairedItem: { item: i },
63
69
  };
64
- const newData = Object.fromEntries((dataToSave?.assignments ?? []).map((assignment) => {
65
- const assignmentValue = typeof assignment.value === 'number' ? assignment.value : Number(assignment.value);
66
- if (isNaN(assignmentValue)) {
67
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Value for '${assignment.name}' isn't a number`, {
68
- description: `It’s currently '${assignment.value}'. Metrics must be numeric.`,
69
- });
70
- }
71
- if (!assignment.name || isNaN(assignmentValue)) {
72
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Metric name missing', {
73
- description: 'Make sure each metric you define has a name',
74
- });
75
- }
76
- const { name, value } = (0, utils_1.validateEntry)(assignment.name, assignment.type, assignmentValue, this.getNode(), i, false, 1);
77
- return [name, value];
78
- }));
79
70
  const returnItem = utils_1.composeReturnItem.call(this, i, newItem, newData, { dotNotation: false, include: 'none' }, 1);
80
71
  metrics.push(returnItem);
81
72
  }
@@ -106,4 +97,14 @@ function setOutputs(parameters) {
106
97
  }
107
98
  return [{ type: 'main' }];
108
99
  }
100
+ function setInputs(parameters) {
101
+ if (parameters.operation === 'setMetrics' &&
102
+ ['correctness', 'helpfulness'].includes(parameters.metric)) {
103
+ return [
104
+ { type: 'main' },
105
+ { type: 'ai_languageModel', displayName: 'Model', maxConnections: 1 },
106
+ ];
107
+ }
108
+ return [{ type: 'main' }];
109
+ }
109
110
  //# sourceMappingURL=evaluationUtils.js.map
@@ -1 +1 @@
1
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,CAAC;IACH,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,SAAgB,SAAS,CAAC,UAA2B;IACpD,IACC,UAAU,CAAC,SAAS,KAAK,YAAY;QACrC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAgB,CAAC,EACnE,CAAC;QACF,OAAO;YACN,EAAE,IAAI,EAAE,MAAM,EAAE;YAChB,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE;SACrE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
2
+ export declare const metricHandlers: {
3
+ customMetrics(this: IExecuteFunctions, i: number): Promise<IDataObject>;
4
+ toolsUsed(this: IExecuteFunctions, i: number): Promise<IDataObject>;
5
+ categorization(this: IExecuteFunctions, i: number): Promise<IDataObject>;
6
+ stringSimilarity(this: IExecuteFunctions, i: number): Promise<IDataObject>;
7
+ helpfulness(this: IExecuteFunctions, i: number): Promise<IDataObject>;
8
+ correctness(this: IExecuteFunctions, i: number): Promise<IDataObject>;
9
+ };
10
+ //# sourceMappingURL=metricHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metricHandlers.d.ts","sourceRoot":"","sources":["../../../../nodes/Evaluation/utils/metricHandlers.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAGX,WAAW,EACX,iBAAiB,EACjB,MAAM,cAAc,CAAC;AAWtB,eAAO,MAAM,cAAc;wBACA,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;oBAuCvD,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;yBAyD9C,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;2BAwBjD,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;sBAgCxD,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;sBAyFnD,iBAAiB,KAAK,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CA0F3E,CAAC"}