From 1d98acd3ae3fe652315f2d320b4df8c94cf052a9 Mon Sep 17 00:00:00 2001 From: Oleg Ivaniv Date: Wed, 22 May 2024 12:25:23 +0200 Subject: [PATCH 1/6] Add Tool input schema docs and update output parser docs Signed-off-by: Oleg Ivaniv --- .../n8n-nodes-langchain.outputparserstructured.md | 7 +++++++ .../sub-nodes/n8n-nodes-langchain.toolworkflow.md | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md index c96a3f8e4..25fa75151 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md @@ -17,6 +17,13 @@ For usage examples and templates to help you get started, refer to n8n's [Struct ## Node parameters +**Schema Type**: Define how the output should be structured and validated. You have two options to provide the schema: + +1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. +2. **Define Below**: Manually input the JSON schema. + +**JSON Example**: a sample JSON object to generate the schema. Only the object property types and names are considered. The actual values are not used + **JSON Schema**: a JSON schema to structure and validate the output. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md index fe4b296ec..9ce318288 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md @@ -42,6 +42,20 @@ This must match the name of the output property in the workflow you're calling. --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/workflow-values.md" +### Specify Input Schema +/// note | Agent support +The structured input schema is **only supported for Tools & OpenAI Functions Agents**. +/// +Enable this option to define the input schema for the workflow you're calling. This is useful when you want to make sure the input data LLM is providing is in the correct format. + +**Schema Type**: Define how the input parameters should be structured and validated. You have two options to provide the schema: + +1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. +2. **Define Below**: Manually input the JSON schema. + +**JSON Example**: a sample JSON object to generate the schema. Only the object property types and names are considered. The actual values are not used + +**Input Schema**: a JSON schema to structure and validate the input parameters. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. ## Related resources From 8fa57d38bf89177ccb6d5464295a7ff45b3e33b9 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Wed, 22 May 2024 11:34:14 +0100 Subject: [PATCH 2/6] formatting and snippet-ify --- .../schema-type-structuring-output.md | 4 ++++ .../n8n-nodes-langchain.outputparserstructured.md | 9 +-------- .../sub-nodes/n8n-nodes-langchain.toolworkflow.md | 13 ++++--------- 3 files changed, 9 insertions(+), 17 deletions(-) create mode 100644 _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md new file mode 100644 index 000000000..c64392092 --- /dev/null +++ b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md @@ -0,0 +1,4 @@ +**Schema Type**: Define the output structure and validation. You have two options to provide the schema: + +1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. The node uses the object property types and names. It ignores the actual values. +2. **Define Below**: Manually input the JSON schema. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md index 25fa75151..dbbc6ff7a 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md @@ -17,14 +17,7 @@ For usage examples and templates to help you get started, refer to n8n's [Struct ## Node parameters -**Schema Type**: Define how the output should be structured and validated. You have two options to provide the schema: - -1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. -2. **Define Below**: Manually input the JSON schema. - -**JSON Example**: a sample JSON object to generate the schema. Only the object property types and names are considered. The actual values are not used - -**JSON Schema**: a JSON schema to structure and validate the output. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. +--8<-- "_snippets/integrations/builtin/cluster-nodes/sub-nodes/schema-type-structuring-output.md" ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md index 9ce318288..33f10a1bc 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md @@ -43,19 +43,14 @@ This must match the name of the output property in the workflow you're calling. --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/workflow-values.md" ### Specify Input Schema + /// note | Agent support -The structured input schema is **only supported for Tools & OpenAI Functions Agents**. +The structured input schema requires with a Tools Agent or OpenAI Functions Agent. /// -Enable this option to define the input schema for the workflow you're calling. This is useful when you want to make sure the input data LLM is providing is in the correct format. -**Schema Type**: Define how the input parameters should be structured and validated. You have two options to provide the schema: +Enable this option to define the input schema for the workflow you're calling. This is useful when you want to make sure the input data the LLM provides is in the correct format. -1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. -2. **Define Below**: Manually input the JSON schema. - -**JSON Example**: a sample JSON object to generate the schema. Only the object property types and names are considered. The actual values are not used - -**Input Schema**: a JSON schema to structure and validate the input parameters. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. +--8<-- "_snippets/integrations/builtin/cluster-nodes/sub-nodes/schema-type-structuring-output.md" ## Related resources From e39e059b8254adde3875596b4b82235de0fcfb0a Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Wed, 22 May 2024 11:37:00 +0100 Subject: [PATCH 3/6] fix snippet path --- .../sub-nodes/n8n-nodes-langchain.outputparserstructured.md | 2 +- .../cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md index dbbc6ff7a..adb79da3b 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md @@ -17,7 +17,7 @@ For usage examples and templates to help you get started, refer to n8n's [Struct ## Node parameters ---8<-- "_snippets/integrations/builtin/cluster-nodes/sub-nodes/schema-type-structuring-output.md" +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md" ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md index 33f10a1bc..a0175b52f 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md @@ -50,7 +50,7 @@ The structured input schema requires with a Tools Agent or OpenAI Functions Agen Enable this option to define the input schema for the workflow you're calling. This is useful when you want to make sure the input data the LLM provides is in the correct format. ---8<-- "_snippets/integrations/builtin/cluster-nodes/sub-nodes/schema-type-structuring-output.md" +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md" ## Related resources From 7a84025ee9b229ad37f5c23391b5ca52ec5d5ed3 Mon Sep 17 00:00:00 2001 From: Deborah Date: Wed, 22 May 2024 12:40:56 +0100 Subject: [PATCH 4/6] Update _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md --- .../langchain-sub-nodes/schema-type-structuring-output.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md index c64392092..b19e4e1af 100644 --- a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md +++ b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md @@ -1,4 +1,3 @@ -**Schema Type**: Define the output structure and validation. You have two options to provide the schema: 1. **Generate from JSON Example**: Input an example JSON object to automatically generate the schema. The node uses the object property types and names. It ignores the actual values. 2. **Define Below**: Manually input the JSON schema. Read the JSON Schema [guides and examples](https://json-schema.org/learn/miscellaneous-examples){:target=_blank .external-link} for help creating a valid JSON schema. From 695de4a86c6891e61a75708d58aec42747bef3b5 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Wed, 22 May 2024 12:42:33 +0100 Subject: [PATCH 5/6] input/output --- ...-type-structuring-output.md => schema-type-structuring.md} | 0 .../sub-nodes/n8n-nodes-langchain.outputparserstructured.md | 4 +++- .../sub-nodes/n8n-nodes-langchain.toolworkflow.md | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) rename _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/{schema-type-structuring-output.md => schema-type-structuring.md} (100%) diff --git a/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md b/_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring.md similarity index 100% rename from _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md rename to _snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring.md diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md index adb79da3b..47365b789 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured.md @@ -17,7 +17,9 @@ For usage examples and templates to help you get started, refer to n8n's [Struct ## Node parameters ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md" +**Schema Type**: Define the output structure and validation. You have two options to provide the schema: + +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring.md" ## Related resources diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md index a0175b52f..8edc937c3 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md @@ -50,7 +50,9 @@ The structured input schema requires with a Tools Agent or OpenAI Functions Agen Enable this option to define the input schema for the workflow you're calling. This is useful when you want to make sure the input data the LLM provides is in the correct format. ---8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring-output.md" +**Schema Type**: Define the input structure and validation. You have two options to provide the schema: + +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/schema-type-structuring.md" ## Related resources From 2bd50ac33e1519f331eec40a4cb4e491b8bd0df6 Mon Sep 17 00:00:00 2001 From: Deborah Date: Wed, 22 May 2024 16:18:18 +0100 Subject: [PATCH 6/6] Update docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md --- .../cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md index 8edc937c3..2abda181d 100644 --- a/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md +++ b/docs/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md @@ -42,7 +42,7 @@ This must match the name of the output property in the workflow you're calling. --8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-sub-nodes/workflow-values.md" -### Specify Input Schema +### Specify input schema /// note | Agent support The structured input schema requires with a Tools Agent or OpenAI Functions Agent.