mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat(Structured Output Parser Node): Add notice about $refs support in JSON schema (#15973)
This commit is contained in:
@@ -105,18 +105,6 @@ export class InformationExtractor implements INodeType {
|
|||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName:
|
|
||||||
'The schema has to be defined in the <a target="_blank" href="https://json-schema.org/">JSON Schema</a> format. Look at <a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html">this</a> page for examples.',
|
|
||||||
name: 'notice',
|
|
||||||
type: 'notice',
|
|
||||||
default: '',
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
schemaType: ['manual'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
displayName: 'Attributes',
|
displayName: 'Attributes',
|
||||||
name: 'attributes',
|
name: 'attributes',
|
||||||
|
|||||||
@@ -120,18 +120,6 @@ export class OutputParserStructured implements INodeType {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName:
|
|
||||||
'The schema has to be defined in the <a target="_blank" href="https://json-schema.org/">JSON Schema</a> format. Look at <a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html">this</a> page for examples.',
|
|
||||||
name: 'notice',
|
|
||||||
type: 'notice',
|
|
||||||
default: '',
|
|
||||||
displayOptions: {
|
|
||||||
hide: {
|
|
||||||
schemaType: ['fromJson'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
displayName: 'Auto-Fix Format',
|
displayName: 'Auto-Fix Format',
|
||||||
description:
|
description:
|
||||||
@@ -172,6 +160,17 @@ export class OutputParserStructured implements INodeType {
|
|||||||
'Prompt template used for fixing the output. Uses placeholders: "{instructions}" for parsing rules, "{completion}" for the failed attempt, and "{error}" for the validation error message.',
|
'Prompt template used for fixing the output. Uses placeholders: "{instructions}" for parsing rules, "{completion}" for the failed attempt, and "{error}" for the validation error message.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
hints: [
|
||||||
|
{
|
||||||
|
message:
|
||||||
|
'Fields that use $refs might have the wrong type, since this syntax is not currently supported',
|
||||||
|
type: 'warning',
|
||||||
|
location: 'outputPane',
|
||||||
|
whenToDisplay: 'afterExecution',
|
||||||
|
displayCondition:
|
||||||
|
'={{ $parameter["schemaType"] === "manual" && $parameter["inputSchema"]?.includes("$ref") }}',
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
async supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export const schemaTypeField: INodeProperties = {
|
|||||||
description: 'Generate a schema from an example JSON object',
|
description: 'Generate a schema from an example JSON object',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Define Below',
|
name: 'Define using JSON Schema',
|
||||||
value: 'manual',
|
value: 'manual',
|
||||||
description: 'Define the JSON schema manually',
|
description: 'Define the JSON schema manually',
|
||||||
},
|
},
|
||||||
@@ -71,6 +71,7 @@ export const buildInputSchemaField = (props?: {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
description: 'Schema to use for the function',
|
description: 'Schema to use for the function',
|
||||||
|
hint: 'Use <a target="_blank" href="https://json-schema.org/">JSON Schema</a> format (<a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html">examples</a>). $refs syntax is currently not supported.',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const inputSchemaField = buildInputSchemaField();
|
export const inputSchemaField = buildInputSchemaField();
|
||||||
|
|||||||
Reference in New Issue
Block a user