diff --git a/libs/langchain-community/package.json b/libs/langchain-community/package.json index 71382e6f51a8..d5a1f6b953e8 100644 --- a/libs/langchain-community/package.json +++ b/libs/langchain-community/package.json @@ -132,8 +132,8 @@ "@upstash/ratelimit": "^2.0.3", "@upstash/redis": "^1.32.0", "@upstash/vector": "^1.1.1", - "@vercel/kv": "^0.2.3", - "@vercel/postgres": "^0.5.0", + "@vercel/kv": "^3.0.0", + "@vercel/postgres": "^0.10.0", "@writerai/writer-sdk": "^0.40.2", "@xata.io/client": "^0.28.0", "@zilliz/milvus2-sdk-node": ">=2.3.5", @@ -281,8 +281,8 @@ "@upstash/ratelimit": "^1.1.3 || ^2.0.3", "@upstash/redis": "^1.20.6", "@upstash/vector": "^1.1.1", - "@vercel/kv": "^0.2.3", - "@vercel/postgres": "^0.5.0", + "@vercel/kv": "*", + "@vercel/postgres": "*", "@writerai/writer-sdk": "^0.40.2", "@xata.io/client": "^0.28.0", "@zilliz/milvus2-sdk-node": ">=2.3.5", diff --git a/libs/langchain-community/src/storage/vercel_kv.ts b/libs/langchain-community/src/storage/vercel_kv.ts index 8f520a0d8543..f86a877a786a 100644 --- a/libs/langchain-community/src/storage/vercel_kv.ts +++ b/libs/langchain-community/src/storage/vercel_kv.ts @@ -137,7 +137,8 @@ export class VercelKVStore extends BaseStore { for (const key of batch) { yield this._getDeprefixedKey(key); } - while (cursor !== 0) { + // Backwards compatibility for older @vercel/kv versions + while (String(cursor) !== "0") { [cursor, batch] = await this.client.scan(cursor, { match: pattern, count: this.yieldKeysScanBatchSize, diff --git a/yarn.lock b/yarn.lock index 6fb66edb4fb8..4876a732129e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11946,8 +11946,8 @@ __metadata: "@upstash/ratelimit": ^2.0.3 "@upstash/redis": ^1.32.0 "@upstash/vector": ^1.1.1 - "@vercel/kv": ^0.2.3 - "@vercel/postgres": ^0.5.0 + "@vercel/kv": ^3.0.0 + "@vercel/postgres": ^0.10.0 "@writerai/writer-sdk": ^0.40.2 "@xata.io/client": ^0.28.0 "@zilliz/milvus2-sdk-node": ">=2.3.5" @@ -12103,8 +12103,8 @@ __metadata: "@upstash/ratelimit": ^1.1.3 || ^2.0.3 "@upstash/redis": ^1.20.6 "@upstash/vector": ^1.1.1 - "@vercel/kv": ^0.2.3 - "@vercel/postgres": ^0.5.0 + "@vercel/kv": "*" + "@vercel/postgres": "*" "@writerai/writer-sdk": ^0.40.2 "@xata.io/client": ^0.28.0 "@zilliz/milvus2-sdk-node": ">=2.3.5" @@ -13662,15 +13662,6 @@ __metadata: languageName: node linkType: hard -"@neondatabase/serverless@npm:0.6.0": - version: 0.6.0 - resolution: "@neondatabase/serverless@npm:0.6.0" - dependencies: - "@types/pg": 8.6.6 - checksum: 25b81ba6b37e0ac56a746a1219de6107dd74d6f2d093bc23dc33b6fb8f33d00f80cb37eb0648afacd32ab0020b20c1809e3ec6e5c34d23fa21ae5b76d6041332 - languageName: node - linkType: hard - "@neondatabase/serverless@npm:^0.9.1": version: 0.9.1 resolution: "@neondatabase/serverless@npm:0.9.1" @@ -13680,6 +13671,15 @@ __metadata: languageName: node linkType: hard +"@neondatabase/serverless@npm:^0.9.3": + version: 0.9.5 + resolution: "@neondatabase/serverless@npm:0.9.5" + dependencies: + "@types/pg": 8.11.6 + checksum: b53c4b21c6eaf995a12bd84adf2c839022b7eb8b216cb07319a784a6f60965cf9ae497560a2aa767f5f8a407f1a45783f13b9f9e8f5c2078118a6a5ae174fdb2 + languageName: node + linkType: hard + "@next/env@npm:14.0.1": version: 14.0.1 resolution: "@next/env@npm:14.0.1" @@ -19859,6 +19859,17 @@ __metadata: languageName: node linkType: hard +"@types/pg@npm:8.11.6": + version: 8.11.6 + resolution: "@types/pg@npm:8.11.6" + dependencies: + "@types/node": "*" + pg-protocol: "*" + pg-types: ^4.0.1 + checksum: 231f7e5bfe8b4d14cca398d24cd55f4f14f582f815b62059e6f3ee74108cf92089fbd946568ebc35fa402f238ed9c8a8c1e10e7084e83e4ca3aff75957243014 + languageName: node + linkType: hard + "@types/pg@npm:8.6.6": version: 8.6.6 resolution: "@types/pg@npm:8.6.6" @@ -20856,6 +20867,15 @@ __metadata: languageName: node linkType: hard +"@upstash/redis@npm:^1.34.0": + version: 1.34.3 + resolution: "@upstash/redis@npm:1.34.3" + dependencies: + crypto-js: ^4.2.0 + checksum: 4c738eb82e3d8906999345379ff0c96913627cdf96ec54b6880fa8fb5616331a92228b889c076b4a93bee4bb31324f5afa68aa927fb751d308fc83464de68e79 + languageName: node + linkType: hard + "@upstash/vector@npm:^1.1.1": version: 1.1.1 resolution: "@upstash/vector@npm:1.1.1" @@ -20872,6 +20892,15 @@ __metadata: languageName: node linkType: hard +"@vercel/kv@npm:^3.0.0": + version: 3.0.0 + resolution: "@vercel/kv@npm:3.0.0" + dependencies: + "@upstash/redis": ^1.34.0 + checksum: 5bebab15c770e32409c03054dbd58e3e5a4d77d1a813c91e6613a9382a96b391878b67a1e2fbe8f7e197899a2dc589212ee6f6b11ab272798954e63816c6eba1 + languageName: node + linkType: hard + "@vercel/ncc@npm:^0.34.0": version: 0.34.0 resolution: "@vercel/ncc@npm:0.34.0" @@ -20883,15 +20912,14 @@ __metadata: languageName: node linkType: hard -"@vercel/postgres@npm:^0.5.0": - version: 0.5.0 - resolution: "@vercel/postgres@npm:0.5.0" +"@vercel/postgres@npm:^0.10.0": + version: 0.10.0 + resolution: "@vercel/postgres@npm:0.10.0" dependencies: - "@neondatabase/serverless": 0.6.0 - bufferutil: 4.0.7 - utf-8-validate: 6.0.3 - ws: 8.14.2 - checksum: 9fe0f496753a481d06566e7b846956c2129af081080f6618a4f9f8efb90ae53cc2aa1b3598a95ecc04f612b0ffdfcfffd20921fd1187fdc3db99b35d24b73a3f + "@neondatabase/serverless": ^0.9.3 + bufferutil: ^4.0.8 + ws: ^8.17.1 + checksum: 45c29baa73bed4b07a5c06ae283647d43c89d843ebd3cb4864b59ec4217ef5d24832e569cd08d61f8b7875522fc207bb364547ea7e9423dd37521fba24ccec20 languageName: node linkType: hard @@ -22816,13 +22844,13 @@ __metadata: languageName: node linkType: hard -"bufferutil@npm:4.0.7": - version: 4.0.7 - resolution: "bufferutil@npm:4.0.7" +"bufferutil@npm:^4.0.8": + version: 4.0.9 + resolution: "bufferutil@npm:4.0.9" dependencies: node-gyp: latest node-gyp-build: ^4.3.0 - checksum: f75aa87e3d1b99b87a95f60a855e63f70af07b57fb8443e75a2ddfef2e47788d130fdd46e3a78fd7e0c10176082b26dfbed970c5b8632e1cc299cafa0e93ce45 + checksum: 51ce9ee19bc4b72c2eb9f9a231dd95e786ca5a00a6bdfcae83f1d5cd8169301c79245ce96913066a5a1bbe45c44e95bc5a1761a18798b835585c1a05af65b209 languageName: node linkType: hard @@ -43581,16 +43609,6 @@ __metadata: languageName: node linkType: hard -"utf-8-validate@npm:6.0.3": - version: 6.0.3 - resolution: "utf-8-validate@npm:6.0.3" - dependencies: - node-gyp: latest - node-gyp-build: ^4.3.0 - checksum: 5e21383c81ff7469c1912119ca69d07202d944c73ddd8a54b84dddcc546b939054e5101c78c294e494d206fe93bd43428adc635a0660816b3ec9c8ec89286ac4 - languageName: node - linkType: hard - "util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2"