Skip to content

Commit 940c8fd

Browse files
authored
Chore/LC v0.3 (#3517)
* bump langchain version to 0.3, upgrades on all chat models * update all docs loader to have documents and text output options * fix pnpm lock file
1 parent 126808b commit 940c8fd

File tree

82 files changed

+2364
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2364
-1531
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"resolutions": {
7070
"@google/generative-ai": "^0.15.0",
71-
"@langchain/core": "0.2.18",
71+
"@langchain/core": "0.3.18",
7272
"@qdrant/openapi-typescript-fetch": "1.2.6",
7373
"openai": "4.57.3",
7474
"protobufjs": "7.4.0"
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
import { INodeParams, INodeCredential } from '../src/Interface'
22

3-
class BaiduApi implements INodeCredential {
3+
class BaiduQianfanApi implements INodeCredential {
44
label: string
55
name: string
66
version: number
77
inputs: INodeParams[]
88

99
constructor() {
10-
this.label = 'Baidu API'
11-
this.name = 'baiduApi'
12-
this.version = 1.0
10+
this.label = 'Baidu Qianfan API'
11+
this.name = 'baiduQianfanApi'
12+
this.version = 2.0
1313
this.inputs = [
1414
{
15-
label: 'Baidu Api Key',
16-
name: 'baiduApiKey',
17-
type: 'password'
15+
label: 'Qianfan Access Key',
16+
name: 'qianfanAccessKey',
17+
type: 'string'
1818
},
1919
{
20-
label: 'Baidu Secret Key',
21-
name: 'baiduSecretKey',
20+
label: 'Qianfan Secret Key',
21+
name: 'qianfanSecretKey',
2222
type: 'password'
2323
}
2424
]
2525
}
2626
}
2727

28-
module.exports = { credClass: BaiduApi }
28+
module.exports = { credClass: BaiduQianfanApi }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { INodeParams, INodeCredential } from '../src/Interface'
2+
3+
class IBMWatsonxCredential implements INodeCredential {
4+
label: string
5+
name: string
6+
version: number
7+
description: string
8+
inputs: INodeParams[]
9+
10+
constructor() {
11+
this.label = 'IBM Watsonx'
12+
this.name = 'ibmWatsonx'
13+
this.version = 1.0
14+
this.inputs = [
15+
{
16+
label: 'Version',
17+
name: 'version',
18+
type: 'string',
19+
placeholder: 'YYYY-MM-DD'
20+
},
21+
{
22+
label: 'Service URL',
23+
name: 'serviceUrl',
24+
type: 'string',
25+
placeholder: '<SERVICE_URL>'
26+
},
27+
{
28+
label: 'Project ID',
29+
name: 'projectId',
30+
type: 'string',
31+
placeholder: '<PROJECT_ID>'
32+
},
33+
{
34+
label: 'Watsonx AI Auth Type',
35+
name: 'watsonxAIAuthType',
36+
type: 'options',
37+
options: [
38+
{
39+
label: 'IAM',
40+
name: 'iam'
41+
},
42+
{
43+
label: 'Bearer Token',
44+
name: 'bearertoken'
45+
}
46+
],
47+
default: 'iam'
48+
},
49+
{
50+
label: 'Watsonx AI IAM API Key',
51+
name: 'watsonxAIApikey',
52+
type: 'password',
53+
description: 'API Key for Watsonx AI when using IAM',
54+
placeholder: '<YOUR-APIKEY>',
55+
optional: true
56+
},
57+
{
58+
label: 'Watsonx AI Bearer Token',
59+
name: 'watsonxAIBearerToken',
60+
type: 'password',
61+
description: 'Bearer Token for Watsonx AI when using Bearer Token',
62+
placeholder: '<YOUR-BEARER-TOKEN>',
63+
optional: true
64+
}
65+
]
66+
}
67+
}
68+
69+
module.exports = { credClass: IBMWatsonxCredential }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { INodeParams, INodeCredential } from '../src/Interface'
2+
3+
class XaiApi implements INodeCredential {
4+
label: string
5+
name: string
6+
version: number
7+
description: string
8+
inputs: INodeParams[]
9+
10+
constructor() {
11+
this.label = 'Xai API'
12+
this.name = 'xaiApi'
13+
this.version = 1.0
14+
this.inputs = [
15+
{
16+
label: 'X AI API Key',
17+
name: 'xaiApiKey',
18+
type: 'password'
19+
}
20+
]
21+
}
22+
}
23+
24+
module.exports = { credClass: XaiApi }

packages/components/models.json

+14-53
Original file line numberDiff line numberDiff line change
@@ -426,21 +426,8 @@
426426
"name": "gemini-1.5-pro-002"
427427
},
428428
{
429-
"label": "gemini-pro",
430-
"name": "gemini-pro"
431-
},
432-
{
433-
"label": "gemini-pro-vision",
434-
"name": "gemini-pro-vision"
435-
}
436-
]
437-
},
438-
{
439-
"name": "chatGooglePaLM",
440-
"models": [
441-
{
442-
"label": "models/chat-bison-001",
443-
"name": "models/chat-bison-001"
429+
"label": "gemini-1.0-pro-latest (deprecated)",
430+
"name": "gemini-1.0-pro-latest"
444431
}
445432
]
446433
},
@@ -457,12 +444,20 @@
457444
"name": "chatGoogleVertexAI",
458445
"models": [
459446
{
460-
"label": "gemini-1.5-flash",
461-
"name": "gemini-1.5-flash-preview-0514"
447+
"label": "gemini-1.5-flash-002",
448+
"name": "gemini-1.5-flash-002"
449+
},
450+
{
451+
"label": "gemini-1.5-flash-001",
452+
"name": "gemini-1.5-flash-001"
453+
},
454+
{
455+
"label": "gemini-1.5-pro-002",
456+
"name": "gemini-1.5-pro-002"
462457
},
463458
{
464-
"label": "gemini-1.5-pro",
465-
"name": "gemini-1.5-pro-preview-0409"
459+
"label": "gemini-1.5-pro-001",
460+
"name": "gemini-1.5-pro-001"
466461
},
467462
{
468463
"label": "gemini-1.0-pro",
@@ -496,22 +491,6 @@
496491
"label": "claude-3-haiku@20240307",
497492
"name": "claude-3-haiku@20240307",
498493
"description": "Fastest and most compact model for near-instant responsiveness"
499-
},
500-
{
501-
"label": "chat-bison",
502-
"name": "chat-bison"
503-
},
504-
{
505-
"label": "codechat-bison",
506-
"name": "codechat-bison"
507-
},
508-
{
509-
"label": "chat-bison-32k",
510-
"name": "chat-bison-32k"
511-
},
512-
{
513-
"label": "codechat-bison-32k",
514-
"name": "codechat-bison-32k"
515494
}
516495
]
517496
},
@@ -1112,15 +1091,6 @@
11121091
}
11131092
]
11141093
},
1115-
{
1116-
"name": "GooglePaLM",
1117-
"models": [
1118-
{
1119-
"label": "models/text-bison-001",
1120-
"name": "models/text-bison-001"
1121-
}
1122-
]
1123-
},
11241094
{
11251095
"name": "googlevertexai",
11261096
"models": [
@@ -1267,15 +1237,6 @@
12671237
}
12681238
]
12691239
},
1270-
{
1271-
"name": "googlePaLMEmbeddings",
1272-
"models": [
1273-
{
1274-
"label": "models/embedding-gecko-001",
1275-
"name": "models/embedding-gecko-001"
1276-
}
1277-
]
1278-
},
12791240
{
12801241
"name": "googlevertexaiEmbeddings",
12811242
"models": [

packages/components/nodes/agents/ConversationalRetrievalToolAgent/ConversationalRetrievalToolAgent.ts

-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class ConversationalRetrievalToolAgent_Agents implements INode {
3838
baseClasses: string[]
3939
inputs: INodeParams[]
4040
sessionId?: string
41-
badge?: string
4241

4342
constructor(fields?: { sessionId?: string }) {
4443
this.label = 'Conversational Retrieval Tool Agent'
@@ -50,7 +49,6 @@ class ConversationalRetrievalToolAgent_Agents implements INode {
5049
this.icon = 'toolAgent.png'
5150
this.description = `Agent that calls a vector store retrieval and uses Function Calling to pick the tools and args to call`
5251
this.baseClasses = [this.type, ...getBaseClasses(AgentExecutor)]
53-
this.badge = 'NEW'
5452
this.inputs = [
5553
{
5654
label: 'Tools',

packages/components/nodes/agents/LlamaIndexAgents/AnthropicAgent/AnthropicAgent_LlamaIndex.ts

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class AnthropicAgent_LlamaIndex_Agents implements INode {
1515
tags: string[]
1616
inputs: INodeParams[]
1717
sessionId?: string
18-
badge?: string
1918

2019
constructor(fields?: { sessionId?: string }) {
2120
this.label = 'Anthropic Agent'

packages/components/nodes/agents/LlamaIndexAgents/OpenAIToolAgent/OpenAIToolAgent_LlamaIndex.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class OpenAIFunctionAgent_LlamaIndex_Agents implements INode {
2424
tags: string[]
2525
inputs: INodeParams[]
2626
sessionId?: string
27-
badge?: string
2827

2928
constructor(fields?: { sessionId?: string }) {
3029
this.label = 'OpenAI Tool Agent'

packages/components/nodes/agents/ToolAgent/ToolAgent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ToolAgent_Agents implements INode {
3535
baseClasses: string[]
3636
inputs: INodeParams[]
3737
sessionId?: string
38-
badge?: string
3938

4039
constructor(fields?: { sessionId?: string }) {
4140
this.label = 'Tool Agent'
@@ -191,6 +190,7 @@ class ToolAgent_Agents implements INode {
191190
output = removeInvalidImageMarkdown(output)
192191

193192
// Claude 3 Opus tends to spit out <thinking>..</thinking> as well, discard that in final output
193+
// https://docs.anthropic.com/en/docs/build-with-claude/tool-use#chain-of-thought
194194
const regexPattern: RegExp = /<thinking>[\s\S]*?<\/thinking>/
195195
const matches: RegExpMatchArray | null = output.match(regexPattern)
196196
if (matches) {

packages/components/nodes/agents/XMLAgent/XMLAgent.ts

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class XMLAgent_Agents implements INode {
5757
baseClasses: string[]
5858
inputs: INodeParams[]
5959
sessionId?: string
60-
badge?: string
6160

6261
constructor(fields?: { sessionId?: string }) {
6362
this.label = 'XML Agent'

packages/components/nodes/chatmodels/AWSBedrock/AWSChatBedrock.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { BaseCache } from '@langchain/core/caches'
22
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
33
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
4-
import { BedrockChat } from './FlowiseAWSChatBedrock'
54
import { getModels, getRegions, MODEL_TYPE } from '../../../src/modelLoader'
6-
import { BedrockChatFields } from '@langchain/community/chat_models/bedrock'
5+
import { ChatBedrockConverseInput, ChatBedrockConverse } from '@langchain/aws'
6+
import { BedrockChat } from './FlowiseAWSChatBedrock'
77

88
/**
99
* @author Michael Connor <[email protected]>
@@ -23,12 +23,12 @@ class AWSChatBedrock_ChatModels implements INode {
2323
constructor() {
2424
this.label = 'AWS ChatBedrock'
2525
this.name = 'awsChatBedrock'
26-
this.version = 5.0
26+
this.version = 6.0
2727
this.type = 'AWSChatBedrock'
2828
this.icon = 'aws.svg'
2929
this.category = 'Chat Models'
30-
this.description = 'Wrapper around AWS Bedrock large language models that use the Chat endpoint'
31-
this.baseClasses = [this.type, ...getBaseClasses(BedrockChat)]
30+
this.description = 'Wrapper around AWS Bedrock large language models that use the Converse API'
31+
this.baseClasses = [this.type, ...getBaseClasses(ChatBedrockConverse)]
3232
this.credential = {
3333
label: 'AWS Credential',
3434
name: 'credential',
@@ -64,6 +64,14 @@ class AWSChatBedrock_ChatModels implements INode {
6464
type: 'string',
6565
optional: true
6666
},
67+
{
68+
label: 'Streaming',
69+
name: 'streaming',
70+
type: 'boolean',
71+
default: true,
72+
optional: true,
73+
additionalParams: true
74+
},
6775
{
6876
label: 'Temperature',
6977
name: 'temperature',
@@ -89,7 +97,7 @@ class AWSChatBedrock_ChatModels implements INode {
8997
name: 'allowImageUploads',
9098
type: 'boolean',
9199
description:
92-
'Only works with claude-3-* models when image is being uploaded from chat. Compatible with LLMChain, Conversation Chain, ReAct Agent, Conversational Agent, Tool Agent',
100+
'Allow image input. Refer to the <a href="https://docs.flowiseai.com/using-flowise/uploads#image" target="_blank">docs</a> for more details.',
93101
default: false,
94102
optional: true
95103
}
@@ -115,7 +123,7 @@ class AWSChatBedrock_ChatModels implements INode {
115123
const cache = nodeData.inputs?.cache as BaseCache
116124
const streaming = nodeData.inputs?.streaming as boolean
117125

118-
const obj: BedrockChatFields = {
126+
const obj: ChatBedrockConverseInput = {
119127
region: iRegion,
120128
model: customModel ? customModel : iModel,
121129
maxTokens: parseInt(iMax_tokens_to_sample, 10),
@@ -153,7 +161,7 @@ class AWSChatBedrock_ChatModels implements INode {
153161
}
154162

155163
const amazonBedrock = new BedrockChat(nodeData.id, obj)
156-
if (obj.model?.includes('anthropic.claude-3')) amazonBedrock.setMultiModalOption(multiModalOption)
164+
amazonBedrock.setMultiModalOption(multiModalOption)
157165
return amazonBedrock
158166
}
159167
}

0 commit comments

Comments
 (0)