diff --git a/Package.resolved b/Package.resolved index 34f8098..5efce18 100644 --- a/Package.resolved +++ b/Package.resolved @@ -266,8 +266,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/buhe/SwiftyNotion", "state" : { - "revision" : "64e053ad708827655589a39dc0dbf897e109219c", - "version" : "0.1.4" + "branch" : "main", + "revision" : "ccfe5600df5e315e48470ca840f682ec446869f8" } }, { diff --git a/Package.swift b/Package.swift index 7e78acc..3074e42 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/buhe/similarity-search-kit", from: "0.0.16"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), - .package(url: "https://github.com/buhe/SwiftyNotion", .upToNextMajor(from: "0.1.4")), + .package(url: "https://github.com/buhe/SwiftyNotion", .upToNextMajor(from: "0.1.5")), .package(url: "https://github.com/nmdias/FeedKit", .upToNextMajor(from: "9.1.2")), ], targets: [ diff --git a/Sources/LangChain/vectorstores/VectorStore.swift b/Sources/LangChain/vectorstores/VectorStore.swift index 774bfae..1d60b09 100644 --- a/Sources/LangChain/vectorstores/VectorStore.swift +++ b/Sources/LangChain/vectorstores/VectorStore.swift @@ -24,18 +24,15 @@ public class VectorStore { } func add_documents(documents: [Document]) async { - await withTaskGroup(of: Void.self) { [self] group in - for document in documents { - group.addTask { await self.addText(text: document.page_content, metadata: document.metadata)} - } + for document in documents { + await self.addText(text: document.page_content, metadata: document.metadata) } } + func remove_documents(sha256s: [String]) async { - await withTaskGroup(of: Void.self) { [self] group in - for sha256 in sha256s { - group.addTask { await self.removeText(sha256: sha256)} - } + for sha256 in sha256s { + await self.removeText(sha256: sha256) } } // def add_documents(self, documents: List[Document], **kwargs: Any) -> List[str]: