UNPKG

@n8n/n8n-nodes-langchain

Version:
89 lines (83 loc) 3.73 kB
/** * AWS Bedrock Chat Model Node - Version 1.1 * Language Model AWS Bedrock */ export interface LcLmChatAwsBedrockV11Params { authentication?: 'iam' | 'assumeRole' | Expression<string>; /** * Choose between on-demand foundation models or inference profiles * @default onDemand */ modelSource?: 'onDemand' | 'inferenceProfile' | Expression<string>; /** * The model which will generate the completion. &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html"&gt;Learn more&lt;/a&gt;. * @builderHint Default to the latest Claude Sonnet on Bedrock (anthropic.claude-sonnet-4-6 family). For Claude Sonnet 4+, switch Model Source to Inference Profiles. Avoid claude-sonnet-4-5, claude-3.x, and non-Claude legacy models unless requested. */ model?: string | Expression<string>; /** * Additional options to add * @default {} */ options?: { /** The maximum number of tokens to generate in the completion * @default 2000 */ maxTokensToSample?: number | Expression<number>; /** Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. * @default 0.7 */ temperature?: number | Expression<number>; /** Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both. * @default 1 */ topP?: number | Expression<number>; /** Maximum number of retries to attempt when a request fails * @default 2 */ maxRetries?: number | Expression<number>; /** Maximum amount of time a request is allowed to take in milliseconds. Increase this for long generations; set to 0 to disable. * @default 60000 */ timeout?: number | Expression<number>; /** Model-family-specific inference parameters passed through as JSON (e.g. Claude &lt;code&gt;top_k&lt;/code&gt;/&lt;code&gt;thinking&lt;/code&gt;, Nova &lt;code&gt;inferenceConfig&lt;/code&gt;/&lt;code&gt;reasoningConfig&lt;/code&gt;, Cohere penalties). See the &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html"&gt;AWS model parameters docs&lt;/a&gt;. * @default {} */ additionalModelRequestFields?: IDataObject | string | Expression<string>; /** Latency optimization mode for the request. "Optimized" can reduce response time for supported models and regions. * @default standard */ latency?: 'standard' | 'optimized' | Expression<string>; /** Apply an Amazon Bedrock guardrail to requests * @default {} */ guardrail?: { /** Guardrail */ values?: { /** The identifier (ID or ARN) of the guardrail to apply */ guardrailIdentifier?: string | Expression<string>; /** The version of the guardrail to apply, e.g. "1". Defaults to the working draft ("DRAFT"). * @default DRAFT */ guardrailVersion?: string | Expression<string>; /** The trace behavior for the guardrail * @default disabled */ trace?: 'disabled' | 'enabled' | 'enabled_full' | Expression<string>; }; }; }; } export interface LcLmChatAwsBedrockV11Credentials { aws: CredentialReference; awsAssumeRole: CredentialReference; } interface LcLmChatAwsBedrockV11NodeBase { type: '@n8n/n8n-nodes-langchain.lmChatAwsBedrock'; version: 1.1; } export type LcLmChatAwsBedrockV11ParamsNode = LcLmChatAwsBedrockV11NodeBase & { config: NodeConfig<LcLmChatAwsBedrockV11Params> & { credentials?: LcLmChatAwsBedrockV11Credentials }; }; export type LcLmChatAwsBedrockV11Node = LcLmChatAwsBedrockV11ParamsNode;