UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

60 lines (55 loc) 2.18 kB
/** * Code Tool Node - Version 1.1 * Write a tool in JS or Python */ export interface LcToolCodeV11Params { /** * The name of the function to be called, could contain letters, numbers, and underscores only */ name?: string | Expression<string> | PlaceholderValue; description?: string | Expression<string> | PlaceholderValue; language?: 'javaScript' | 'python'; /** * E.g. Converts any text to uppercase * @hint You can access the input the tool receives via the input property "query". The returned value should be a single string. * @displayOptions.show { language: ["javaScript"] } */ jsCode?: string; /** * E.g. Converts any text to uppercase * @hint You can access the input the tool receives via the input property "_query". The returned value should be a single string. * @displayOptions.show { language: ["python"] } */ pythonCode?: string; /** * Whether to specify the schema for the function. This would require the LLM to provide the input in the correct format and would validate it against the schema. * @default false */ specifyInputSchema?: boolean; /** * How to specify the schema for the function * @displayOptions.show { specifyInputSchema: [true] } * @default fromJson */ schemaType?: 'fromJson' | 'manual'; /** * Example JSON object to use to generate the schema * @displayOptions.show { specifyInputSchema: [true], schemaType: ["fromJson"] } */ jsonSchemaExample?: IDataObject | string; /** * Schema to use for the function * @hint Use &lt;a target="_blank" href="https://json-schema.org/"&gt;JSON Schema&lt;/a&gt; format (&lt;a target="_blank" href="https://json-schema.org/learn/miscellaneous-examples.html"&gt;examples&lt;/a&gt;). $refs syntax is currently not supported. * @displayOptions.show { specifyInputSchema: [true], schemaType: ["manual"] } */ inputSchema?: IDataObject | string | Expression<string>; } interface LcToolCodeV11NodeBase { type: '@n8n/n8n-nodes-langchain.toolCode'; version: 1.1; isTrigger: true; } export type LcToolCodeV11ParamsNode = LcToolCodeV11NodeBase & { config: NodeConfig<LcToolCodeV11Params>; }; export type LcToolCodeV11Node = LcToolCodeV11ParamsNode;