Skip to content

Commit 204d028

Browse files
fix types
1 parent f895af7 commit 204d028

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

libs/langchain-community/src/document_loaders/web/puppeteer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type {
44
Page,
55
Browser,
66
PuppeteerLaunchOptions,
7+
ConnectOptions,
78
connect,
89
} from "puppeteer";
910

@@ -29,7 +30,7 @@ export type PuppeteerEvaluate = (
2930
) => Promise<string>;
3031

3132
export type PuppeteerWebBaseLoaderOptions = {
32-
launchOptions?: PuppeteerLaunchOptions;
33+
launchOptions?: PuppeteerLaunchOptions & ConnectOptions;
3334
gotoOptions?: PuppeteerGotoOptions;
3435
evaluate?: PuppeteerEvaluate;
3536
};

libs/langchain-community/src/vectorstores/redis.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ export class RedisVectorStore extends VectorStore {
196196
await this.createIndex(vectors[0].length);
197197

198198
const info = await this.redisClient.ft.info(this.indexName);
199-
const lastKeyCount = parseInt(info.numDocs || info.num_docs, 10) || 0;
199+
const lastKeyCount =
200+
parseInt(
201+
info.numDocs ||
202+
// @ts-expect-error - num_docs is not typed as not used by all redis connectors
203+
info.num_docs,
204+
10
205+
) || 0;
200206
const multi = this.redisClient.multi();
201207

202208
vectors.map(async (vector, idx) => {

libs/langchain-redis/src/vectorstores.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ export class RedisVectorStore extends VectorStore {
193193
await this.createIndex(vectors[0].length);
194194

195195
const info = await this.redisClient.ft.info(this.indexName);
196-
const lastKeyCount = parseInt(info.numDocs || info.num_docs, 10) || 0;
196+
const lastKeyCount =
197+
parseInt(
198+
info.numDocs ||
199+
// @ts-expect-error - num_docs is not typed as not used by all redis connectors
200+
info.num_docs,
201+
10
202+
) || 0;
197203
const multi = this.redisClient.multi();
198204

199205
vectors.map(async (vector, idx) => {

0 commit comments

Comments
 (0)