n8n-nodes-databricks-api
Version:
Databricks node for n8n
23 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateSchema = generateSchema;
exports.convertJsonSchemaToZod = convertJsonSchemaToZod;
exports.throwIfToolSchema = throwIfToolSchema;
const json_schema_to_zod_1 = require("@n8n/json-schema-to-zod");
const generate_schema_1 = require("generate-schema");
const n8n_workflow_1 = require("n8n-workflow");
function generateSchema(schemaString) {
const parsedSchema = (0, n8n_workflow_1.jsonParse)(schemaString);
return (0, generate_schema_1.json)(parsedSchema);
}
function convertJsonSchemaToZod(schema) {
return (0, json_schema_to_zod_1.jsonSchemaToZod)(schema);
}
function throwIfToolSchema(ctx, error) {
var _a;
if ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('tool input did not match expected schema')) {
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${error.message}.
This is most likely because some of your tools are configured to require a specific schema. This is not supported by Conversational Agent. Remove the schema from the tool configuration or use Tools agent instead.`);
}
}
//# sourceMappingURL=schemaParsing.js.map