n8n-nodes-simple 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/shared/core/request/constants.d.ts +2 -0
- package/dist/nodes/shared/core/request/constants.js +6 -0
- package/dist/nodes/shared/core/request/constants.js.map +1 -0
- package/dist/nodes/shared/core/request/structuredOutput.js +3 -2
- package/dist/nodes/shared/core/request/structuredOutput.js.map +1 -1
- package/dist/nodes/shared/core/tools/setup.js +7 -2
- package/dist/nodes/shared/core/tools/setup.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION = "Return valid JSON matching this schema.";
|
|
2
|
+
export declare const DEFAULT_STRUCTURED_OUTPUT_TOOL_DESCRIPTION = "Return your response to the user.\n\nUsage:\n- Call once, after completing other tool calls, or immediately if none are needed\n- Never respond with plain text outside this tool";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_STRUCTURED_OUTPUT_TOOL_DESCRIPTION = exports.DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION = void 0;
|
|
4
|
+
exports.DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION = 'Return valid JSON matching this schema.';
|
|
5
|
+
exports.DEFAULT_STRUCTURED_OUTPUT_TOOL_DESCRIPTION = 'Return your response to the user.\n\nUsage:\n- Call once, after completing other tool calls, or immediately if none are needed\n- Never respond with plain text outside this tool';
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/constants.ts"],"names":[],"mappings":";;;AAQa,QAAA,qCAAqC,GAAG,yCAAyC,CAAC;AAMlF,QAAA,0CAA0C,GACtD,mLAAmL,CAAC"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareResponseFormatField = prepareResponseFormatField;
|
|
4
4
|
const visualEditor_1 = require("./visualEditor");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
function prepareResponseFormatField(responseFormat, outputJsonSchemaDefinition, structuredOutputName, structuredOutputDescription, structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription) {
|
|
6
7
|
let response_format;
|
|
7
8
|
if (responseFormat === 'structuredOutputSchema') {
|
|
8
9
|
const jsonSchema = JSON.parse(outputJsonSchemaDefinition);
|
|
9
10
|
if (!jsonSchema.description) {
|
|
10
|
-
jsonSchema.description =
|
|
11
|
+
jsonSchema.description = constants_1.DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION;
|
|
11
12
|
}
|
|
12
13
|
response_format = { type: 'json_schema', json_schema: jsonSchema };
|
|
13
14
|
}
|
|
@@ -16,7 +17,7 @@ function prepareResponseFormatField(responseFormat, outputJsonSchemaDefinition,
|
|
|
16
17
|
type: 'json_schema',
|
|
17
18
|
json_schema: {
|
|
18
19
|
name: structuredOutputName,
|
|
19
|
-
description: structuredOutputDescription.trim() ||
|
|
20
|
+
description: structuredOutputDescription.trim() || constants_1.DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION,
|
|
20
21
|
schema: (0, visualEditor_1.convertVisualEditorToSchema)(structuredOutputProperties, structuredOutputIsArray, structuredOutputArrayName, structuredOutputArrayDescription),
|
|
21
22
|
strict: true,
|
|
22
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structuredOutput.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/structuredOutput.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"structuredOutput.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/request/structuredOutput.ts"],"names":[],"mappings":";;AAOA,gEAsCC;AA5CD,iDAAqF;AACrF,2CAAoE;AAKpE,SAAgB,0BAA0B,CACzC,cAAsB,EACtB,0BAAkC,EAClC,oBAA4B,EAC5B,2BAAmC,EACnC,0BAAoD,EACpD,uBAAgC,EAChC,yBAAiC,EACjC,gCAAwC;IAExC,IAAI,eAAe,CAAC;IACpB,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAE1D,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;YAC7B,UAAU,CAAC,WAAW,GAAG,iDAAqC,CAAC;QAChE,CAAC;QACD,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;IACpE,CAAC;SAAM,IAAI,cAAc,KAAK,wBAAwB,EAAE,CAAC;QACxD,eAAe,GAAG;YACjB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE;gBACZ,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,2BAA2B,CAAC,IAAI,EAAE,IAAI,iDAAqC;gBACxF,MAAM,EAAE,IAAA,0CAA2B,EAClC,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,CAChC;gBACD,MAAM,EAAE,IAAI;aACZ;SACD,CAAC;IACH,CAAC;SAAM,IAAI,cAAc,KAAK,UAAU,EAAE,CAAC;QAC1C,eAAe,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,eAAe,CAAC;AACxB,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.prepareTools = prepareTools;
|
|
4
4
|
const connector_1 = require("./connector");
|
|
5
5
|
const utils_1 = require("../../api/utils");
|
|
6
|
+
const constants_1 = require("../request/constants");
|
|
6
7
|
async function prepareTools(executeFunctions, structuredOutputToolsMode, maxToolsIterations, responseFormat) {
|
|
7
8
|
let tools = [];
|
|
8
9
|
let externalTools = [];
|
|
@@ -39,12 +40,16 @@ async function prepareTools(executeFunctions, structuredOutputToolsMode, maxTool
|
|
|
39
40
|
}
|
|
40
41
|
if (structuredOutputToolsMode && responseFormat && responseFormat.json_schema) {
|
|
41
42
|
const jsonSchema = responseFormat.json_schema;
|
|
43
|
+
const userDescription = jsonSchema.description;
|
|
44
|
+
const shouldUseToolDescription = !userDescription ||
|
|
45
|
+
userDescription === constants_1.DEFAULT_STRUCTURED_OUTPUT_DESCRIPTION;
|
|
42
46
|
structuredOutputTool = {
|
|
43
47
|
type: 'function',
|
|
44
48
|
function: {
|
|
45
49
|
name: jsonSchema.name,
|
|
46
|
-
description:
|
|
47
|
-
|
|
50
|
+
description: shouldUseToolDescription
|
|
51
|
+
? constants_1.DEFAULT_STRUCTURED_OUTPUT_TOOL_DESCRIPTION
|
|
52
|
+
: userDescription,
|
|
48
53
|
parameters: jsonSchema.schema,
|
|
49
54
|
strict: true,
|
|
50
55
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/tools/setup.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../../../nodes/shared/core/tools/setup.ts"],"names":[],"mappings":";;AASA,oCAmFC;AA1FD,2CAAgD;AAChD,2CAAqD;AACrD,oDAAyH;AAKlH,KAAK,UAAU,YAAY,CACjC,gBAAmC,EACnC,yBAAkC,EAClC,kBAA0B,EAC1B,cAA4B;IAO5B,IAAI,KAAK,GAAU,EAAE,CAAC;IACtB,IAAI,aAAa,GAAW,EAAE,CAAC;IAC/B,MAAM,kBAAkB,GAAG,IAAI,CAAC;IAChC,IAAI,WAAW,GAAqC,SAAS,CAAC;IAC9D,IAAI,oBAAoB,GAAG,SAAS,CAAC;IAErC,IAAI,CAAC;QACJ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