mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(AWS Bedrock Chat Model Node): Add inference profile support (#17807)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ export class LmChatAwsBedrock implements INodeType {
|
||||
name: 'lmChatAwsBedrock',
|
||||
icon: 'file:bedrock.svg',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
version: [1, 1.1],
|
||||
description: 'Language Model AWS Bedrock',
|
||||
defaults: {
|
||||
name: 'AWS Bedrock Chat Model',
|
||||
@@ -56,6 +56,31 @@ export class LmChatAwsBedrock implements INodeType {
|
||||
},
|
||||
properties: [
|
||||
getConnectionHintNoticeField([NodeConnectionTypes.AiChain, NodeConnectionTypes.AiChain]),
|
||||
{
|
||||
displayName: 'Model Source',
|
||||
name: 'modelSource',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [{ _cnd: { gte: 1.1 } }],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'On-Demand Models',
|
||||
value: 'onDemand',
|
||||
description: 'Standard foundation models with on-demand pricing',
|
||||
},
|
||||
{
|
||||
name: 'Inference Profiles',
|
||||
value: 'inferenceProfile',
|
||||
description:
|
||||
'Cross-region inference profiles (required for models like Claude Sonnet 4 and others)',
|
||||
},
|
||||
],
|
||||
default: 'onDemand',
|
||||
description: 'Choose between on-demand foundation models or inference profiles',
|
||||
},
|
||||
{
|
||||
displayName: 'Model',
|
||||
name: 'model',
|
||||
@@ -63,7 +88,13 @@ export class LmChatAwsBedrock implements INodeType {
|
||||
allowArbitraryValues: true, // Hide issues when model name is specified in the expression and does not match any of the options
|
||||
description:
|
||||
'The model which will generate the completion. <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html">Learn more</a>.',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
modelSource: ['inferenceProfile'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['modelSource'],
|
||||
loadOptions: {
|
||||
routing: {
|
||||
request: {
|
||||
@@ -105,6 +136,62 @@ export class LmChatAwsBedrock implements INodeType {
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Model',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
allowArbitraryValues: true,
|
||||
description:
|
||||
'The inference profile which will generate the completion. <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-use.html">Learn more</a>.',
|
||||
displayOptions: {
|
||||
show: {
|
||||
modelSource: ['inferenceProfile'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['modelSource'],
|
||||
loadOptions: {
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '/inference-profiles?maxResults=1000',
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'inferenceProfileSummaries',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'setKeyValue',
|
||||
properties: {
|
||||
name: '={{$responseItem.inferenceProfileName}}',
|
||||
description:
|
||||
'={{$responseItem.description || $responseItem.inferenceProfileArn}}',
|
||||
value: '={{$responseItem.inferenceProfileId}}',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'sort',
|
||||
properties: {
|
||||
key: 'name',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
type: 'body',
|
||||
property: 'model',
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
|
||||
Reference in New Issue
Block a user