fix(AWS Bedrock Chat Model Node): Improve filtering of Bedrock models & fix Claude 3 (#9085)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-04-09 14:22:48 +02:00
committed by GitHub
parent f62800cd72
commit cfaab0b829
5 changed files with 760 additions and 541 deletions

View File

@@ -64,7 +64,7 @@ export class EmbeddingsAwsBedrock implements INodeType {
routing: {
request: {
method: 'GET',
url: '/foundation-models',
url: '/foundation-models?byInferenceType=ON_DEMAND&byOutputModality=EMBEDDING',
},
output: {
postReceive: [
@@ -74,13 +74,6 @@ export class EmbeddingsAwsBedrock implements INodeType {
property: 'modelSummaries',
},
},
{
type: 'filter',
properties: {
// There isn't a good way to filter embedding models, so we atleast filter-out the default non-embedding ones
pass: "={{ !'anthropic.claude-instant-v1-100k,anthropic.claude-v2,amazon.titan-text-express-v1'.match($responseItem.modelId) }}",
},
},
{
type: 'setKeyValue',
properties: {

View File

@@ -68,7 +68,7 @@ export class LmChatAwsBedrock implements INodeType {
routing: {
request: {
method: 'GET',
url: '/foundation-models?&byOutputModality=TEXT',
url: '/foundation-models?&byOutputModality=TEXT&byInferenceType=ON_DEMAND',
},
output: {
postReceive: [
@@ -78,13 +78,6 @@ export class LmChatAwsBedrock implements INodeType {
property: 'modelSummaries',
},
},
{
type: 'filter',
properties: {
// Not a foundational model
pass: "={{ !['anthropic.claude-instant-v1-100k'].includes($responseItem.modelId) }}",
},
},
{
type: 'setKeyValue',
properties: {

View File

@@ -127,14 +127,14 @@
"n8n-core": "workspace:*"
},
"dependencies": {
"@aws-sdk/client-bedrock-runtime": "3.454.0",
"@aws-sdk/credential-provider-node": "3.451.0",
"@aws-sdk/client-bedrock-runtime": "3.549.0",
"@aws-sdk/credential-provider-node": "3.549.0",
"@getzep/zep-js": "0.9.0",
"@google-ai/generativelanguage": "0.2.1",
"@huggingface/inference": "2.6.4",
"@langchain/anthropic": "^0.1.3",
"@langchain/cohere": "^0.0.5",
"@langchain/community": "^0.0.34",
"@langchain/community": "0.0.44",
"@langchain/core": "0.1.41",
"@langchain/mistralai": "0.0.13",
"@langchain/openai": "^0.0.16",