Chore/Move @langchain/core dependency to components (#2945)

* move lc core dependency to components

* anchor @langchain/aws version

* update agentic RAG template
This commit is contained in:
Henry Heng
2024-08-06 14:41:21 +01:00
committed by GitHub
parent 70d7420d02
commit ee8f9bb37c
5 changed files with 5923 additions and 7707 deletions
+3 -6
View File
@@ -56,11 +56,7 @@
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"faiss-node", "faiss-node",
"sqlite3" "sqlite3"
], ]
"overrides": {
"@langchain/core": "0.2.18",
"@langchain/aws": "^0.0.6"
}
}, },
"engines": { "engines": {
"node": ">=18.15.0 <19.0.0 || ^20", "node": ">=18.15.0 <19.0.0 || ^20",
@@ -69,7 +65,8 @@
"resolutions": { "resolutions": {
"@qdrant/openapi-typescript-fetch": "1.2.6", "@qdrant/openapi-typescript-fetch": "1.2.6",
"@google/generative-ai": "^0.15.0", "@google/generative-ai": "^0.15.0",
"openai": "4.51.0" "openai": "4.51.0",
"@langchain/aws": "0.0.6"
}, },
"eslintIgnore": [ "eslintIgnore": [
"**/dist", "**/dist",
@@ -241,14 +241,15 @@ const similaritySearchVectorWithScore = async (query: number[], k: number, vecto
const outputFields = vectorStore.fields.filter((field) => field !== vectorStore.vectorField) 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({ const searchResp = await vectorStore.client.search({
collection_name: vectorStore.collectionName, collection_name: vectorStore.collectionName,
search_params: { search_params,
anns_field: vectorStore.vectorField,
topk: k.toString(),
metric_type: vectorStore.indexCreateParams.metric_type,
params: vectorStore.indexSearchParams
},
output_fields: outputFields, output_fields: outputFields,
vector_type: DataType.FloatVector, vector_type: DataType.FloatVector,
vectors: [query], vectors: [query],
+2
View File
@@ -34,9 +34,11 @@
"@google-ai/generativelanguage": "^2.5.0", "@google-ai/generativelanguage": "^2.5.0",
"@google/generative-ai": "^0.15.0", "@google/generative-ai": "^0.15.0",
"@huggingface/inference": "^2.6.1", "@huggingface/inference": "^2.6.1",
"@langchain/aws": "^0.0.6",
"@langchain/anthropic": "^0.2.1", "@langchain/anthropic": "^0.2.1",
"@langchain/cohere": "^0.0.7", "@langchain/cohere": "^0.0.7",
"@langchain/community": "^0.2.17", "@langchain/community": "^0.2.17",
"@langchain/core": "0.2.18",
"@langchain/exa": "^0.0.5", "@langchain/exa": "^0.0.5",
"@langchain/google-genai": "^0.0.22", "@langchain/google-genai": "^0.0.22",
"@langchain/google-vertexai": "^0.0.19", "@langchain/google-vertexai": "^0.0.19",
@@ -201,7 +201,8 @@
"model": "", "model": "",
"promptValues": "{\"text\":\"{{question}}\"}", "promptValues": "{\"text\":\"{{question}}\"}",
"llmStructuredOutput": "", "llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI" "updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_0": "updateStateMemoryUI"
}, },
"outputAnchors": [ "outputAnchors": [
{ {
@@ -227,8 +228,8 @@
{ {
"id": "seqStart_0", "id": "seqStart_0",
"position": { "position": {
"x": 429.0188107292025, "x": 438.8554922368403,
"y": 277.11423822901907 "y": 259.0803221316833
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -296,8 +297,8 @@
"width": 300, "width": 300,
"height": 382, "height": 382,
"positionAbsolute": { "positionAbsolute": {
"x": 429.0188107292025, "x": 438.8554922368403,
"y": 277.11423822901907 "y": 259.0803221316833
}, },
"selected": false, "selected": false,
"dragging": false "dragging": false
@@ -769,7 +770,8 @@
"model": "", "model": "",
"promptValues": "{\"question\":\"{{question}}\"}", "promptValues": "{\"question\":\"{{question}}\"}",
"llmStructuredOutput": "", "llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI" "updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_1": "updateStateMemoryUI"
}, },
"outputAnchors": [ "outputAnchors": [
{ {
@@ -795,8 +797,8 @@
{ {
"id": "seqLLMNode_2", "id": "seqLLMNode_2",
"position": { "position": {
"x": 2205.875202632436, "x": 2227.3672008899293,
"y": 209.03456469283117 "y": 202.42164215206395
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -990,7 +992,8 @@
"model": "", "model": "",
"promptValues": "{\"question\":\"{{question}}\",\"context\":\"$flow.state.sources\"}", "promptValues": "{\"question\":\"{{question}}\",\"context\":\"$flow.state.sources\"}",
"llmStructuredOutput": "", "llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI" "updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_2": "updateStateMemoryUI"
}, },
"outputAnchors": [ "outputAnchors": [
{ {
@@ -1008,16 +1011,16 @@
"height": 450, "height": 450,
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 2205.875202632436, "x": 2227.3672008899293,
"y": 209.03456469283117 "y": 202.42164215206395
}, },
"dragging": false "dragging": false
}, },
{ {
"id": "seqLoop_0", "id": "seqLoop_0",
"position": { "position": {
"x": 2559.3078506376914, "x": 2557.3813854226105,
"y": 827.739264836123 "y": 836.5518871718609
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -1060,16 +1063,16 @@
"height": 241, "height": 241,
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 2559.3078506376914, "x": 2557.3813854226105,
"y": 827.739264836123 "y": 836.5518871718609
}, },
"dragging": false "dragging": false
}, },
{ {
"id": "seqEnd_0", "id": "seqEnd_0",
"position": { "position": {
"x": 2552.677329133902, "x": 2566.2338203424747,
"y": 439.10969421030416 "y": 472.1743069141402
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -1101,8 +1104,8 @@
"height": 143, "height": 143,
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 2552.677329133902, "x": 2566.2338203424747,
"y": 439.10969421030416 "y": 472.1743069141402
}, },
"dragging": false "dragging": false
}, },
@@ -1582,7 +1585,9 @@
], ],
"inputAnchors": [], "inputAnchors": [],
"inputs": { "inputs": {
"stateMemory": "stateMemoryUI" "stateMemory": "stateMemoryUI",
"selectedStateTab_seqState_0": "stateMemoryUI",
"stateMemoryUI": "[{\"key\":\"sources\",\"type\":\"Replace\",\"defaultValue\":\"\",\"actions\":\"\",\"id\":0}]"
}, },
"outputAnchors": [ "outputAnchors": [
{ {
@@ -1608,8 +1613,8 @@
{ {
"id": "seqLLMNode_3", "id": "seqLLMNode_3",
"position": { "position": {
"x": 1477.8265021173233, "x": 1484.4394246580907,
"y": 184.8087848768496 "y": 133.55863518590365
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -1803,7 +1808,8 @@
"model": "", "model": "",
"promptValues": "", "promptValues": "",
"llmStructuredOutput": "", "llmStructuredOutput": "",
"updateStateMemory": "updateStateMemoryUI" "updateStateMemory": "updateStateMemoryUI",
"selectedUpdateStateMemoryTab_seqLLMNode_3": "updateStateMemoryUI"
}, },
"outputAnchors": [ "outputAnchors": [
{ {
@@ -1821,8 +1827,8 @@
"height": 450, "height": 450,
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 1477.8265021173233, "x": 1484.4394246580907,
"y": 184.8087848768496 "y": 133.55863518590365
}, },
"dragging": false "dragging": false
}, },
@@ -2424,8 +2430,8 @@
{ {
"id": "stickyNote_1", "id": "stickyNote_1",
"position": { "position": {
"x": -259.34389200648127, "x": -239.50512438417962,
"y": 190.60834640491902 "y": 177.3825013233846
}, },
"type": "stickyNote", "type": "stickyNote",
"data": { "data": {
@@ -2470,8 +2476,8 @@
"selected": false, "selected": false,
"dragging": false, "dragging": false,
"positionAbsolute": { "positionAbsolute": {
"x": -259.34389200648127, "x": -239.50512438417962,
"y": 190.60834640491902 "y": 177.3825013233846
} }
}, },
{ {
@@ -2530,8 +2536,8 @@
{ {
"id": "seqToolNode_0", "id": "seqToolNode_0",
"position": { "position": {
"x": 1125.4209936219386, "x": 1145.2597612442403,
"y": 74.65954911972659 "y": 82.9257022956856
}, },
"type": "customNode", "type": "customNode",
"data": { "data": {
@@ -2727,8 +2733,8 @@
"height": 528, "height": 528,
"selected": false, "selected": false,
"positionAbsolute": { "positionAbsolute": {
"x": 1125.4209936219386, "x": 1145.2597612442403,
"y": 74.65954911972659 "y": 82.9257022956856
}, },
"dragging": false "dragging": false
}, },
@@ -2938,14 +2944,6 @@
"type": "buttonedge", "type": "buttonedge",
"id": "seqConditionAgent_0-seqConditionAgent_0-output-rewrite-Condition-seqLLMNode_1-seqLLMNode_1-input-sequentialNode-Start | Agent | Condition | LLMNode | ToolNode" "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", "source": "seqLLMNode_2",
"sourceHandle": "seqLLMNode_2-output-seqLLMNode-LLMNode", "sourceHandle": "seqLLMNode_2-output-seqLLMNode-LLMNode",
@@ -2953,6 +2951,14 @@
"targetHandle": "seqEnd_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode", "targetHandle": "seqEnd_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode",
"type": "buttonedge", "type": "buttonedge",
"id": "seqLLMNode_2-seqLLMNode_2-output-seqLLMNode-LLMNode-seqEnd_0-seqEnd_0-input-sequentialNode-Agent | Condition | LLMNode | ToolNode" "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"
} }
] ]
} }
+5864 -7654
View File
File diff suppressed because one or more lines are too long