@langchain/core 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/agents.d.cts +0 -2
- package/dist/agents.d.ts +0 -2
- package/dist/callbacks/base.d.cts +22 -60
- package/dist/callbacks/base.d.ts +22 -60
- package/dist/callbacks/dispatch/index.d.cts +1 -3
- package/dist/callbacks/dispatch/index.d.ts +1 -3
- package/dist/callbacks/dispatch/web.d.cts +1 -3
- package/dist/callbacks/dispatch/web.d.ts +1 -3
- package/dist/callbacks/manager.d.cts +2 -12
- package/dist/callbacks/manager.d.ts +2 -12
- package/dist/chat_history.cjs +1 -1
- package/dist/chat_history.d.cts +0 -1
- package/dist/chat_history.d.ts +0 -1
- package/dist/chat_history.js +1 -1
- package/dist/document_loaders/langsmith.d.cts +0 -3
- package/dist/document_loaders/langsmith.d.ts +0 -3
- package/dist/documents/document.d.cts +3 -12
- package/dist/documents/document.d.ts +3 -12
- package/dist/example_selectors/length_based.d.cts +1 -1
- package/dist/example_selectors/length_based.d.ts +1 -1
- package/dist/indexing/base.d.cts +0 -1
- package/dist/indexing/base.d.ts +0 -1
- package/dist/indexing/record_manager.d.cts +0 -1
- package/dist/indexing/record_manager.d.ts +0 -1
- package/dist/language_models/base.d.cts +8 -38
- package/dist/language_models/base.d.ts +8 -38
- package/dist/language_models/chat_models.cjs +1 -1
- package/dist/language_models/chat_models.d.cts +6 -33
- package/dist/language_models/chat_models.d.ts +6 -33
- package/dist/language_models/chat_models.js +1 -1
- package/dist/language_models/llms.d.cts +0 -6
- package/dist/language_models/llms.d.ts +0 -6
- package/dist/load/import_type.d.cts +0 -1
- package/dist/load/import_type.d.ts +0 -1
- package/dist/load/map_keys.cjs +4 -5
- package/dist/load/map_keys.cjs.map +1 -1
- package/dist/load/map_keys.d.cts +0 -1
- package/dist/load/map_keys.d.ts +0 -1
- package/dist/load/map_keys.js +3 -3
- package/dist/load/map_keys.js.map +1 -1
- package/dist/load/serializable.d.cts +0 -1
- package/dist/load/serializable.d.ts +0 -1
- package/dist/memory.d.cts +0 -3
- package/dist/memory.d.ts +0 -3
- package/dist/messages/ai.cjs +6 -48
- package/dist/messages/ai.cjs.map +1 -1
- package/dist/messages/ai.js +6 -48
- package/dist/messages/ai.js.map +1 -1
- package/dist/messages/base.cjs +3 -2
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.d.cts +1 -13
- package/dist/messages/base.d.ts +1 -13
- package/dist/messages/base.js +3 -2
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/content/data.d.cts +2 -7
- package/dist/messages/content/data.d.ts +2 -7
- package/dist/messages/content/index.d.cts +1 -4
- package/dist/messages/content/index.d.ts +1 -4
- package/dist/messages/content/multimodal.d.cts +0 -1
- package/dist/messages/content/multimodal.d.ts +0 -1
- package/dist/messages/content/tools.d.cts +0 -1
- package/dist/messages/content/tools.d.ts +0 -1
- package/dist/messages/index.cjs +4 -2
- package/dist/messages/index.d.cts +2 -2
- package/dist/messages/index.d.ts +2 -2
- package/dist/messages/index.js +5 -4
- package/dist/messages/tool.d.cts +2 -9
- package/dist/messages/tool.d.ts +2 -9
- package/dist/messages/transformers.cjs +2 -2
- package/dist/messages/transformers.d.cts +0 -3
- package/dist/messages/transformers.d.ts +0 -3
- package/dist/messages/transformers.js +2 -2
- package/dist/messages/utils.cjs +77 -4
- package/dist/messages/utils.cjs.map +1 -1
- package/dist/messages/utils.d.cts +35 -7
- package/dist/messages/utils.d.ts +35 -7
- package/dist/messages/utils.js +77 -5
- package/dist/messages/utils.js.map +1 -1
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs +169 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js +168 -0
- package/dist/node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js.map +1 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs +122 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js +121 -0
- package/dist/node_modules/.pnpm/camelcase@9.0.0/node_modules/camelcase/index.js.map +1 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs +18 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js +17 -0
- package/dist/node_modules/.pnpm/decamelize@6.0.1/node_modules/decamelize/index.js.map +1 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs +27 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js +26 -0
- package/dist/node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js.map +1 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs +141 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js +141 -0
- package/dist/node_modules/.pnpm/p-retry@7.1.0/node_modules/p-retry/index.js.map +1 -0
- package/dist/output_parsers/json.d.cts +1 -5
- package/dist/output_parsers/json.d.ts +1 -5
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts +2 -6
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +2 -6
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +10 -34
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +10 -34
- package/dist/output_parsers/transform.d.cts +0 -1
- package/dist/output_parsers/transform.d.ts +0 -1
- package/dist/outputs.d.cts +0 -6
- package/dist/outputs.d.ts +0 -6
- package/dist/prompts/base.d.cts +2 -10
- package/dist/prompts/base.d.ts +2 -10
- package/dist/prompts/chat.cjs +2 -2
- package/dist/prompts/chat.d.cts +13 -51
- package/dist/prompts/chat.d.ts +13 -51
- package/dist/prompts/chat.js +2 -2
- package/dist/prompts/few_shot.d.cts +1 -5
- package/dist/prompts/few_shot.d.ts +1 -5
- package/dist/prompts/image.d.cts +2 -10
- package/dist/prompts/image.d.ts +2 -10
- package/dist/prompts/prompt.d.cts +4 -15
- package/dist/prompts/prompt.d.ts +4 -16
- package/dist/prompts/serde.d.cts +0 -1
- package/dist/prompts/serde.d.ts +0 -1
- package/dist/prompts/string.d.cts +1 -5
- package/dist/prompts/string.d.ts +1 -5
- package/dist/prompts/structured.d.cts +3 -16
- package/dist/prompts/structured.d.ts +3 -16
- package/dist/retrievers/document_compressors/index.d.cts +0 -1
- package/dist/retrievers/document_compressors/index.d.ts +0 -1
- package/dist/retrievers/index.d.cts +2 -6
- package/dist/retrievers/index.d.ts +2 -6
- package/dist/runnables/base.cjs +7 -7
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +12 -64
- package/dist/runnables/base.d.ts +12 -64
- package/dist/runnables/base.js +1 -1
- package/dist/runnables/branch.d.cts +0 -2
- package/dist/runnables/branch.d.ts +0 -2
- package/dist/runnables/config.d.cts +0 -1
- package/dist/runnables/config.d.ts +0 -1
- package/dist/runnables/graph.d.cts +1 -5
- package/dist/runnables/graph.d.ts +1 -5
- package/dist/runnables/graph_mermaid.cjs +2 -1
- package/dist/runnables/graph_mermaid.cjs.map +1 -1
- package/dist/runnables/graph_mermaid.js +3 -1
- package/dist/runnables/graph_mermaid.js.map +1 -1
- package/dist/runnables/history.cjs +1 -1
- package/dist/runnables/history.d.cts +4 -12
- package/dist/runnables/history.d.ts +4 -12
- package/dist/runnables/history.js +1 -1
- package/dist/runnables/passthrough.d.cts +0 -2
- package/dist/runnables/passthrough.d.ts +0 -2
- package/dist/runnables/router.d.cts +0 -1
- package/dist/runnables/router.d.ts +0 -1
- package/dist/runnables/types.d.cts +2 -9
- package/dist/runnables/types.d.ts +2 -9
- package/dist/runnables/utils.cjs +5 -0
- package/dist/runnables/utils.cjs.map +1 -1
- package/dist/runnables/utils.js +5 -1
- package/dist/runnables/utils.js.map +1 -1
- package/dist/singletons/async_local_storage/context.d.cts +0 -2
- package/dist/singletons/async_local_storage/context.d.ts +0 -2
- package/dist/singletons/async_local_storage/globals.d.cts +0 -1
- package/dist/singletons/async_local_storage/globals.d.ts +0 -1
- package/dist/singletons/callbacks.cjs.map +1 -1
- package/dist/singletons/callbacks.js.map +1 -1
- package/dist/stores.d.cts +0 -1
- package/dist/stores.d.ts +0 -1
- package/dist/structured_query/utils.d.cts +1 -4
- package/dist/structured_query/utils.d.ts +1 -4
- package/dist/tools/index.d.cts +1 -6
- package/dist/tools/index.d.ts +1 -6
- package/dist/tools/types.d.cts +3 -13
- package/dist/tools/types.d.ts +3 -13
- package/dist/tracers/base.d.cts +1 -20
- package/dist/tracers/base.d.ts +1 -20
- package/dist/tracers/console.cjs +3 -3
- package/dist/tracers/console.cjs.map +1 -1
- package/dist/tracers/console.d.cts +0 -2
- package/dist/tracers/console.d.ts +0 -2
- package/dist/tracers/console.js +3 -3
- package/dist/tracers/console.js.map +1 -1
- package/dist/tracers/event_stream.d.cts +0 -4
- package/dist/tracers/event_stream.d.ts +0 -4
- package/dist/tracers/log_stream.d.cts +0 -6
- package/dist/tracers/log_stream.d.ts +0 -6
- package/dist/types/_internal.d.cts +0 -3
- package/dist/types/_internal.d.ts +0 -3
- package/dist/types/type-utils.d.cts +0 -2
- package/dist/types/type-utils.d.ts +0 -2
- package/dist/utils/async_caller.cjs +2 -7
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.d.cts +0 -3
- package/dist/utils/async_caller.d.ts +0 -3
- package/dist/utils/async_caller.js +1 -6
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/env.d.cts +0 -4
- package/dist/utils/env.d.ts +0 -4
- package/dist/utils/event_source_parse.d.cts +1 -4
- package/dist/utils/event_source_parse.d.ts +1 -4
- package/dist/utils/function_calling.d.cts +1 -3
- package/dist/utils/function_calling.d.ts +1 -3
- package/dist/utils/json.d.cts +0 -1
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/stream.d.cts +1 -13
- package/dist/utils/stream.d.ts +1 -13
- package/dist/utils/testing/chat_models.d.cts +3 -11
- package/dist/utils/testing/chat_models.d.ts +3 -11
- package/dist/utils/testing/message_history.cjs +1 -1
- package/dist/utils/testing/message_history.js +1 -1
- package/dist/utils/testing/retrievers.d.cts +1 -3
- package/dist/utils/testing/retrievers.d.ts +1 -3
- package/dist/utils/testing/vectorstores.d.cts +0 -1
- package/dist/utils/testing/vectorstores.d.ts +0 -1
- package/dist/utils/types/index.cjs +4 -0
- package/dist/utils/types/index.d.cts +2 -4
- package/dist/utils/types/index.d.ts +2 -4
- package/dist/utils/types/index.js +4 -2
- package/dist/utils/types/zod.cjs +24 -0
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +4 -4
- package/dist/utils/types/zod.d.ts +4 -4
- package/dist/utils/types/zod.js +23 -1
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/vectorstores.d.cts +5 -17
- package/dist/vectorstores.d.ts +5 -17
- package/package.json +6 -6
package/dist/vectorstores.d.cts
CHANGED
|
@@ -9,7 +9,6 @@ import { BaseRetriever, BaseRetrieverInput, BaseRetrieverInterface } from "./ret
|
|
|
9
9
|
/**
|
|
10
10
|
* Type for options when adding a document to the VectorStore.
|
|
11
11
|
*/
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
type AddDocumentOptions = Record<string, any>;
|
|
14
13
|
/**
|
|
15
14
|
* Options for configuring a maximal marginal relevance (MMR) search.
|
|
@@ -340,7 +339,6 @@ interface VectorStoreInterface extends Serializable {
|
|
|
340
339
|
* the conditions for selecting documents to delete.
|
|
341
340
|
* @returns A promise that resolves once the deletion operation is complete.
|
|
342
341
|
*/
|
|
343
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
344
342
|
delete(_params?: Record<string, any>): Promise<void>;
|
|
345
343
|
/**
|
|
346
344
|
* Searches for documents similar to a given vector query and returns them
|
|
@@ -432,7 +430,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
432
430
|
*
|
|
433
431
|
* @internal
|
|
434
432
|
*/
|
|
435
|
-
// Only ever instantiated in main LangChain
|
|
436
433
|
lc_namespace: string[];
|
|
437
434
|
/**
|
|
438
435
|
* Embeddings interface for generating vector embeddings from text queries,
|
|
@@ -445,7 +442,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
445
442
|
* @param embeddings - Instance of `EmbeddingsInterface` used to embed queries.
|
|
446
443
|
* @param dbConfig - Configuration settings for the database or storage system.
|
|
447
444
|
*/
|
|
448
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
449
445
|
constructor(embeddings: EmbeddingsInterface, dbConfig: Record<string, any>);
|
|
450
446
|
/**
|
|
451
447
|
* Returns a string representing the type of vector store, which subclasses
|
|
@@ -481,7 +477,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
481
477
|
* @param _params - Flexible key-value pairs defining conditions for document deletion.
|
|
482
478
|
* @returns A promise that resolves once the deletion is complete.
|
|
483
479
|
*/
|
|
484
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
485
480
|
delete(_params?: Record<string, any>): Promise<void>;
|
|
486
481
|
/**
|
|
487
482
|
* Performs a similarity search using a vector query and returns results
|
|
@@ -504,8 +499,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
504
499
|
* @param _callbacks - Optional callbacks for monitoring search progress
|
|
505
500
|
* @returns A promise resolving to an array of `DocumentInterface` instances representing similar documents.
|
|
506
501
|
*/
|
|
507
|
-
similaritySearch(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined
|
|
508
|
-
): Promise<DocumentInterface[]>;
|
|
502
|
+
similaritySearch(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined): Promise<DocumentInterface[]>;
|
|
509
503
|
/**
|
|
510
504
|
* Searches for documents similar to a text query by embedding the query,
|
|
511
505
|
* and returns results with similarity scores.
|
|
@@ -517,8 +511,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
517
511
|
* @returns A promise resolving to an array of tuples, each containing a
|
|
518
512
|
* document and its similarity score.
|
|
519
513
|
*/
|
|
520
|
-
similaritySearchWithScore(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined
|
|
521
|
-
): Promise<[DocumentInterface, number][]>;
|
|
514
|
+
similaritySearchWithScore(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined): Promise<[DocumentInterface, number][]>;
|
|
522
515
|
/**
|
|
523
516
|
* Return documents selected using the maximal marginal relevance.
|
|
524
517
|
* Maximal marginal relevance optimizes for similarity to the query AND diversity
|
|
@@ -534,8 +527,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
534
527
|
*
|
|
535
528
|
* @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.
|
|
536
529
|
*/
|
|
537
|
-
maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks: Callbacks | undefined
|
|
538
|
-
): Promise<DocumentInterface[]>;
|
|
530
|
+
maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;
|
|
539
531
|
/**
|
|
540
532
|
* Creates a `VectorStore` instance from an array of text strings and optional
|
|
541
533
|
* metadata, using the specified embeddings and database configuration.
|
|
@@ -551,9 +543,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
551
543
|
* @returns A promise that resolves to a new `VectorStore` instance.
|
|
552
544
|
* @throws {Error} Throws an error if this method is not overridden by a subclass.
|
|
553
545
|
*/
|
|
554
|
-
static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface,
|
|
555
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
556
|
-
_dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
546
|
+
static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
557
547
|
/**
|
|
558
548
|
* Creates a `VectorStore` instance from an array of documents, using the specified
|
|
559
549
|
* embeddings and database configuration.
|
|
@@ -567,9 +557,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
567
557
|
* @returns A promise that resolves to a new `VectorStore` instance.
|
|
568
558
|
* @throws {Error} Throws an error if this method is not overridden by a subclass.
|
|
569
559
|
*/
|
|
570
|
-
static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface,
|
|
571
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
572
|
-
_dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
560
|
+
static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
573
561
|
/**
|
|
574
562
|
* Creates a `VectorStoreRetriever` instance with flexible configuration options.
|
|
575
563
|
*
|
package/dist/vectorstores.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { BaseRetriever, BaseRetrieverInput, BaseRetrieverInterface } from "./ret
|
|
|
9
9
|
/**
|
|
10
10
|
* Type for options when adding a document to the VectorStore.
|
|
11
11
|
*/
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
type AddDocumentOptions = Record<string, any>;
|
|
14
13
|
/**
|
|
15
14
|
* Options for configuring a maximal marginal relevance (MMR) search.
|
|
@@ -340,7 +339,6 @@ interface VectorStoreInterface extends Serializable {
|
|
|
340
339
|
* the conditions for selecting documents to delete.
|
|
341
340
|
* @returns A promise that resolves once the deletion operation is complete.
|
|
342
341
|
*/
|
|
343
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
344
342
|
delete(_params?: Record<string, any>): Promise<void>;
|
|
345
343
|
/**
|
|
346
344
|
* Searches for documents similar to a given vector query and returns them
|
|
@@ -432,7 +430,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
432
430
|
*
|
|
433
431
|
* @internal
|
|
434
432
|
*/
|
|
435
|
-
// Only ever instantiated in main LangChain
|
|
436
433
|
lc_namespace: string[];
|
|
437
434
|
/**
|
|
438
435
|
* Embeddings interface for generating vector embeddings from text queries,
|
|
@@ -445,7 +442,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
445
442
|
* @param embeddings - Instance of `EmbeddingsInterface` used to embed queries.
|
|
446
443
|
* @param dbConfig - Configuration settings for the database or storage system.
|
|
447
444
|
*/
|
|
448
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
449
445
|
constructor(embeddings: EmbeddingsInterface, dbConfig: Record<string, any>);
|
|
450
446
|
/**
|
|
451
447
|
* Returns a string representing the type of vector store, which subclasses
|
|
@@ -481,7 +477,6 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
481
477
|
* @param _params - Flexible key-value pairs defining conditions for document deletion.
|
|
482
478
|
* @returns A promise that resolves once the deletion is complete.
|
|
483
479
|
*/
|
|
484
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
485
480
|
delete(_params?: Record<string, any>): Promise<void>;
|
|
486
481
|
/**
|
|
487
482
|
* Performs a similarity search using a vector query and returns results
|
|
@@ -504,8 +499,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
504
499
|
* @param _callbacks - Optional callbacks for monitoring search progress
|
|
505
500
|
* @returns A promise resolving to an array of `DocumentInterface` instances representing similar documents.
|
|
506
501
|
*/
|
|
507
|
-
similaritySearch(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined
|
|
508
|
-
): Promise<DocumentInterface[]>;
|
|
502
|
+
similaritySearch(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined): Promise<DocumentInterface[]>;
|
|
509
503
|
/**
|
|
510
504
|
* Searches for documents similar to a text query by embedding the query,
|
|
511
505
|
* and returns results with similarity scores.
|
|
@@ -517,8 +511,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
517
511
|
* @returns A promise resolving to an array of tuples, each containing a
|
|
518
512
|
* document and its similarity score.
|
|
519
513
|
*/
|
|
520
|
-
similaritySearchWithScore(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined
|
|
521
|
-
): Promise<[DocumentInterface, number][]>;
|
|
514
|
+
similaritySearchWithScore(query: string, k?: number, filter?: this["FilterType"] | undefined, _callbacks?: Callbacks | undefined): Promise<[DocumentInterface, number][]>;
|
|
522
515
|
/**
|
|
523
516
|
* Return documents selected using the maximal marginal relevance.
|
|
524
517
|
* Maximal marginal relevance optimizes for similarity to the query AND diversity
|
|
@@ -534,8 +527,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
534
527
|
*
|
|
535
528
|
* @returns {Promise<DocumentInterface[]>} - List of documents selected by maximal marginal relevance.
|
|
536
529
|
*/
|
|
537
|
-
maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks: Callbacks | undefined
|
|
538
|
-
): Promise<DocumentInterface[]>;
|
|
530
|
+
maxMarginalRelevanceSearch?(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks: Callbacks | undefined): Promise<DocumentInterface[]>;
|
|
539
531
|
/**
|
|
540
532
|
* Creates a `VectorStore` instance from an array of text strings and optional
|
|
541
533
|
* metadata, using the specified embeddings and database configuration.
|
|
@@ -551,9 +543,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
551
543
|
* @returns A promise that resolves to a new `VectorStore` instance.
|
|
552
544
|
* @throws {Error} Throws an error if this method is not overridden by a subclass.
|
|
553
545
|
*/
|
|
554
|
-
static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface,
|
|
555
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
556
|
-
_dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
546
|
+
static fromTexts(_texts: string[], _metadatas: object[] | object, _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
557
547
|
/**
|
|
558
548
|
* Creates a `VectorStore` instance from an array of documents, using the specified
|
|
559
549
|
* embeddings and database configuration.
|
|
@@ -567,9 +557,7 @@ declare abstract class VectorStore extends Serializable implements VectorStoreIn
|
|
|
567
557
|
* @returns A promise that resolves to a new `VectorStore` instance.
|
|
568
558
|
* @throws {Error} Throws an error if this method is not overridden by a subclass.
|
|
569
559
|
*/
|
|
570
|
-
static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface,
|
|
571
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
572
|
-
_dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
560
|
+
static fromDocuments(_docs: DocumentInterface[], _embeddings: EmbeddingsInterface, _dbConfig: Record<string, any>): Promise<VectorStore>;
|
|
573
561
|
/**
|
|
574
562
|
* Creates a `VectorStoreRetriever` instance with flexible configuration options.
|
|
575
563
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Core LangChain.js abstractions and schemas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,14 +17,10 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@cfworker/json-schema": "^4.0.2",
|
|
20
|
-
"ansi-styles": "^5.0.0",
|
|
21
|
-
"camelcase": "6",
|
|
22
|
-
"decamelize": "1.2.0",
|
|
23
20
|
"js-tiktoken": "^1.0.12",
|
|
24
21
|
"langsmith": "^0.3.64",
|
|
25
22
|
"mustache": "^4.2.0",
|
|
26
|
-
"p-queue": "^
|
|
27
|
-
"p-retry": "^7.0.0",
|
|
23
|
+
"p-queue": "^9.0.1",
|
|
28
24
|
"uuid": "^10.0.0",
|
|
29
25
|
"zod": "^3.25.76 || ^4"
|
|
30
26
|
},
|
|
@@ -32,10 +28,14 @@
|
|
|
32
28
|
"@types/decamelize": "^1.2.0",
|
|
33
29
|
"@types/mustache": "^4",
|
|
34
30
|
"@types/uuid": "^10.0.0",
|
|
31
|
+
"ansi-styles": "^6.2.3",
|
|
32
|
+
"camelcase": "^9.0.0",
|
|
33
|
+
"decamelize": "^6.0.1",
|
|
35
34
|
"dotenv": "^17.2.1",
|
|
36
35
|
"dpdm": "^3.14.0",
|
|
37
36
|
"eslint": "^9.34.0",
|
|
38
37
|
"ml-matrix": "^6.10.4",
|
|
38
|
+
"p-retry": "^7.0.0",
|
|
39
39
|
"prettier": "^2.8.3",
|
|
40
40
|
"rimraf": "^5.0.1",
|
|
41
41
|
"typescript": "~5.8.3",
|