UNPKG

@n8n/n8n-nodes-langchain

Version:

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

127 lines (122 loc) 4.33 kB
/** * Anthropic Node - Version 1 * Discriminator: resource=text, operation=message */ interface Credentials { anthropicApi: CredentialReference; } /** Create a completion with Anthropic model */ export type LcAnthropicV1TextMessageParams = { resource: 'text'; operation: 'message'; /** * Model * @searchListMethod modelSearch * @default {"mode":"list","value":""} */ modelId?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * Messages * @default {"values":[{"content":"","role":"user"}]} */ messages?: { /** Values */ values?: Array<{ /** The content of the message to be sent */ content?: string | Expression<string> | PlaceholderValue; /** Role in shaping the model's response, it tells the model how it should behave and interact with the user * @default user */ role?: 'user' | 'assistant' | Expression<string>; }>; }; /** * Whether to add attachments to the message * @default false */ addAttachments?: boolean | Expression<boolean>; /** * The type of input to use for the attachments * @displayOptions.show { addAttachments: [true] } * @default url */ attachmentsInputType?: 'url' | 'binary' | Expression<string>; /** * URL(s) of the file(s) to attach, multiple URLs can be added separated by comma * @displayOptions.show { addAttachments: [true], attachmentsInputType: ["url"] } */ attachmentsUrls?: string | Expression<string> | PlaceholderValue; /** * Name of the binary field(s) which contains the file(s) to attach, multiple field names can be added separated by comma * @displayOptions.show { addAttachments: [true], attachmentsInputType: ["binary"] } * @default data */ binaryPropertyName?: string | Expression<string> | PlaceholderValue; /** * Whether to return a simplified version of the response instead of the raw data * @default true */ simplify?: boolean | Expression<boolean>; /** * Options * @default {} */ options?: { /** Whether to include a single output string merging all text parts of the response * @default false */ includeMergedResponse?: boolean | Expression<boolean>; /** System Message */ system?: string | Expression<string> | PlaceholderValue; /** Whether to enable code execution. Not supported by all models. * @default false */ codeExecution?: boolean | Expression<boolean>; /** Whether to enable web search * @default false */ webSearch?: boolean | Expression<boolean>; /** The maximum number of web search uses per request * @default 5 */ maxUses?: number | Expression<number>; /** Comma-separated list of domains to search. Only domains in this list will be searched. Conflicts with "Web Search Blocked Domains". */ allowedDomains?: string | Expression<string> | PlaceholderValue; /** Comma-separated list of domains to block from search. Conflicts with "Web Search Allowed Domains". */ blockedDomains?: string | Expression<string> | PlaceholderValue; /** The maximum number of tokens to generate in the completion * @default 1024 */ maxTokens?: number | Expression<number>; /** Controls the randomness of the output. Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive * @default 1 */ temperature?: number | Expression<number>; /** The maximum cumulative probability of tokens to consider when sampling * @default 0.7 */ topP?: number | Expression<number>; /** The maximum number of tokens to consider when sampling * @default 5 */ topK?: number | Expression<number>; /** The maximum number of tool iteration cycles the LLM will run before stopping. A single iteration can contain multiple tool calls. Set to 0 for no limit * @default 15 */ maxToolsIterations?: number | Expression<number>; }; }; export interface LcAnthropicV1TextMessageSubnodeConfig { tools?: ToolInstance[]; } export type LcAnthropicV1TextMessageNode = { type: '@n8n/n8n-nodes-langchain.anthropic'; version: 1; credentials?: Credentials; config: NodeConfig<LcAnthropicV1TextMessageParams> & { subnodes?: LcAnthropicV1TextMessageSubnodeConfig }; };