Skip to content

Commit

Permalink
fix(AWS Bedrock Chat Model Node): Improve filtering of Bedrock models…
Browse files Browse the repository at this point in the history
… & fix Claude 3 (n8n-io#9085)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
  • Loading branch information
OlegIvaniv authored Apr 9, 2024
1 parent f62800c commit cfaab0b
Show file tree
Hide file tree
Showing 5 changed files with 746 additions and 527 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions packages/@n8n/nodes-langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"ts-essentials": "^7.0.3"
},
"dependencies": {
"@langchain/community": "0.0.34",
"@langchain/community": "0.0.44",
"@langchain/core": "0.1.41",
"@langchain/openai": "0.0.16",
"@n8n/client-oauth2": "workspace:*",
Expand Down
Loading

0 comments on commit cfaab0b

Please sign in to comment.