langchain 0.0.149 → 0.0.151
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/dist/experimental/chat_models/bittensor.cjs +141 -0
- package/dist/experimental/chat_models/bittensor.d.ts +36 -0
- package/dist/experimental/chat_models/bittensor.js +137 -0
- package/dist/llms/openai.cjs +3 -2
- package/dist/llms/openai.js +3 -2
- package/dist/llms/replicate.cjs +28 -2
- package/dist/llms/replicate.d.ts +3 -0
- package/dist/llms/replicate.js +28 -2
- package/dist/load/import_constants.cjs +1 -0
- package/dist/load/import_constants.js +1 -0
- package/dist/load/import_map.cjs +2 -1
- package/dist/load/import_map.d.ts +1 -0
- package/dist/load/import_map.js +1 -0
- package/dist/prompts/prompt.cjs +2 -0
- package/dist/prompts/prompt.d.ts +1 -1
- package/dist/prompts/prompt.js +2 -0
- package/dist/schema/runnable/base.cjs +11 -2
- package/dist/schema/runnable/base.d.ts +3 -1
- package/dist/schema/runnable/base.js +10 -2
- package/dist/schema/runnable/branch.cjs +106 -0
- package/dist/schema/runnable/branch.d.ts +66 -0
- package/dist/schema/runnable/branch.js +102 -0
- package/dist/schema/runnable/index.cjs +12 -16
- package/dist/schema/runnable/index.d.ts +2 -1
- package/dist/schema/runnable/index.js +2 -1
- package/dist/vectorstores/pgvector.cjs +277 -0
- package/dist/vectorstores/pgvector.d.ts +132 -0
- package/dist/vectorstores/pgvector.js +270 -0
- package/experimental/chat_models/bittensor.cjs +1 -0
- package/experimental/chat_models/bittensor.d.ts +1 -0
- package/experimental/chat_models/bittensor.js +1 -0
- package/package.json +19 -3
- package/vectorstores/pgvector.cjs +1 -0
- package/vectorstores/pgvector.d.ts +1 -0
- package/vectorstores/pgvector.js +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type Pool, type PoolClient, type PoolConfig } from "pg";
|
|
2
|
+
import { VectorStore } from "./base.js";
|
|
3
|
+
import { Embeddings } from "../embeddings/base.js";
|
|
4
|
+
import { Document } from "../document.js";
|
|
5
|
+
type Metadata = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Interface that defines the arguments required to create a
|
|
8
|
+
* `PGVectorStore` instance. It includes Postgres connection options,
|
|
9
|
+
* table name, filter, and verbosity level.
|
|
10
|
+
*/
|
|
11
|
+
export interface PGVectorStoreArgs {
|
|
12
|
+
postgresConnectionOptions: PoolConfig;
|
|
13
|
+
tableName: string;
|
|
14
|
+
columns?: {
|
|
15
|
+
idColumnName?: string;
|
|
16
|
+
vectorColumnName?: string;
|
|
17
|
+
contentColumnName?: string;
|
|
18
|
+
metadataColumnName?: string;
|
|
19
|
+
};
|
|
20
|
+
filter?: Metadata;
|
|
21
|
+
verbose?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Class that provides an interface to a Postgres vector database. It
|
|
25
|
+
* extends the `VectorStore` base class and implements methods for adding
|
|
26
|
+
* documents and vectors, performing similarity searches, and ensuring the
|
|
27
|
+
* existence of a table in the database.
|
|
28
|
+
*/
|
|
29
|
+
export declare class PGVectorStore extends VectorStore {
|
|
30
|
+
FilterType: Metadata;
|
|
31
|
+
tableName: string;
|
|
32
|
+
idColumnName: string;
|
|
33
|
+
vectorColumnName: string;
|
|
34
|
+
contentColumnName: string;
|
|
35
|
+
metadataColumnName: string;
|
|
36
|
+
filter?: Metadata;
|
|
37
|
+
_verbose?: boolean;
|
|
38
|
+
pool: Pool;
|
|
39
|
+
client?: PoolClient;
|
|
40
|
+
_vectorstoreType(): string;
|
|
41
|
+
private constructor();
|
|
42
|
+
/**
|
|
43
|
+
* Static method to create a new `PGVectorStore` instance from a
|
|
44
|
+
* connection. It creates a table if one does not exist, and calls
|
|
45
|
+
* `connect` to return a new instance of `PGVectorStore`.
|
|
46
|
+
*
|
|
47
|
+
* @param embeddings - Embeddings instance.
|
|
48
|
+
* @param fields - `PGVectorStoreArgs` instance.
|
|
49
|
+
* @returns A new instance of `PGVectorStore`.
|
|
50
|
+
*/
|
|
51
|
+
static initialize(embeddings: Embeddings, config: PGVectorStoreArgs): Promise<PGVectorStore>;
|
|
52
|
+
protected _initializeClient(): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Method to add documents to the vector store. It converts the documents into
|
|
55
|
+
* vectors, and adds them to the store.
|
|
56
|
+
*
|
|
57
|
+
* @param documents - Array of `Document` instances.
|
|
58
|
+
* @returns Promise that resolves when the documents have been added.
|
|
59
|
+
*/
|
|
60
|
+
addDocuments(documents: Document[]): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Generates the SQL placeholders for a specific row at the provided index.
|
|
63
|
+
*
|
|
64
|
+
* @param index - The index of the row for which placeholders need to be generated.
|
|
65
|
+
* @returns The SQL placeholders for the row values.
|
|
66
|
+
*/
|
|
67
|
+
private generatePlaceholderForRowAt;
|
|
68
|
+
/**
|
|
69
|
+
* Constructs the SQL query for inserting rows into the specified table.
|
|
70
|
+
*
|
|
71
|
+
* @param rows - The rows of data to be inserted, consisting of values and records.
|
|
72
|
+
* @param chunkIndex - The starting index for generating query placeholders based on chunk positioning.
|
|
73
|
+
* @returns The complete SQL INSERT INTO query string.
|
|
74
|
+
*/
|
|
75
|
+
private buildInsertQuery;
|
|
76
|
+
/**
|
|
77
|
+
* Method to add vectors to the vector store. It converts the vectors into
|
|
78
|
+
* rows and inserts them into the database.
|
|
79
|
+
*
|
|
80
|
+
* @param vectors - Array of vectors.
|
|
81
|
+
* @param documents - Array of `Document` instances.
|
|
82
|
+
* @returns Promise that resolves when the vectors have been added.
|
|
83
|
+
*/
|
|
84
|
+
addVectors(vectors: number[][], documents: Document[]): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Method to perform a similarity search in the vector store. It returns
|
|
87
|
+
* the `k` most similar documents to the query vector, along with their
|
|
88
|
+
* similarity scores.
|
|
89
|
+
*
|
|
90
|
+
* @param query - Query vector.
|
|
91
|
+
* @param k - Number of most similar documents to return.
|
|
92
|
+
* @param filter - Optional filter to apply to the search.
|
|
93
|
+
* @returns Promise that resolves with an array of tuples, each containing a `Document` and its similarity score.
|
|
94
|
+
*/
|
|
95
|
+
similaritySearchVectorWithScore(query: number[], k: number, filter?: this["FilterType"]): Promise<[Document, number][]>;
|
|
96
|
+
/**
|
|
97
|
+
* Method to ensure the existence of the table in the database. It creates
|
|
98
|
+
* the table if it does not already exist.
|
|
99
|
+
*
|
|
100
|
+
* @returns Promise that resolves when the table has been ensured.
|
|
101
|
+
*/
|
|
102
|
+
ensureTableInDatabase(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Static method to create a new `PGVectorStore` instance from an
|
|
105
|
+
* array of texts and their metadata. It converts the texts into
|
|
106
|
+
* `Document` instances and adds them to the store.
|
|
107
|
+
*
|
|
108
|
+
* @param texts - Array of texts.
|
|
109
|
+
* @param metadatas - Array of metadata objects or a single metadata object.
|
|
110
|
+
* @param embeddings - Embeddings instance.
|
|
111
|
+
* @param dbConfig - `PGVectorStoreArgs` instance.
|
|
112
|
+
* @returns Promise that resolves with a new instance of `PGVectorStore`.
|
|
113
|
+
*/
|
|
114
|
+
static fromTexts(texts: string[], metadatas: object[] | object, embeddings: Embeddings, dbConfig: PGVectorStoreArgs): Promise<PGVectorStore>;
|
|
115
|
+
/**
|
|
116
|
+
* Static method to create a new `PGVectorStore` instance from an
|
|
117
|
+
* array of `Document` instances. It adds the documents to the store.
|
|
118
|
+
*
|
|
119
|
+
* @param docs - Array of `Document` instances.
|
|
120
|
+
* @param embeddings - Embeddings instance.
|
|
121
|
+
* @param dbConfig - `PGVectorStoreArgs` instance.
|
|
122
|
+
* @returns Promise that resolves with a new instance of `PGVectorStore`.
|
|
123
|
+
*/
|
|
124
|
+
static fromDocuments(docs: Document[], embeddings: Embeddings, dbConfig: PGVectorStoreArgs): Promise<PGVectorStore>;
|
|
125
|
+
/**
|
|
126
|
+
* Closes all the clients in the pool and terminates the pool.
|
|
127
|
+
*
|
|
128
|
+
* @returns Promise that resolves when all clients are closed and the pool is terminated.
|
|
129
|
+
*/
|
|
130
|
+
end(): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
export {};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import pg from "pg";
|
|
2
|
+
import { VectorStore } from "./base.js";
|
|
3
|
+
import { Document } from "../document.js";
|
|
4
|
+
import { getEnvironmentVariable } from "../util/env.js";
|
|
5
|
+
/**
|
|
6
|
+
* Class that provides an interface to a Postgres vector database. It
|
|
7
|
+
* extends the `VectorStore` base class and implements methods for adding
|
|
8
|
+
* documents and vectors, performing similarity searches, and ensuring the
|
|
9
|
+
* existence of a table in the database.
|
|
10
|
+
*/
|
|
11
|
+
export class PGVectorStore extends VectorStore {
|
|
12
|
+
_vectorstoreType() {
|
|
13
|
+
return "pgvector";
|
|
14
|
+
}
|
|
15
|
+
constructor(embeddings, config) {
|
|
16
|
+
super(embeddings, config);
|
|
17
|
+
Object.defineProperty(this, "tableName", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "idColumnName", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "vectorColumnName", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: void 0
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(this, "contentColumnName", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: void 0
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(this, "metadataColumnName", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: void 0
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(this, "filter", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: void 0
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "_verbose", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: void 0
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(this, "pool", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: void 0
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(this, "client", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: void 0
|
|
70
|
+
});
|
|
71
|
+
this.tableName = config.tableName;
|
|
72
|
+
this.filter = config.filter;
|
|
73
|
+
this.vectorColumnName = config.columns?.vectorColumnName ?? "embedding";
|
|
74
|
+
this.contentColumnName = config.columns?.contentColumnName ?? "text";
|
|
75
|
+
this.idColumnName = config.columns?.idColumnName ?? "id";
|
|
76
|
+
this.metadataColumnName = config.columns?.metadataColumnName ?? "metadata";
|
|
77
|
+
const pool = new pg.Pool(config.postgresConnectionOptions);
|
|
78
|
+
this.pool = pool;
|
|
79
|
+
this._verbose =
|
|
80
|
+
getEnvironmentVariable("LANGCHAIN_VERBOSE") === "true" ??
|
|
81
|
+
!!config.verbose;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Static method to create a new `PGVectorStore` instance from a
|
|
85
|
+
* connection. It creates a table if one does not exist, and calls
|
|
86
|
+
* `connect` to return a new instance of `PGVectorStore`.
|
|
87
|
+
*
|
|
88
|
+
* @param embeddings - Embeddings instance.
|
|
89
|
+
* @param fields - `PGVectorStoreArgs` instance.
|
|
90
|
+
* @returns A new instance of `PGVectorStore`.
|
|
91
|
+
*/
|
|
92
|
+
static async initialize(embeddings, config) {
|
|
93
|
+
const postgresqlVectorStore = new PGVectorStore(embeddings, config);
|
|
94
|
+
await postgresqlVectorStore._initializeClient();
|
|
95
|
+
await postgresqlVectorStore.ensureTableInDatabase();
|
|
96
|
+
return postgresqlVectorStore;
|
|
97
|
+
}
|
|
98
|
+
async _initializeClient() {
|
|
99
|
+
this.client = await this.pool.connect();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Method to add documents to the vector store. It converts the documents into
|
|
103
|
+
* vectors, and adds them to the store.
|
|
104
|
+
*
|
|
105
|
+
* @param documents - Array of `Document` instances.
|
|
106
|
+
* @returns Promise that resolves when the documents have been added.
|
|
107
|
+
*/
|
|
108
|
+
async addDocuments(documents) {
|
|
109
|
+
const texts = documents.map(({ pageContent }) => pageContent);
|
|
110
|
+
return this.addVectors(await this.embeddings.embedDocuments(texts), documents);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Generates the SQL placeholders for a specific row at the provided index.
|
|
114
|
+
*
|
|
115
|
+
* @param index - The index of the row for which placeholders need to be generated.
|
|
116
|
+
* @returns The SQL placeholders for the row values.
|
|
117
|
+
*/
|
|
118
|
+
generatePlaceholderForRowAt(index) {
|
|
119
|
+
const base = index * 3;
|
|
120
|
+
return `($${base + 1}, $${base + 2}, $${base + 3})`;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Constructs the SQL query for inserting rows into the specified table.
|
|
124
|
+
*
|
|
125
|
+
* @param rows - The rows of data to be inserted, consisting of values and records.
|
|
126
|
+
* @param chunkIndex - The starting index for generating query placeholders based on chunk positioning.
|
|
127
|
+
* @returns The complete SQL INSERT INTO query string.
|
|
128
|
+
*/
|
|
129
|
+
buildInsertQuery(rows, chunkIndex) {
|
|
130
|
+
const valuesPlaceholders = rows
|
|
131
|
+
.map((_, j) => this.generatePlaceholderForRowAt(chunkIndex + j))
|
|
132
|
+
.join(", ");
|
|
133
|
+
const text = `
|
|
134
|
+
INSERT INTO ${this.tableName}(
|
|
135
|
+
${this.contentColumnName},
|
|
136
|
+
${this.vectorColumnName},
|
|
137
|
+
${this.metadataColumnName}
|
|
138
|
+
)
|
|
139
|
+
VALUES ${valuesPlaceholders}
|
|
140
|
+
`;
|
|
141
|
+
return text;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Method to add vectors to the vector store. It converts the vectors into
|
|
145
|
+
* rows and inserts them into the database.
|
|
146
|
+
*
|
|
147
|
+
* @param vectors - Array of vectors.
|
|
148
|
+
* @param documents - Array of `Document` instances.
|
|
149
|
+
* @returns Promise that resolves when the vectors have been added.
|
|
150
|
+
*/
|
|
151
|
+
async addVectors(vectors, documents) {
|
|
152
|
+
const rows = vectors.map((embedding, idx) => {
|
|
153
|
+
const embeddingString = `[${embedding.join(",")}]`;
|
|
154
|
+
return [
|
|
155
|
+
documents[idx].pageContent,
|
|
156
|
+
embeddingString,
|
|
157
|
+
documents[idx].metadata,
|
|
158
|
+
];
|
|
159
|
+
});
|
|
160
|
+
const chunkSize = 500;
|
|
161
|
+
for (let i = 0; i < rows.length; i += chunkSize) {
|
|
162
|
+
const chunk = rows.slice(i, i + chunkSize);
|
|
163
|
+
const insertQuery = this.buildInsertQuery(chunk, i);
|
|
164
|
+
const flatValues = chunk.flat();
|
|
165
|
+
try {
|
|
166
|
+
await this.pool.query(insertQuery, flatValues);
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
console.error(e);
|
|
170
|
+
throw new Error(`Error inserting: ${chunk[1]}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Method to perform a similarity search in the vector store. It returns
|
|
176
|
+
* the `k` most similar documents to the query vector, along with their
|
|
177
|
+
* similarity scores.
|
|
178
|
+
*
|
|
179
|
+
* @param query - Query vector.
|
|
180
|
+
* @param k - Number of most similar documents to return.
|
|
181
|
+
* @param filter - Optional filter to apply to the search.
|
|
182
|
+
* @returns Promise that resolves with an array of tuples, each containing a `Document` and its similarity score.
|
|
183
|
+
*/
|
|
184
|
+
async similaritySearchVectorWithScore(query, k, filter) {
|
|
185
|
+
const embeddingString = `[${query.join(",")}]`;
|
|
186
|
+
const _filter = filter ?? "{}";
|
|
187
|
+
const queryString = `
|
|
188
|
+
SELECT *, ${this.vectorColumnName} <=> $1 as "_distance"
|
|
189
|
+
FROM ${this.tableName}
|
|
190
|
+
WHERE ${this.metadataColumnName} @> $2
|
|
191
|
+
ORDER BY "_distance" ASC
|
|
192
|
+
LIMIT $3;`;
|
|
193
|
+
const documents = (await this.pool.query(queryString, [embeddingString, _filter, k])).rows;
|
|
194
|
+
const results = [];
|
|
195
|
+
for (const doc of documents) {
|
|
196
|
+
if (doc._distance != null && doc[this.contentColumnName] != null) {
|
|
197
|
+
const document = new Document({
|
|
198
|
+
pageContent: doc[this.contentColumnName],
|
|
199
|
+
metadata: doc[this.metadataColumnName],
|
|
200
|
+
});
|
|
201
|
+
results.push([document, doc._distance]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return results;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Method to ensure the existence of the table in the database. It creates
|
|
208
|
+
* the table if it does not already exist.
|
|
209
|
+
*
|
|
210
|
+
* @returns Promise that resolves when the table has been ensured.
|
|
211
|
+
*/
|
|
212
|
+
async ensureTableInDatabase() {
|
|
213
|
+
await this.pool.query("CREATE EXTENSION IF NOT EXISTS vector;");
|
|
214
|
+
await this.pool.query('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";');
|
|
215
|
+
await this.pool.query(`
|
|
216
|
+
CREATE TABLE IF NOT EXISTS ${this.tableName} (
|
|
217
|
+
"${this.idColumnName}" uuid NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY,
|
|
218
|
+
"${this.contentColumnName}" text,
|
|
219
|
+
"${this.metadataColumnName}" jsonb,
|
|
220
|
+
"${this.vectorColumnName}" vector
|
|
221
|
+
);
|
|
222
|
+
`);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Static method to create a new `PGVectorStore` instance from an
|
|
226
|
+
* array of texts and their metadata. It converts the texts into
|
|
227
|
+
* `Document` instances and adds them to the store.
|
|
228
|
+
*
|
|
229
|
+
* @param texts - Array of texts.
|
|
230
|
+
* @param metadatas - Array of metadata objects or a single metadata object.
|
|
231
|
+
* @param embeddings - Embeddings instance.
|
|
232
|
+
* @param dbConfig - `PGVectorStoreArgs` instance.
|
|
233
|
+
* @returns Promise that resolves with a new instance of `PGVectorStore`.
|
|
234
|
+
*/
|
|
235
|
+
static async fromTexts(texts, metadatas, embeddings, dbConfig) {
|
|
236
|
+
const docs = [];
|
|
237
|
+
for (let i = 0; i < texts.length; i += 1) {
|
|
238
|
+
const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
|
|
239
|
+
const newDoc = new Document({
|
|
240
|
+
pageContent: texts[i],
|
|
241
|
+
metadata,
|
|
242
|
+
});
|
|
243
|
+
docs.push(newDoc);
|
|
244
|
+
}
|
|
245
|
+
return PGVectorStore.fromDocuments(docs, embeddings, dbConfig);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Static method to create a new `PGVectorStore` instance from an
|
|
249
|
+
* array of `Document` instances. It adds the documents to the store.
|
|
250
|
+
*
|
|
251
|
+
* @param docs - Array of `Document` instances.
|
|
252
|
+
* @param embeddings - Embeddings instance.
|
|
253
|
+
* @param dbConfig - `PGVectorStoreArgs` instance.
|
|
254
|
+
* @returns Promise that resolves with a new instance of `PGVectorStore`.
|
|
255
|
+
*/
|
|
256
|
+
static async fromDocuments(docs, embeddings, dbConfig) {
|
|
257
|
+
const instance = await PGVectorStore.initialize(embeddings, dbConfig);
|
|
258
|
+
await instance.addDocuments(docs);
|
|
259
|
+
return instance;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Closes all the clients in the pool and terminates the pool.
|
|
263
|
+
*
|
|
264
|
+
* @returns Promise that resolves when all clients are closed and the pool is terminated.
|
|
265
|
+
*/
|
|
266
|
+
async end() {
|
|
267
|
+
await this.client?.release();
|
|
268
|
+
return this.pool.end();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/experimental/chat_models/bittensor.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/experimental/chat_models/bittensor.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/experimental/chat_models/bittensor.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.151",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -211,6 +211,9 @@
|
|
|
211
211
|
"vectorstores/opensearch.cjs",
|
|
212
212
|
"vectorstores/opensearch.js",
|
|
213
213
|
"vectorstores/opensearch.d.ts",
|
|
214
|
+
"vectorstores/pgvector.cjs",
|
|
215
|
+
"vectorstores/pgvector.js",
|
|
216
|
+
"vectorstores/pgvector.d.ts",
|
|
214
217
|
"vectorstores/milvus.cjs",
|
|
215
218
|
"vectorstores/milvus.js",
|
|
216
219
|
"vectorstores/milvus.d.ts",
|
|
@@ -592,6 +595,9 @@
|
|
|
592
595
|
"experimental/chat_models/anthropic_functions.cjs",
|
|
593
596
|
"experimental/chat_models/anthropic_functions.js",
|
|
594
597
|
"experimental/chat_models/anthropic_functions.d.ts",
|
|
598
|
+
"experimental/chat_models/bittensor.cjs",
|
|
599
|
+
"experimental/chat_models/bittensor.js",
|
|
600
|
+
"experimental/chat_models/bittensor.d.ts",
|
|
595
601
|
"experimental/llms/bittensor.cjs",
|
|
596
602
|
"experimental/llms/bittensor.js",
|
|
597
603
|
"experimental/llms/bittensor.d.ts",
|
|
@@ -728,7 +734,7 @@
|
|
|
728
734
|
"puppeteer": "^19.7.2",
|
|
729
735
|
"redis": "^4.6.6",
|
|
730
736
|
"release-it": "^15.10.1",
|
|
731
|
-
"replicate": "^0.
|
|
737
|
+
"replicate": "^0.18.0",
|
|
732
738
|
"rimraf": "^5.0.1",
|
|
733
739
|
"rollup": "^3.19.1",
|
|
734
740
|
"sonix-speech-recognition": "^2.1.1",
|
|
@@ -815,7 +821,7 @@
|
|
|
815
821
|
"playwright": "^1.32.1",
|
|
816
822
|
"puppeteer": "^19.7.2",
|
|
817
823
|
"redis": "^4.6.4",
|
|
818
|
-
"replicate": "^0.
|
|
824
|
+
"replicate": "^0.18.0",
|
|
819
825
|
"sonix-speech-recognition": "^2.1.1",
|
|
820
826
|
"srt-parser-2": "^1.2.2",
|
|
821
827
|
"typeorm": "^0.3.12",
|
|
@@ -1447,6 +1453,11 @@
|
|
|
1447
1453
|
"import": "./vectorstores/opensearch.js",
|
|
1448
1454
|
"require": "./vectorstores/opensearch.cjs"
|
|
1449
1455
|
},
|
|
1456
|
+
"./vectorstores/pgvector": {
|
|
1457
|
+
"types": "./vectorstores/pgvector.d.ts",
|
|
1458
|
+
"import": "./vectorstores/pgvector.js",
|
|
1459
|
+
"require": "./vectorstores/pgvector.cjs"
|
|
1460
|
+
},
|
|
1450
1461
|
"./vectorstores/milvus": {
|
|
1451
1462
|
"types": "./vectorstores/milvus.d.ts",
|
|
1452
1463
|
"import": "./vectorstores/milvus.js",
|
|
@@ -2082,6 +2093,11 @@
|
|
|
2082
2093
|
"import": "./experimental/chat_models/anthropic_functions.js",
|
|
2083
2094
|
"require": "./experimental/chat_models/anthropic_functions.cjs"
|
|
2084
2095
|
},
|
|
2096
|
+
"./experimental/chat_models/bittensor": {
|
|
2097
|
+
"types": "./experimental/chat_models/bittensor.d.ts",
|
|
2098
|
+
"import": "./experimental/chat_models/bittensor.js",
|
|
2099
|
+
"require": "./experimental/chat_models/bittensor.cjs"
|
|
2100
|
+
},
|
|
2085
2101
|
"./experimental/llms/bittensor": {
|
|
2086
2102
|
"types": "./experimental/llms/bittensor.d.ts",
|
|
2087
2103
|
"import": "./experimental/llms/bittensor.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/vectorstores/pgvector.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/vectorstores/pgvector.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/vectorstores/pgvector.js'
|