@langchain/cloudflare
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
import { VectorizeIndex, VectorizeVectorMetadata } from "@cloudflare/workers-types"; | ||
import { VectorizeIndex, VectorizeVectorMetadata, VectorizeVectorMetadataFilter } from "@cloudflare/workers-types"; | ||
import type { EmbeddingsInterface } from "@langchain/core/embeddings"; | ||
@@ -22,2 +22,3 @@ import { VectorStore } from "@langchain/core/vectorstores"; | ||
export declare class CloudflareVectorizeStore extends VectorStore { | ||
FilterType: VectorizeVectorMetadataFilter; | ||
textKey: string; | ||
@@ -61,3 +62,3 @@ namespace?: string; | ||
*/ | ||
similaritySearchVectorWithScore(query: number[], k: number): Promise<[Document, number][]>; | ||
similaritySearchVectorWithScore(query: number[], k: number, filter?: this["FilterType"]): Promise<[Document, number][]>; | ||
/** | ||
@@ -64,0 +65,0 @@ * Static method that creates a new instance of the CloudflareVectorizeStore class |
@@ -109,3 +109,3 @@ import * as uuid from "uuid"; | ||
*/ | ||
async similaritySearchVectorWithScore(query, k) { | ||
async similaritySearchVectorWithScore(query, k, filter) { | ||
const results = await this.index.query(query, { | ||
@@ -115,2 +115,3 @@ returnMetadata: true, | ||
topK: k, | ||
filter, | ||
}); | ||
@@ -117,0 +118,0 @@ const result = []; |
{ | ||
"name": "@langchain/cloudflare", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Cloudflare integration for LangChain.js", | ||
@@ -26,3 +26,3 @@ "type": "module", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm", | ||
"clean": "rm -rf dist/ && NODE_OPTIONS=--max-old-space-size=4096 yarn create-entrypoints -- --pre", | ||
"clean": "rm -rf dist/ && NODE_OPTIONS=--max-old-space-size=4096 yarn lc-build --config ./langchain.config.js --create-entrypoints --pre", | ||
"prepack": "yarn build", | ||
@@ -29,0 +29,0 @@ "test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109250
2593