diff --git a/bun.lockb b/bun.lockb index a3c0846..b213136 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b3f3202..abb49b8 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "d3-dsv": "^3.0.1", "html-to-text": "^9.0.5", "langchain": "^0.2.0", - "llamaindex": "0.6.0", + "llamaindex": "0.6.12", "nanoid": "^5.0.7", "pdf-parse": "^1.1.1", "unstructured-client": "^0.15.1", diff --git a/src/database.ts b/src/database.ts index edad8b8..961b19e 100644 --- a/src/database.ts +++ b/src/database.ts @@ -6,7 +6,7 @@ import { DEFAULT_SIMILARITY_THRESHOLD, DEFAULT_TOP_K } from "./constants"; import { FileDataLoader } from "./file-loader"; import type { AddContextOptions } from "./types"; import type { UnstructuredLoaderOptions } from "@langchain/community/document_loaders/fs/unstructured"; -import type { LlamaParseReader } from "llamaindex/readers/LlamaParseReader"; +import type { LlamaParseReader } from "llamaindex"; export type FilePath = string; export type URL = string; @@ -84,7 +84,7 @@ export class Database { this.index = index; } - async reset(options?: ResetOptions ) { + async reset(options?: ResetOptions) { await this.index.reset({ namespace: options?.namespace }); } diff --git a/src/file-loader.ts b/src/file-loader.ts index 480bfbb..c994702 100644 --- a/src/file-loader.ts +++ b/src/file-loader.ts @@ -12,7 +12,7 @@ import { RecursiveCharacterTextSplitter } from "langchain/text_splitter"; import { nanoid } from "nanoid"; import { UnstructuredClient } from "unstructured-client"; import type { DatasWithFileSource, FilePath, ProcessorType, URL } from "./database"; -import { LlamaParseReader } from "llamaindex/readers/LlamaParseReader"; +import { LlamaParseReader } from "llamaindex"; type Element = { type: string;