langchain 0.0.146 → 0.0.148
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/chat_models/googlevertexai/web.cjs +1 -0
- package/chat_models/googlevertexai/web.d.ts +1 -0
- package/chat_models/googlevertexai/web.js +1 -0
- package/chat_models/googlevertexai.cjs +1 -1
- package/chat_models/googlevertexai.d.ts +1 -1
- package/chat_models/googlevertexai.js +1 -1
- package/dist/base_language/index.cjs +2 -2
- package/dist/base_language/index.d.ts +2 -1
- package/dist/base_language/index.js +1 -1
- package/dist/chains/base.d.ts +1 -1
- package/dist/chains/constitutional_ai/constitutional_principle.cjs +272 -1
- package/dist/chains/constitutional_ai/constitutional_principle.js +272 -1
- package/dist/chains/openai_functions/openapi.cjs +32 -27
- package/dist/chains/openai_functions/openapi.d.ts +9 -0
- package/dist/chains/openai_functions/openapi.js +31 -27
- package/dist/chat_models/base.d.ts +1 -1
- package/dist/chat_models/{googlevertexai.cjs → googlevertexai/common.cjs} +14 -26
- package/dist/chat_models/{googlevertexai.d.ts → googlevertexai/common.d.ts} +13 -22
- package/dist/chat_models/{googlevertexai.js → googlevertexai/common.js} +12 -24
- package/dist/chat_models/googlevertexai/index.cjs +36 -0
- package/dist/chat_models/googlevertexai/index.d.ts +21 -0
- package/dist/chat_models/googlevertexai/index.js +31 -0
- package/dist/chat_models/googlevertexai/web.cjs +33 -0
- package/dist/chat_models/googlevertexai/web.d.ts +19 -0
- package/dist/chat_models/googlevertexai/web.js +28 -0
- package/dist/chat_models/openai.cjs +1 -1
- package/dist/chat_models/openai.js +1 -1
- package/dist/document_loaders/web/notionapi.cjs +93 -70
- package/dist/document_loaders/web/notionapi.d.ts +33 -1
- package/dist/document_loaders/web/notionapi.js +89 -71
- package/dist/embeddings/googlevertexai.cjs +5 -1
- package/dist/embeddings/googlevertexai.d.ts +2 -1
- package/dist/embeddings/googlevertexai.js +5 -1
- package/dist/evaluation/agents/index.cjs +17 -0
- package/dist/evaluation/agents/index.d.ts +1 -0
- package/dist/evaluation/agents/index.js +1 -0
- package/dist/evaluation/agents/prompt.cjs +132 -0
- package/dist/evaluation/agents/prompt.d.ts +6 -0
- package/dist/evaluation/agents/prompt.js +129 -0
- package/dist/evaluation/agents/trajectory.cjs +189 -0
- package/dist/evaluation/agents/trajectory.d.ts +54 -0
- package/dist/evaluation/agents/trajectory.js +184 -0
- package/dist/evaluation/base.cjs +274 -0
- package/dist/evaluation/base.d.ts +232 -0
- package/dist/evaluation/base.js +263 -0
- package/dist/evaluation/comparison/index.cjs +17 -0
- package/dist/evaluation/comparison/index.d.ts +1 -0
- package/dist/evaluation/comparison/index.js +1 -0
- package/dist/evaluation/comparison/pairwise.cjs +244 -0
- package/dist/evaluation/comparison/pairwise.d.ts +50 -0
- package/dist/evaluation/comparison/pairwise.js +238 -0
- package/dist/evaluation/comparison/prompt.cjs +74 -0
- package/dist/evaluation/comparison/prompt.d.ts +21 -0
- package/dist/evaluation/comparison/prompt.js +71 -0
- package/dist/evaluation/criteria/criteria.cjs +259 -0
- package/dist/evaluation/criteria/criteria.d.ts +73 -0
- package/dist/evaluation/criteria/criteria.js +253 -0
- package/dist/evaluation/criteria/index.cjs +17 -0
- package/dist/evaluation/criteria/index.d.ts +1 -0
- package/dist/evaluation/criteria/index.js +1 -0
- package/dist/evaluation/criteria/prompt.cjs +36 -0
- package/dist/evaluation/criteria/prompt.d.ts +12 -0
- package/dist/evaluation/criteria/prompt.js +33 -0
- package/dist/evaluation/embedding_distance/base.cjs +163 -0
- package/dist/evaluation/embedding_distance/base.d.ts +78 -0
- package/dist/evaluation/embedding_distance/base.js +156 -0
- package/dist/evaluation/embedding_distance/index.cjs +17 -0
- package/dist/evaluation/embedding_distance/index.d.ts +1 -0
- package/dist/evaluation/embedding_distance/index.js +1 -0
- package/dist/evaluation/index.cjs +6 -0
- package/dist/evaluation/index.d.ts +6 -0
- package/dist/evaluation/index.js +6 -0
- package/dist/evaluation/loader.cjs +60 -0
- package/dist/evaluation/loader.d.ts +27 -0
- package/dist/evaluation/loader.js +56 -0
- package/dist/evaluation/types.cjs +2 -0
- package/dist/evaluation/types.d.ts +35 -0
- package/dist/evaluation/types.js +1 -0
- package/dist/experimental/llms/bittensor.cjs +141 -0
- package/dist/experimental/llms/bittensor.d.ts +33 -0
- package/dist/experimental/llms/bittensor.js +137 -0
- package/dist/experimental/multimodal_embeddings/googlevertexai.cjs +5 -1
- package/dist/experimental/multimodal_embeddings/googlevertexai.d.ts +2 -1
- package/dist/experimental/multimodal_embeddings/googlevertexai.js +5 -1
- package/dist/hub.d.ts +1 -1
- package/dist/llms/base.d.ts +1 -1
- package/dist/llms/{googlevertexai.js → googlevertexai/common.cjs} +21 -17
- package/dist/llms/{googlevertexai.d.ts → googlevertexai/common.d.ts} +13 -23
- package/dist/llms/{googlevertexai.cjs → googlevertexai/common.js} +17 -21
- package/dist/llms/googlevertexai/index.cjs +34 -0
- package/dist/llms/googlevertexai/index.d.ts +26 -0
- package/dist/llms/googlevertexai/index.js +30 -0
- package/dist/llms/googlevertexai/web.cjs +31 -0
- package/dist/llms/googlevertexai/web.d.ts +24 -0
- package/dist/llms/googlevertexai/web.js +27 -0
- package/dist/llms/openai-chat.cjs +1 -1
- package/dist/llms/openai-chat.js +1 -1
- package/dist/llms/openai.cjs +1 -1
- package/dist/llms/openai.js +1 -1
- package/dist/load/import_constants.cjs +3 -0
- package/dist/load/import_constants.js +3 -0
- package/dist/load/import_map.cjs +3 -2
- package/dist/load/import_map.d.ts +2 -1
- package/dist/load/import_map.js +2 -1
- package/dist/load/index.cjs +2 -1
- package/dist/load/index.js +2 -1
- package/dist/load/serializable.cjs +23 -4
- package/dist/load/serializable.js +23 -4
- package/dist/prompts/base.cjs +2 -2
- package/dist/prompts/base.d.ts +1 -1
- package/dist/prompts/base.js +1 -1
- package/dist/prompts/chat.cjs +2 -2
- package/dist/prompts/chat.d.ts +1 -1
- package/dist/prompts/chat.js +1 -1
- package/dist/retrievers/multi_query.cjs +140 -0
- package/dist/retrievers/multi_query.d.ts +33 -0
- package/dist/retrievers/multi_query.js +136 -0
- package/dist/schema/document.cjs +2 -2
- package/dist/schema/document.d.ts +1 -1
- package/dist/schema/document.js +1 -1
- package/dist/schema/output_parser.cjs +2 -2
- package/dist/schema/output_parser.d.ts +2 -1
- package/dist/schema/output_parser.js +1 -1
- package/dist/schema/retriever.cjs +2 -2
- package/dist/schema/retriever.d.ts +2 -1
- package/dist/schema/retriever.js +1 -1
- package/dist/schema/runnable/config.cjs +8 -0
- package/dist/schema/runnable/config.d.ts +3 -0
- package/dist/schema/runnable/config.js +4 -0
- package/dist/schema/{runnable.cjs → runnable/index.cjs} +290 -101
- package/dist/schema/{runnable.d.ts → runnable/index.d.ts} +127 -41
- package/dist/schema/{runnable.js → runnable/index.js} +284 -99
- package/dist/tools/base.d.ts +1 -1
- package/dist/types/googlevertexai-types.d.ts +11 -4
- package/dist/util/async_caller.cjs +35 -25
- package/dist/util/async_caller.d.ts +8 -0
- package/dist/util/async_caller.js +35 -25
- package/dist/util/googlevertexai-connection.cjs +14 -15
- package/dist/util/googlevertexai-connection.d.ts +7 -7
- package/dist/util/googlevertexai-connection.js +14 -15
- package/dist/util/googlevertexai-webauth.cjs +56 -0
- package/dist/util/googlevertexai-webauth.d.ts +25 -0
- package/dist/util/googlevertexai-webauth.js +52 -0
- package/dist/vectorstores/googlevertexai.cjs +9 -8
- package/dist/vectorstores/googlevertexai.d.ts +8 -7
- package/dist/vectorstores/googlevertexai.js +9 -8
- package/dist/vectorstores/pinecone.cjs +30 -22
- package/dist/vectorstores/pinecone.d.ts +3 -1
- package/dist/vectorstores/pinecone.js +30 -22
- package/dist/vectorstores/vectara.cjs +20 -23
- package/dist/vectorstores/vectara.d.ts +9 -2
- package/dist/vectorstores/vectara.js +20 -23
- package/experimental/llms/bittensor.cjs +1 -0
- package/experimental/llms/bittensor.d.ts +1 -0
- package/experimental/llms/bittensor.js +1 -0
- package/llms/googlevertexai/web.cjs +1 -0
- package/llms/googlevertexai/web.d.ts +1 -0
- package/llms/googlevertexai/web.js +1 -0
- package/llms/googlevertexai.cjs +1 -1
- package/llms/googlevertexai.d.ts +1 -1
- package/llms/googlevertexai.js +1 -1
- package/package.json +40 -3
- package/retrievers/multi_query.cjs +1 -0
- package/retrievers/multi_query.d.ts +1 -0
- package/retrievers/multi_query.js +1 -0
- package/schema/runnable.cjs +1 -1
- package/schema/runnable.d.ts +1 -1
- package/schema/runnable.js +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LLMChain } from "../chains/llm_chain.js";
|
|
2
|
+
import { Document } from "../document.js";
|
|
3
|
+
import { BaseRetriever, BaseRetrieverInput } from "../schema/retriever.js";
|
|
4
|
+
import { CallbackManagerForRetrieverRun } from "../callbacks/index.js";
|
|
5
|
+
import { BaseLanguageModel } from "../base_language/index.js";
|
|
6
|
+
import { BasePromptTemplate } from "../prompts/base.js";
|
|
7
|
+
interface LineList {
|
|
8
|
+
lines: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface MultiQueryRetrieverInput extends BaseRetrieverInput {
|
|
11
|
+
retriever: BaseRetriever;
|
|
12
|
+
llmChain: LLMChain<LineList>;
|
|
13
|
+
queryCount?: number;
|
|
14
|
+
parserKey?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class MultiQueryRetriever extends BaseRetriever {
|
|
17
|
+
static lc_name(): string;
|
|
18
|
+
lc_namespace: string[];
|
|
19
|
+
private retriever;
|
|
20
|
+
private llmChain;
|
|
21
|
+
private queryCount;
|
|
22
|
+
private parserKey;
|
|
23
|
+
constructor(fields: MultiQueryRetrieverInput);
|
|
24
|
+
static fromLLM(fields: Omit<MultiQueryRetrieverInput, "llmChain"> & {
|
|
25
|
+
llm: BaseLanguageModel;
|
|
26
|
+
prompt?: BasePromptTemplate;
|
|
27
|
+
}): MultiQueryRetriever;
|
|
28
|
+
private _generateQueries;
|
|
29
|
+
private _retrieveDocuments;
|
|
30
|
+
private _uniqueUnion;
|
|
31
|
+
_getRelevantDocuments(question: string, runManager?: CallbackManagerForRetrieverRun): Promise<Document[]>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { LLMChain } from "../chains/llm_chain.js";
|
|
2
|
+
import { PromptTemplate } from "../prompts/prompt.js";
|
|
3
|
+
import { BaseOutputParser } from "../schema/output_parser.js";
|
|
4
|
+
import { BaseRetriever } from "../schema/retriever.js";
|
|
5
|
+
class LineListOutputParser extends BaseOutputParser {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
Object.defineProperty(this, "lc_namespace", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
configurable: true,
|
|
11
|
+
writable: true,
|
|
12
|
+
value: ["langchain", "retrievers", "multiquery"]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
static lc_name() {
|
|
16
|
+
return "LineListOutputParser";
|
|
17
|
+
}
|
|
18
|
+
async parse(text) {
|
|
19
|
+
const startKeyIndex = text.indexOf("<questions>");
|
|
20
|
+
const endKeyIndex = text.indexOf("</questions>");
|
|
21
|
+
const questionsStartIndex = startKeyIndex === -1 ? 0 : startKeyIndex + "<questions>".length;
|
|
22
|
+
const questionsEndIndex = endKeyIndex === -1 ? text.length : endKeyIndex;
|
|
23
|
+
const lines = text
|
|
24
|
+
.slice(questionsStartIndex, questionsEndIndex)
|
|
25
|
+
.trim()
|
|
26
|
+
.split("\n")
|
|
27
|
+
.filter((line) => line.trim() !== "");
|
|
28
|
+
return { lines };
|
|
29
|
+
}
|
|
30
|
+
getFormatInstructions() {
|
|
31
|
+
throw new Error("Not implemented.");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Create template
|
|
35
|
+
const DEFAULT_QUERY_PROMPT = /* #__PURE__ */ new PromptTemplate({
|
|
36
|
+
inputVariables: ["question", "queryCount"],
|
|
37
|
+
template: `You are an AI language model assistant. Your task is
|
|
38
|
+
to generate {queryCount} different versions of the given user
|
|
39
|
+
question to retrieve relevant documents from a vector database.
|
|
40
|
+
By generating multiple perspectives on the user question,
|
|
41
|
+
your goal is to help the user overcome some of the limitations
|
|
42
|
+
of distance-based similarity search.
|
|
43
|
+
|
|
44
|
+
Provide these alternative questions separated by newlines between XML tags. For example:
|
|
45
|
+
|
|
46
|
+
<questions>
|
|
47
|
+
Question 1
|
|
48
|
+
Question 2
|
|
49
|
+
Question 3
|
|
50
|
+
</questions>
|
|
51
|
+
|
|
52
|
+
Original question: {question}`,
|
|
53
|
+
});
|
|
54
|
+
// Export class
|
|
55
|
+
export class MultiQueryRetriever extends BaseRetriever {
|
|
56
|
+
static lc_name() {
|
|
57
|
+
return "MultiQueryRetriever";
|
|
58
|
+
}
|
|
59
|
+
constructor(fields) {
|
|
60
|
+
super(fields);
|
|
61
|
+
Object.defineProperty(this, "lc_namespace", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: ["langchain", "retrievers", "multiquery"]
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(this, "retriever", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: void 0
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(this, "llmChain", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: void 0
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(this, "queryCount", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: 3
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(this, "parserKey", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
configurable: true,
|
|
88
|
+
writable: true,
|
|
89
|
+
value: "lines"
|
|
90
|
+
});
|
|
91
|
+
this.retriever = fields.retriever;
|
|
92
|
+
this.llmChain = fields.llmChain;
|
|
93
|
+
this.queryCount = fields.queryCount ?? this.queryCount;
|
|
94
|
+
this.parserKey = fields.parserKey ?? this.parserKey;
|
|
95
|
+
}
|
|
96
|
+
static fromLLM(fields) {
|
|
97
|
+
const { retriever, llm, prompt = DEFAULT_QUERY_PROMPT, queryCount, parserKey, ...rest } = fields;
|
|
98
|
+
const outputParser = new LineListOutputParser();
|
|
99
|
+
const llmChain = new LLMChain({ llm, prompt, outputParser });
|
|
100
|
+
return new this({ retriever, llmChain, queryCount, parserKey, ...rest });
|
|
101
|
+
}
|
|
102
|
+
// Generate the different queries for each retrieval, using our llmChain
|
|
103
|
+
async _generateQueries(question, runManager) {
|
|
104
|
+
const response = await this.llmChain.call({ question, queryCount: this.queryCount }, runManager?.getChild());
|
|
105
|
+
const lines = response.text[this.parserKey] || [];
|
|
106
|
+
if (this.verbose) {
|
|
107
|
+
console.log(`Generated queries: ${lines}`);
|
|
108
|
+
}
|
|
109
|
+
return lines;
|
|
110
|
+
}
|
|
111
|
+
// Retrieve documents using the original retriever
|
|
112
|
+
async _retrieveDocuments(queries, runManager) {
|
|
113
|
+
const documents = [];
|
|
114
|
+
for (const query of queries) {
|
|
115
|
+
const docs = await this.retriever.getRelevantDocuments(query, runManager?.getChild());
|
|
116
|
+
documents.push(...docs);
|
|
117
|
+
}
|
|
118
|
+
return documents;
|
|
119
|
+
}
|
|
120
|
+
// Deduplicate the documents that were returned in multiple retrievals
|
|
121
|
+
_uniqueUnion(documents) {
|
|
122
|
+
const uniqueDocumentsDict = {};
|
|
123
|
+
for (const doc of documents) {
|
|
124
|
+
const key = `${doc.pageContent}:${JSON.stringify(Object.entries(doc.metadata).sort())}`;
|
|
125
|
+
uniqueDocumentsDict[key] = doc;
|
|
126
|
+
}
|
|
127
|
+
const uniqueDocuments = Object.values(uniqueDocumentsDict);
|
|
128
|
+
return uniqueDocuments;
|
|
129
|
+
}
|
|
130
|
+
async _getRelevantDocuments(question, runManager) {
|
|
131
|
+
const queries = await this._generateQueries(question, runManager);
|
|
132
|
+
const documents = await this._retrieveDocuments(queries, runManager);
|
|
133
|
+
const uniqueDocuments = this._uniqueUnion(documents);
|
|
134
|
+
return uniqueDocuments;
|
|
135
|
+
}
|
|
136
|
+
}
|
package/dist/schema/document.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MappingDocumentTransformer = exports.BaseDocumentTransformer = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_js_1 = require("./runnable/index.cjs");
|
|
5
5
|
/**
|
|
6
6
|
* Abstract base class for document transformation systems.
|
|
7
7
|
*
|
|
@@ -12,7 +12,7 @@ const runnable_js_1 = require("./runnable.cjs");
|
|
|
12
12
|
* One example of this is a text splitter that splits a large document into
|
|
13
13
|
* many smaller documents.
|
|
14
14
|
*/
|
|
15
|
-
class BaseDocumentTransformer extends
|
|
15
|
+
class BaseDocumentTransformer extends index_js_1.Runnable {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
Object.defineProperty(this, "lc_namespace", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCallbackConfig } from "../callbacks/manager.js";
|
|
2
2
|
import { Document } from "../document.js";
|
|
3
|
-
import { Runnable } from "./runnable.js";
|
|
3
|
+
import { Runnable } from "./runnable/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Abstract base class for document transformation systems.
|
|
6
6
|
*
|
package/dist/schema/document.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OutputParserException = exports.BytesOutputParser = exports.StringOutputParser = exports.BaseTransformOutputParser = exports.BaseOutputParser = exports.BaseLLMOutputParser = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_js_1 = require("./runnable/index.cjs");
|
|
5
5
|
/**
|
|
6
6
|
* Abstract base class for parsing the output of a Large Language Model
|
|
7
7
|
* (LLM) call. It provides methods for parsing the result of an LLM call
|
|
8
8
|
* and invoking the parser with a given input.
|
|
9
9
|
*/
|
|
10
|
-
class BaseLLMOutputParser extends
|
|
10
|
+
class BaseLLMOutputParser extends index_js_1.Runnable {
|
|
11
11
|
/**
|
|
12
12
|
* Parses the result of an LLM call with a given prompt. By default, it
|
|
13
13
|
* simply calls `parseResult`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseCallbackConfig, Callbacks } from "../callbacks/manager.js";
|
|
2
2
|
import { BasePromptValue, Generation, ChatGeneration, BaseMessage } from "./index.js";
|
|
3
|
-
import { Runnable
|
|
3
|
+
import { Runnable } from "./runnable/index.js";
|
|
4
|
+
import { RunnableConfig } from "./runnable/config.js";
|
|
4
5
|
/**
|
|
5
6
|
* Options for formatting instructions.
|
|
6
7
|
*/
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseRetriever = void 0;
|
|
4
4
|
const manager_js_1 = require("../callbacks/manager.cjs");
|
|
5
|
-
const
|
|
5
|
+
const index_js_1 = require("./runnable/index.cjs");
|
|
6
6
|
/**
|
|
7
7
|
* Abstract base class for a Document retrieval system. A retrieval system
|
|
8
8
|
* is defined as something that can take string queries and return the
|
|
9
9
|
* most 'relevant' Documents from some source.
|
|
10
10
|
*/
|
|
11
|
-
class BaseRetriever extends
|
|
11
|
+
class BaseRetriever extends index_js_1.Runnable {
|
|
12
12
|
constructor(fields) {
|
|
13
13
|
super(fields);
|
|
14
14
|
Object.defineProperty(this, "callbacks", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseCallbackConfig, CallbackManagerForRetrieverRun, Callbacks } from "../callbacks/manager.js";
|
|
2
2
|
import { Document } from "../document.js";
|
|
3
|
-
import { Runnable
|
|
3
|
+
import { Runnable } from "./runnable/index.js";
|
|
4
|
+
import { RunnableConfig } from "./runnable/config.js";
|
|
4
5
|
/**
|
|
5
6
|
* Base Retriever class. All indexes should extend this class.
|
|
6
7
|
*/
|
package/dist/schema/retriever.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CallbackManager, parseCallbackConfigArg, } from "../callbacks/manager.js";
|
|
2
|
-
import { Runnable } from "./runnable.js";
|
|
2
|
+
import { Runnable } from "./runnable/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class for a Document retrieval system. A retrieval system
|
|
5
5
|
* is defined as something that can take string queries and return the
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCallbackMangerForConfig = void 0;
|
|
4
|
+
const manager_js_1 = require("../../callbacks/manager.cjs");
|
|
5
|
+
async function getCallbackMangerForConfig(config) {
|
|
6
|
+
return manager_js_1.CallbackManager.configure(config?.callbacks, undefined, config?.tags, undefined, config?.metadata);
|
|
7
|
+
}
|
|
8
|
+
exports.getCallbackMangerForConfig = getCallbackMangerForConfig;
|