Skip to content

Commit

Permalink
Chore/Move @langchain/core dependency to components (FlowiseAI#2945)
Browse files Browse the repository at this point in the history
* move lc core dependency to components

* anchor @langchain/aws version

* update agentic RAG template
  • Loading branch information
HenryHengZJ authored Aug 6, 2024
1 parent 70d7420 commit ee8f9bb
Show file tree
Hide file tree
Showing 5 changed files with 5,945 additions and 7,729 deletions.
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@
"onlyBuiltDependencies": [
"faiss-node",
"sqlite3"
],
"overrides": {
"@langchain/core": "0.2.18",
"@langchain/aws": "^0.0.6"
}
]
},
"engines": {
"node": ">=18.15.0 <19.0.0 || ^20",
Expand All @@ -69,7 +65,8 @@
"resolutions": {
"@qdrant/openapi-typescript-fetch": "1.2.6",
"@google/generative-ai": "^0.15.0",
"openai": "4.51.0"
"openai": "4.51.0",
"@langchain/aws": "0.0.6"
},
"eslintIgnore": [
"**/dist",
Expand Down
13 changes: 7 additions & 6 deletions packages/components/nodes/vectorstores/Milvus/Milvus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,15 @@ const similaritySearchVectorWithScore = async (query: number[], k: number, vecto

const outputFields = vectorStore.fields.filter((field) => field !== vectorStore.vectorField)

const search_params: any = {
anns_field: vectorStore.vectorField,
topk: k.toString(),
metric_type: vectorStore.indexCreateParams.metric_type,
params: vectorStore.indexSearchParams
}
const searchResp = await vectorStore.client.search({
collection_name: vectorStore.collectionName,
search_params: {
anns_field: vectorStore.vectorField,
topk: k.toString(),
metric_type: vectorStore.indexCreateParams.metric_type,
params: vectorStore.indexSearchParams
},
search_params,
output_fields: outputFields,
vector_type: DataType.FloatVector,
vectors: [query],
Expand Down
2 changes: 2 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
"@google-ai/generativelanguage": "^2.5.0",
"@google/generative-ai": "^0.15.0",
"@huggingface/inference": "^2.6.1",
"@langchain/aws": "^0.0.6",
"@langchain/anthropic": "^0.2.1",
"@langchain/cohere": "^0.0.7",
"@langchain/community": "^0.2.17",
"@langchain/core": "0.2.18",
"@langchain/exa": "^0.0.5",
"@langchain/google-genai": "^0.0.22",
"@langchain/google-vertexai": "^0.0.19",
Expand Down
88 changes: 47 additions & 41 deletions packages/server/marketplaces/agentflows/Agentic RAG.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
"model": "",
"promptValues": "{\"text\":\"{{question}}\"}",
"llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI"
"updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_0": "updateStateMemoryUI"
},
"outputAnchors": [
{
Expand All @@ -227,8 +228,8 @@
{
"id": "seqStart_0",
"position": {
"x": 429.0188107292025,
"y": 277.11423822901907
"x": 438.8554922368403,
"y": 259.0803221316833
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -296,8 +297,8 @@
"width": 300,
"height": 382,
"positionAbsolute": {
"x": 429.0188107292025,
"y": 277.11423822901907
"x": 438.8554922368403,
"y": 259.0803221316833
},
"selected": false,
"dragging": false
Expand Down Expand Up @@ -769,7 +770,8 @@
"model": "",
"promptValues": "{\"question\":\"{{question}}\"}",
"llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI"
"updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_1": "updateStateMemoryUI"
},
"outputAnchors": [
{
Expand All @@ -795,8 +797,8 @@
{
"id": "seqLLMNode_2",
"position": {
"x": 2205.875202632436,
"y": 209.03456469283117
"x": 2227.3672008899293,
"y": 202.42164215206395
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -990,7 +992,8 @@
"model": "",
"promptValues": "{\"question\":\"{{question}}\",\"context\":\"$flow.state.sources\"}",
"llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI"
"updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_2": "updateStateMemoryUI"
},
"outputAnchors": [
{
Expand All @@ -1008,16 +1011,16 @@
"height": 450,
"selected": false,
"positionAbsolute": {
"x": 2205.875202632436,
"y": 209.03456469283117
"x": 2227.3672008899293,
"y": 202.42164215206395
},
"dragging": false
},
{
"id": "seqLoop_0",
"position": {
"x": 2559.3078506376914,
"y": 827.739264836123
"x": 2557.3813854226105,
"y": 836.5518871718609
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -1060,16 +1063,16 @@
"height": 241,
"selected": false,
"positionAbsolute": {
"x": 2559.3078506376914,
"y": 827.739264836123
"x": 2557.3813854226105,
"y": 836.5518871718609
},
"dragging": false
},
{
"id": "seqEnd_0",
"position": {
"x": 2552.677329133902,
"y": 439.10969421030416
"x": 2566.2338203424747,
"y": 472.1743069141402
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -1101,8 +1104,8 @@
"height": 143,
"selected": false,
"positionAbsolute": {
"x": 2552.677329133902,
"y": 439.10969421030416
"x": 2566.2338203424747,
"y": 472.1743069141402
},
"dragging": false
},
Expand Down Expand Up @@ -1582,7 +1585,9 @@
],
"inputAnchors": [],
"inputs": {
"stateMemory": "stateMemoryUI"
"stateMemory": "stateMemoryUI",
"selectedStateTab_seqState_0": "stateMemoryUI",
"stateMemoryUI": "[{\"key\":\"sources\",\"type\":\"Replace\",\"defaultValue\":\"\",\"actions\":\"\",\"id\":0}]"
},
"outputAnchors": [
{
Expand All @@ -1608,8 +1613,8 @@
{
"id": "seqLLMNode_3",
"position": {
"x": 1477.8265021173233,
"y": 184.8087848768496
"x": 1484.4394246580907,
"y": 133.55863518590365
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -1803,7 +1808,8 @@
"model": "",
"promptValues": "",
"llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI"
"updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_3": "updateStateMemoryUI"
},
"outputAnchors": [
{
Expand All @@ -1821,8 +1827,8 @@
"height": 450,
"selected": false,
"positionAbsolute": {
"x": 1477.8265021173233,
"y": 184.8087848768496
"x": 1484.4394246580907,
"y": 133.55863518590365
},
"dragging": false
},
Expand Down Expand Up @@ -2424,8 +2430,8 @@
{
"id": "stickyNote_1",
"position": {
"x": -259.34389200648127,
"y": 190.60834640491902
"x": -239.50512438417962,
"y": 177.3825013233846
},
"type": "stickyNote",
"data": {
Expand Down Expand Up @@ -2470,8 +2476,8 @@
"selected": false,
"dragging": false,
"positionAbsolute": {
"x": -259.34389200648127,
"y": 190.60834640491902
"x": -239.50512438417962,
"y": 177.3825013233846
}
},
{
Expand Down Expand Up @@ -2530,8 +2536,8 @@
{
"id": "seqToolNode_0",
"position": {
"x": 1125.4209936219386,
"y": 74.65954911972659
"x": 1145.2597612442403,
"y": 82.9257022956856
},
"type": "customNode",
"data": {
Expand Down Expand Up @@ -2727,8 +2733,8 @@
"height": 528,
"selected": false,
"positionAbsolute": {
"x": 1125.4209936219386,
"y": 74.65954911972659
"x": 1145.2597612442403,
"y": 82.9257022956856
},
"dragging": false
},
Expand Down Expand Up @@ -2938,21 +2944,21 @@
"type": "buttonedge",
"id": "seqConditionAgent_0-seqConditionAgent_0-output-rewrite-Condition-seqLLMNode_1-seqLLMNode_1-input-sequentialNode-Start | Agent | Condition | LLMNode | ToolNode"
},
{
"source": "seqLLMNode_1",
"sourceHandle": "seqLLMNode_1-output-seqLLMNode-LLMNode",
"target": "seqLoop_0",
"targetHandle": "seqLoop_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode",
"type": "buttonedge",
"id": "seqLLMNode_1-seqLLMNode_1-output-seqLLMNode-LLMNode-seqLoop_0-seqLoop_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode"
},
{
"source": "seqLLMNode_2",
"sourceHandle": "seqLLMNode_2-output-seqLLMNode-LLMNode",
"target": "seqEnd_0",
"targetHandle": "seqEnd_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode",
"type": "buttonedge",
"id": "seqLLMNode_2-seqLLMNode_2-output-seqLLMNode-LLMNode-seqEnd_0-seqEnd_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode"
},
{
"source": "seqLLMNode_1",
"sourceHandle": "seqLLMNode_1-output-seqLLMNode-LLMNode",
"target": "seqLoop_0",
"targetHandle": "seqLoop_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode",
"type": "buttonedge",
"id": "seqLLMNode_1-seqLLMNode_1-output-seqLLMNode-LLMNode-seqLoop_0-seqLoop_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode"
}
]
}
Loading

0 comments on commit ee8f9bb

Please sign in to comment.