langchain 0.1.12 → 0.1.14
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/cache/redis.cjs +1 -1
- package/dist/cache/redis.d.ts +1 -1
- package/dist/cache/redis.js +1 -1
- package/dist/document_loaders/web/confluence.cjs +7 -1
- package/dist/document_loaders/web/confluence.d.ts +9 -0
- package/dist/document_loaders/web/confluence.js +7 -1
- package/dist/embeddings/fake.cjs +21 -92
- package/dist/embeddings/fake.d.ts +1 -53
- package/dist/embeddings/fake.js +7 -89
- package/dist/load/import_constants.cjs +1 -0
- package/dist/load/import_constants.js +1 -0
- package/dist/load/import_map.cjs +35 -14
- package/dist/load/import_map.d.ts +22 -1
- package/dist/load/import_map.js +37 -16
- package/dist/runnables/remote.cjs +15 -339
- package/dist/runnables/remote.d.ts +1 -30
- package/dist/runnables/remote.js +1 -337
- package/dist/stores/message/redis.cjs +2 -0
- package/dist/stores/message/redis.js +2 -0
- package/dist/util/migrations/0_0-0_1-migrate-imports.cjs +208 -0
- package/dist/util/migrations/0_0-0_1-migrate-imports.d.ts +44 -0
- package/dist/util/migrations/0_0-0_1-migrate-imports.js +201 -0
- package/dist/vectorstores/redis.cjs +2 -0
- package/dist/vectorstores/redis.js +2 -0
- package/dist/vectorstores/weaviate.cjs +2 -0
- package/dist/vectorstores/weaviate.js +2 -0
- package/package.json +26 -7
- package/util/migrations/0_1.cjs +1 -0
- package/util/migrations/0_1.d.cts +1 -0
- package/util/migrations/0_1.d.ts +1 -0
- package/util/migrations/0_1.js +1 -0
package/dist/cache/redis.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RedisCache = void 0;
|
|
4
4
|
const caches_1 = require("@langchain/core/caches");
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated Import from "@langchain/
|
|
6
|
+
* @deprecated Import from "@langchain/redis" instead.
|
|
7
7
|
* Represents a specific implementation of a caching mechanism using Redis
|
|
8
8
|
* as the underlying storage system. It extends the `BaseCache` class and
|
|
9
9
|
* overrides its methods to provide the Redis-specific logic.
|
package/dist/cache/redis.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Generation } from "@langchain/core/outputs";
|
|
|
7
7
|
*/
|
|
8
8
|
type RedisClientType = ReturnType<typeof createClient> | ReturnType<typeof createCluster>;
|
|
9
9
|
/**
|
|
10
|
-
* @deprecated Import from "@langchain/
|
|
10
|
+
* @deprecated Import from "@langchain/redis" instead.
|
|
11
11
|
* Represents a specific implementation of a caching mechanism using Redis
|
|
12
12
|
* as the underlying storage system. It extends the `BaseCache` class and
|
|
13
13
|
* overrides its methods to provide the Redis-specific logic.
|
package/dist/cache/redis.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCache, deserializeStoredGeneration, getCacheKey, serializeGeneration, } from "@langchain/core/caches";
|
|
2
2
|
/**
|
|
3
|
-
* @deprecated Import from "@langchain/
|
|
3
|
+
* @deprecated Import from "@langchain/redis" instead.
|
|
4
4
|
* Represents a specific implementation of a caching mechanism using Redis
|
|
5
5
|
* as the underlying storage system. It extends the `BaseCache` class and
|
|
6
6
|
* overrides its methods to provide the Redis-specific logic.
|
|
@@ -19,7 +19,7 @@ const base_js_1 = require("../base.cjs");
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
class ConfluencePagesLoader extends base_js_1.BaseDocumentLoader {
|
|
22
|
-
constructor({ baseUrl, spaceKey, username, accessToken, limit = 25, expand = "body.storage", personalAccessToken, }) {
|
|
22
|
+
constructor({ baseUrl, spaceKey, username, accessToken, limit = 25, expand = "body.storage,version", personalAccessToken, }) {
|
|
23
23
|
super();
|
|
24
24
|
Object.defineProperty(this, "baseUrl", {
|
|
25
25
|
enumerable: true,
|
|
@@ -168,8 +168,14 @@ class ConfluencePagesLoader extends base_js_1.BaseDocumentLoader {
|
|
|
168
168
|
return new documents_1.Document({
|
|
169
169
|
pageContent: textWithoutEmptyLines,
|
|
170
170
|
metadata: {
|
|
171
|
+
id: page.id,
|
|
172
|
+
status: page.status,
|
|
171
173
|
title: page.title,
|
|
174
|
+
type: page.type,
|
|
172
175
|
url: pageUrl,
|
|
176
|
+
version: page.version?.number,
|
|
177
|
+
updated_by: page.version?.by?.displayName,
|
|
178
|
+
updated_at: page.version?.when,
|
|
173
179
|
},
|
|
174
180
|
});
|
|
175
181
|
}
|
|
@@ -19,11 +19,20 @@ export interface ConfluencePagesLoaderParams {
|
|
|
19
19
|
export interface ConfluencePage {
|
|
20
20
|
id: string;
|
|
21
21
|
title: string;
|
|
22
|
+
type: string;
|
|
22
23
|
body: {
|
|
23
24
|
storage: {
|
|
24
25
|
value: string;
|
|
25
26
|
};
|
|
26
27
|
};
|
|
28
|
+
status: string;
|
|
29
|
+
version?: {
|
|
30
|
+
number: number;
|
|
31
|
+
when: string;
|
|
32
|
+
by: {
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
27
36
|
}
|
|
28
37
|
/**
|
|
29
38
|
* Interface representing the response from the Confluence API.
|
|
@@ -16,7 +16,7 @@ import { BaseDocumentLoader } from "../base.js";
|
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
export class ConfluencePagesLoader extends BaseDocumentLoader {
|
|
19
|
-
constructor({ baseUrl, spaceKey, username, accessToken, limit = 25, expand = "body.storage", personalAccessToken, }) {
|
|
19
|
+
constructor({ baseUrl, spaceKey, username, accessToken, limit = 25, expand = "body.storage,version", personalAccessToken, }) {
|
|
20
20
|
super();
|
|
21
21
|
Object.defineProperty(this, "baseUrl", {
|
|
22
22
|
enumerable: true,
|
|
@@ -165,8 +165,14 @@ export class ConfluencePagesLoader extends BaseDocumentLoader {
|
|
|
165
165
|
return new Document({
|
|
166
166
|
pageContent: textWithoutEmptyLines,
|
|
167
167
|
metadata: {
|
|
168
|
+
id: page.id,
|
|
169
|
+
status: page.status,
|
|
168
170
|
title: page.title,
|
|
171
|
+
type: page.type,
|
|
169
172
|
url: pageUrl,
|
|
173
|
+
version: page.version?.number,
|
|
174
|
+
updated_by: page.version?.by?.displayName,
|
|
175
|
+
updated_at: page.version?.when,
|
|
170
176
|
},
|
|
171
177
|
});
|
|
172
178
|
}
|
package/dist/embeddings/fake.cjs
CHANGED
|
@@ -1,94 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* and embedQuery methods to return fixed values.
|
|
8
|
-
*/
|
|
9
|
-
class FakeEmbeddings extends embeddings_1.Embeddings {
|
|
10
|
-
constructor(params) {
|
|
11
|
-
super(params ?? {});
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Generates fixed embeddings for a list of documents.
|
|
15
|
-
* @param documents List of documents to generate embeddings for.
|
|
16
|
-
* @returns A promise that resolves with a list of fixed embeddings for each document.
|
|
17
|
-
*/
|
|
18
|
-
embedDocuments(documents) {
|
|
19
|
-
return Promise.resolve(documents.map(() => [0.1, 0.2, 0.3, 0.4]));
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Generates a fixed embedding for a query.
|
|
23
|
-
* @param _ The query to generate an embedding for.
|
|
24
|
-
* @returns A promise that resolves with a fixed embedding for the query.
|
|
25
|
-
*/
|
|
26
|
-
embedQuery(_) {
|
|
27
|
-
return Promise.resolve([0.1, 0.2, 0.3, 0.4]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.FakeEmbeddings = FakeEmbeddings;
|
|
31
|
-
/**
|
|
32
|
-
* A class that provides synthetic embeddings by overriding the
|
|
33
|
-
* embedDocuments and embedQuery methods to generate embeddings based on
|
|
34
|
-
* the input documents. The embeddings are generated by converting each
|
|
35
|
-
* document into chunks, calculating a numerical value for each chunk, and
|
|
36
|
-
* returning an array of these values as the embedding.
|
|
37
|
-
*/
|
|
38
|
-
class SyntheticEmbeddings extends embeddings_1.Embeddings {
|
|
39
|
-
constructor(params) {
|
|
40
|
-
super(params ?? {});
|
|
41
|
-
Object.defineProperty(this, "vectorSize", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
value: void 0
|
|
46
|
-
});
|
|
47
|
-
this.vectorSize = params?.vectorSize ?? 4;
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
48
7
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let doc = document;
|
|
66
|
-
// Only use the letters (and space) from the document, and make them lower case
|
|
67
|
-
doc = doc.toLowerCase().replaceAll(/[^a-z ]/g, "");
|
|
68
|
-
// Pad the document to make sure it has a divisible number of chunks
|
|
69
|
-
const padMod = doc.length % this.vectorSize;
|
|
70
|
-
const padGapSize = padMod === 0 ? 0 : this.vectorSize - padMod;
|
|
71
|
-
const padSize = doc.length + padGapSize;
|
|
72
|
-
doc = doc.padEnd(padSize, " ");
|
|
73
|
-
// Break it into chunks
|
|
74
|
-
const chunkSize = doc.length / this.vectorSize;
|
|
75
|
-
const docChunk = [];
|
|
76
|
-
for (let co = 0; co < doc.length; co += chunkSize) {
|
|
77
|
-
docChunk.push(doc.slice(co, co + chunkSize));
|
|
78
|
-
}
|
|
79
|
-
// Turn each chunk into a number
|
|
80
|
-
const ret = docChunk.map((s) => {
|
|
81
|
-
let sum = 0;
|
|
82
|
-
// Get a total value by adding the value of each character in the string
|
|
83
|
-
for (let co = 0; co < s.length; co += 1) {
|
|
84
|
-
sum += s === " " ? 0 : s.charCodeAt(co);
|
|
85
|
-
}
|
|
86
|
-
// Reduce this to a number between 0 and 25 inclusive
|
|
87
|
-
// Then get the fractional number by dividing it by 26
|
|
88
|
-
const ret = (sum % 26) / 26;
|
|
89
|
-
return ret;
|
|
90
|
-
});
|
|
91
|
-
return ret;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.SyntheticEmbeddings = SyntheticEmbeddings;
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const entrypoint_deprecation_js_1 = require("../util/entrypoint_deprecation.cjs");
|
|
18
|
+
__exportStar(require("@langchain/core/utils/testing"), exports);
|
|
19
|
+
/* #__PURE__ */ (0, entrypoint_deprecation_js_1.logVersion010MigrationWarning)({
|
|
20
|
+
oldEntrypointName: "embeddings/fake",
|
|
21
|
+
newEntrypointName: "utils/testing",
|
|
22
|
+
newPackageName: "@langchain/core",
|
|
23
|
+
});
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* A class that provides fake embeddings by overriding the embedDocuments
|
|
4
|
-
* and embedQuery methods to return fixed values.
|
|
5
|
-
*/
|
|
6
|
-
export declare class FakeEmbeddings extends Embeddings {
|
|
7
|
-
constructor(params?: EmbeddingsParams);
|
|
8
|
-
/**
|
|
9
|
-
* Generates fixed embeddings for a list of documents.
|
|
10
|
-
* @param documents List of documents to generate embeddings for.
|
|
11
|
-
* @returns A promise that resolves with a list of fixed embeddings for each document.
|
|
12
|
-
*/
|
|
13
|
-
embedDocuments(documents: string[]): Promise<number[][]>;
|
|
14
|
-
/**
|
|
15
|
-
* Generates a fixed embedding for a query.
|
|
16
|
-
* @param _ The query to generate an embedding for.
|
|
17
|
-
* @returns A promise that resolves with a fixed embedding for the query.
|
|
18
|
-
*/
|
|
19
|
-
embedQuery(_: string): Promise<number[]>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* An interface that defines additional parameters specific to the
|
|
23
|
-
* SyntheticEmbeddings class.
|
|
24
|
-
*/
|
|
25
|
-
interface SyntheticEmbeddingsParams extends EmbeddingsParams {
|
|
26
|
-
vectorSize: number;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A class that provides synthetic embeddings by overriding the
|
|
30
|
-
* embedDocuments and embedQuery methods to generate embeddings based on
|
|
31
|
-
* the input documents. The embeddings are generated by converting each
|
|
32
|
-
* document into chunks, calculating a numerical value for each chunk, and
|
|
33
|
-
* returning an array of these values as the embedding.
|
|
34
|
-
*/
|
|
35
|
-
export declare class SyntheticEmbeddings extends Embeddings implements SyntheticEmbeddingsParams {
|
|
36
|
-
vectorSize: number;
|
|
37
|
-
constructor(params?: SyntheticEmbeddingsParams);
|
|
38
|
-
/**
|
|
39
|
-
* Generates synthetic embeddings for a list of documents.
|
|
40
|
-
* @param documents List of documents to generate embeddings for.
|
|
41
|
-
* @returns A promise that resolves with a list of synthetic embeddings for each document.
|
|
42
|
-
*/
|
|
43
|
-
embedDocuments(documents: string[]): Promise<number[][]>;
|
|
44
|
-
/**
|
|
45
|
-
* Generates a synthetic embedding for a document. The document is
|
|
46
|
-
* converted into chunks, a numerical value is calculated for each chunk,
|
|
47
|
-
* and an array of these values is returned as the embedding.
|
|
48
|
-
* @param document The document to generate an embedding for.
|
|
49
|
-
* @returns A promise that resolves with a synthetic embedding for the document.
|
|
50
|
-
*/
|
|
51
|
-
embedQuery(document: string): Promise<number[]>;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
1
|
+
export * from "@langchain/core/utils/testing";
|
package/dist/embeddings/fake.js
CHANGED
|
@@ -1,89 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
super(params ?? {});
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Generates fixed embeddings for a list of documents.
|
|
12
|
-
* @param documents List of documents to generate embeddings for.
|
|
13
|
-
* @returns A promise that resolves with a list of fixed embeddings for each document.
|
|
14
|
-
*/
|
|
15
|
-
embedDocuments(documents) {
|
|
16
|
-
return Promise.resolve(documents.map(() => [0.1, 0.2, 0.3, 0.4]));
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Generates a fixed embedding for a query.
|
|
20
|
-
* @param _ The query to generate an embedding for.
|
|
21
|
-
* @returns A promise that resolves with a fixed embedding for the query.
|
|
22
|
-
*/
|
|
23
|
-
embedQuery(_) {
|
|
24
|
-
return Promise.resolve([0.1, 0.2, 0.3, 0.4]);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* A class that provides synthetic embeddings by overriding the
|
|
29
|
-
* embedDocuments and embedQuery methods to generate embeddings based on
|
|
30
|
-
* the input documents. The embeddings are generated by converting each
|
|
31
|
-
* document into chunks, calculating a numerical value for each chunk, and
|
|
32
|
-
* returning an array of these values as the embedding.
|
|
33
|
-
*/
|
|
34
|
-
export class SyntheticEmbeddings extends Embeddings {
|
|
35
|
-
constructor(params) {
|
|
36
|
-
super(params ?? {});
|
|
37
|
-
Object.defineProperty(this, "vectorSize", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true,
|
|
40
|
-
writable: true,
|
|
41
|
-
value: void 0
|
|
42
|
-
});
|
|
43
|
-
this.vectorSize = params?.vectorSize ?? 4;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Generates synthetic embeddings for a list of documents.
|
|
47
|
-
* @param documents List of documents to generate embeddings for.
|
|
48
|
-
* @returns A promise that resolves with a list of synthetic embeddings for each document.
|
|
49
|
-
*/
|
|
50
|
-
async embedDocuments(documents) {
|
|
51
|
-
return Promise.all(documents.map((doc) => this.embedQuery(doc)));
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Generates a synthetic embedding for a document. The document is
|
|
55
|
-
* converted into chunks, a numerical value is calculated for each chunk,
|
|
56
|
-
* and an array of these values is returned as the embedding.
|
|
57
|
-
* @param document The document to generate an embedding for.
|
|
58
|
-
* @returns A promise that resolves with a synthetic embedding for the document.
|
|
59
|
-
*/
|
|
60
|
-
async embedQuery(document) {
|
|
61
|
-
let doc = document;
|
|
62
|
-
// Only use the letters (and space) from the document, and make them lower case
|
|
63
|
-
doc = doc.toLowerCase().replaceAll(/[^a-z ]/g, "");
|
|
64
|
-
// Pad the document to make sure it has a divisible number of chunks
|
|
65
|
-
const padMod = doc.length % this.vectorSize;
|
|
66
|
-
const padGapSize = padMod === 0 ? 0 : this.vectorSize - padMod;
|
|
67
|
-
const padSize = doc.length + padGapSize;
|
|
68
|
-
doc = doc.padEnd(padSize, " ");
|
|
69
|
-
// Break it into chunks
|
|
70
|
-
const chunkSize = doc.length / this.vectorSize;
|
|
71
|
-
const docChunk = [];
|
|
72
|
-
for (let co = 0; co < doc.length; co += chunkSize) {
|
|
73
|
-
docChunk.push(doc.slice(co, co + chunkSize));
|
|
74
|
-
}
|
|
75
|
-
// Turn each chunk into a number
|
|
76
|
-
const ret = docChunk.map((s) => {
|
|
77
|
-
let sum = 0;
|
|
78
|
-
// Get a total value by adding the value of each character in the string
|
|
79
|
-
for (let co = 0; co < s.length; co += 1) {
|
|
80
|
-
sum += s === " " ? 0 : s.charCodeAt(co);
|
|
81
|
-
}
|
|
82
|
-
// Reduce this to a number between 0 and 25 inclusive
|
|
83
|
-
// Then get the fractional number by dividing it by 26
|
|
84
|
-
const ret = (sum % 26) / 26;
|
|
85
|
-
return ret;
|
|
86
|
-
});
|
|
87
|
-
return ret;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
import { logVersion010MigrationWarning } from "../util/entrypoint_deprecation.js";
|
|
2
|
+
export * from "@langchain/core/utils/testing";
|
|
3
|
+
/* #__PURE__ */ logVersion010MigrationWarning({
|
|
4
|
+
oldEntrypointName: "embeddings/fake",
|
|
5
|
+
newEntrypointName: "utils/testing",
|
|
6
|
+
newPackageName: "@langchain/core",
|
|
7
|
+
});
|
|
@@ -171,6 +171,7 @@ exports.optionalImportEntrypoints = [
|
|
|
171
171
|
"langchain/graphs/neo4j_graph",
|
|
172
172
|
"langchain/hub",
|
|
173
173
|
"langchain/util/convex",
|
|
174
|
+
"langchain/util/migrations/0_1",
|
|
174
175
|
"langchain/experimental/multimodal_embeddings/googlevertexai",
|
|
175
176
|
"langchain/experimental/chat_models/anthropic_functions",
|
|
176
177
|
"langchain/experimental/llms/bittensor",
|
|
@@ -168,6 +168,7 @@ export const optionalImportEntrypoints = [
|
|
|
168
168
|
"langchain/graphs/neo4j_graph",
|
|
169
169
|
"langchain/hub",
|
|
170
170
|
"langchain/util/convex",
|
|
171
|
+
"langchain/util/migrations/0_1",
|
|
171
172
|
"langchain/experimental/multimodal_embeddings/googlevertexai",
|
|
172
173
|
"langchain/experimental/chat_models/anthropic_functions",
|
|
173
174
|
"langchain/experimental/llms/bittensor",
|
package/dist/load/import_map.cjs
CHANGED
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.storage__in_memory = exports.storage__encoder_backed = exports.stores__message__in_memory = exports.stores__file__in_memory = exports.stores__doc__in_memory = exports.retrievers__vespa = exports.retrievers__score_threshold = exports.retrievers__hyde = exports.retrievers__document_compressors__embeddings_filter = exports.retrievers__document_compressors__chain_extract = exports.retrievers__time_weighted = exports.retrievers__parent_document = exports.retrievers__multi_vector = exports.retrievers__multi_query = exports.retrievers__document_compressors = exports.retrievers__contextual_compression = exports.retrievers__remote = exports.output_parsers = exports.schema__query_constructor = exports.schema__prompt_template = exports.chat_models__anthropic = exports.document_transformers__openai_functions = exports.document_loaders__web__sort_xyz_blockchain = exports.document_loaders__web__serpapi = exports.document_loaders__web__searchapi = exports.document_loaders__base = exports.text_splitter = exports.vectorstores__memory = exports.llms__fake = exports.embeddings__fake = exports.embeddings__cache_backed = exports.chains__retrieval = exports.chains__openai_functions = exports.chains__history_aware_retriever = exports.chains__combine_documents__reduce = exports.chains__combine_documents = exports.chains = exports.tools__retriever = exports.tools__render = exports.tools__chain = exports.agents__openai__output_parser = exports.agents__xml__output_parser = exports.agents__react__output_parser = exports.agents__format_scratchpad__log_to_message = exports.agents__format_scratchpad__xml = exports.agents__format_scratchpad__log = exports.agents__format_scratchpad__openai_tools = exports.agents__format_scratchpad = exports.agents__toolkits = exports.agents = void 0;
|
|
28
|
-
exports.llms__fireworks = exports.chat_models__fireworks = exports.schema__output = exports.schema__output_parser = exports.schema__runnable = exports.prompts__base = exports.prompts__pipeline = exports.prompts__chat = exports.schema__messages = exports.prompts__prompt = exports.embeddings__openai = exports.llms__openai = exports.chat_models__openai = exports.indexes = exports.runnables__remote = exports.smith = exports.evaluation = exports.experimental__prompts__custom_format = exports.experimental__masking = exports.experimental__chains__violation_of_expectations = exports.experimental__chat_models__bittensor = exports.experimental__plan_and_execute = exports.experimental__generative_agents = exports.experimental__babyagi = exports.experimental__openai_files = exports.experimental__openai_assistant = exports.experimental__autogpt = exports.util__time = exports.util__math = exports.util__document = void 0;
|
|
28
|
+
exports.llms__fireworks = exports.chat_models__fireworks = exports.schema__output = exports.schema__output_parser = exports.schema__runnable = exports.prompts__base = exports.prompts__pipeline = exports.prompts__image = exports.prompts__chat = exports.schema = exports.schema__messages = exports.prompts__prompt = exports.embeddings__openai = exports.llms__openai = exports.chat_models__openai = exports.indexes = exports.runnables__remote = exports.smith = exports.evaluation = exports.experimental__prompts__custom_format = exports.experimental__masking = exports.experimental__chains__violation_of_expectations = exports.experimental__chat_models__bittensor = exports.experimental__plan_and_execute = exports.experimental__generative_agents = exports.experimental__babyagi = exports.experimental__openai_files = exports.experimental__openai_assistant = exports.experimental__autogpt = exports.util__time = exports.util__math = exports.util__document = void 0;
|
|
29
29
|
exports.agents = __importStar(require("../agents/index.cjs"));
|
|
30
30
|
exports.agents__toolkits = __importStar(require("../agents/toolkits/index.cjs"));
|
|
31
31
|
exports.agents__format_scratchpad = __importStar(require("../agents/format_scratchpad/openai_functions.cjs"));
|
|
@@ -103,19 +103,19 @@ const outputs_1 = require("@langchain/core/outputs");
|
|
|
103
103
|
const fireworks_1 = require("@langchain/community/chat_models/fireworks");
|
|
104
104
|
const fireworks_2 = require("@langchain/community/llms/fireworks");
|
|
105
105
|
const chat_models__openai = {
|
|
106
|
-
ChatOpenAI: openai_1.ChatOpenAI
|
|
106
|
+
ChatOpenAI: openai_1.ChatOpenAI
|
|
107
107
|
};
|
|
108
108
|
exports.chat_models__openai = chat_models__openai;
|
|
109
109
|
const llms__openai = {
|
|
110
|
-
OpenAI: openai_1.OpenAI
|
|
110
|
+
OpenAI: openai_1.OpenAI
|
|
111
111
|
};
|
|
112
112
|
exports.llms__openai = llms__openai;
|
|
113
113
|
const embeddings__openai = {
|
|
114
|
-
OpenAIEmbeddings: openai_1.OpenAIEmbeddings
|
|
114
|
+
OpenAIEmbeddings: openai_1.OpenAIEmbeddings
|
|
115
115
|
};
|
|
116
116
|
exports.embeddings__openai = embeddings__openai;
|
|
117
117
|
const prompts__prompt = {
|
|
118
|
-
PromptTemplate: prompts_1.PromptTemplate
|
|
118
|
+
PromptTemplate: prompts_1.PromptTemplate
|
|
119
119
|
};
|
|
120
120
|
exports.prompts__prompt = prompts__prompt;
|
|
121
121
|
const schema__messages = {
|
|
@@ -132,24 +132,45 @@ const schema__messages = {
|
|
|
132
132
|
SystemMessage: messages_1.SystemMessage,
|
|
133
133
|
SystemMessageChunk: messages_1.SystemMessageChunk,
|
|
134
134
|
ToolMessage: messages_1.ToolMessage,
|
|
135
|
-
ToolMessageChunk: messages_1.ToolMessageChunk
|
|
135
|
+
ToolMessageChunk: messages_1.ToolMessageChunk
|
|
136
136
|
};
|
|
137
137
|
exports.schema__messages = schema__messages;
|
|
138
|
+
const schema = {
|
|
139
|
+
AIMessage: messages_1.AIMessage,
|
|
140
|
+
AIMessageChunk: messages_1.AIMessageChunk,
|
|
141
|
+
BaseMessage: messages_1.BaseMessage,
|
|
142
|
+
BaseMessageChunk: messages_1.BaseMessageChunk,
|
|
143
|
+
ChatMessage: messages_1.ChatMessage,
|
|
144
|
+
ChatMessageChunk: messages_1.ChatMessageChunk,
|
|
145
|
+
FunctionMessage: messages_1.FunctionMessage,
|
|
146
|
+
FunctionMessageChunk: messages_1.FunctionMessageChunk,
|
|
147
|
+
HumanMessage: messages_1.HumanMessage,
|
|
148
|
+
HumanMessageChunk: messages_1.HumanMessageChunk,
|
|
149
|
+
SystemMessage: messages_1.SystemMessage,
|
|
150
|
+
SystemMessageChunk: messages_1.SystemMessageChunk,
|
|
151
|
+
ToolMessage: messages_1.ToolMessage,
|
|
152
|
+
ToolMessageChunk: messages_1.ToolMessageChunk
|
|
153
|
+
};
|
|
154
|
+
exports.schema = schema;
|
|
138
155
|
const prompts__chat = {
|
|
139
156
|
AIMessagePromptTemplate: prompts_1.AIMessagePromptTemplate,
|
|
140
157
|
ChatMessagePromptTemplate: prompts_1.ChatMessagePromptTemplate,
|
|
141
158
|
ChatPromptTemplate: prompts_1.ChatPromptTemplate,
|
|
142
159
|
HumanMessagePromptTemplate: prompts_1.HumanMessagePromptTemplate,
|
|
143
160
|
MessagesPlaceholder: prompts_1.MessagesPlaceholder,
|
|
144
|
-
SystemMessagePromptTemplate: prompts_1.SystemMessagePromptTemplate
|
|
161
|
+
SystemMessagePromptTemplate: prompts_1.SystemMessagePromptTemplate
|
|
145
162
|
};
|
|
146
163
|
exports.prompts__chat = prompts__chat;
|
|
164
|
+
const prompts__image = {
|
|
165
|
+
ImagePromptTemplate: prompts_1.ImagePromptTemplate
|
|
166
|
+
};
|
|
167
|
+
exports.prompts__image = prompts__image;
|
|
147
168
|
const prompts__pipeline = {
|
|
148
|
-
PipelinePromptTemplate: prompts_1.PipelinePromptTemplate
|
|
169
|
+
PipelinePromptTemplate: prompts_1.PipelinePromptTemplate
|
|
149
170
|
};
|
|
150
171
|
exports.prompts__pipeline = prompts__pipeline;
|
|
151
172
|
const prompts__base = {
|
|
152
|
-
StringPromptValue: prompt_values_1.StringPromptValue
|
|
173
|
+
StringPromptValue: prompt_values_1.StringPromptValue
|
|
153
174
|
};
|
|
154
175
|
exports.prompts__base = prompts__base;
|
|
155
176
|
const schema__runnable = {
|
|
@@ -165,23 +186,23 @@ const schema__runnable = {
|
|
|
165
186
|
RunnableRetry: runnables_1.RunnableRetry,
|
|
166
187
|
RunnableSequence: runnables_1.RunnableSequence,
|
|
167
188
|
RunnableWithFallbacks: runnables_1.RunnableWithFallbacks,
|
|
168
|
-
RunnableWithMessageHistory: runnables_1.RunnableWithMessageHistory
|
|
189
|
+
RunnableWithMessageHistory: runnables_1.RunnableWithMessageHistory
|
|
169
190
|
};
|
|
170
191
|
exports.schema__runnable = schema__runnable;
|
|
171
192
|
const schema__output_parser = {
|
|
172
|
-
StringOutputParser: output_parsers_1.StringOutputParser
|
|
193
|
+
StringOutputParser: output_parsers_1.StringOutputParser
|
|
173
194
|
};
|
|
174
195
|
exports.schema__output_parser = schema__output_parser;
|
|
175
196
|
const schema__output = {
|
|
176
197
|
ChatGenerationChunk: outputs_1.ChatGenerationChunk,
|
|
177
|
-
GenerationChunk: outputs_1.GenerationChunk
|
|
198
|
+
GenerationChunk: outputs_1.GenerationChunk
|
|
178
199
|
};
|
|
179
200
|
exports.schema__output = schema__output;
|
|
180
201
|
const chat_models__fireworks = {
|
|
181
|
-
ChatFireworks: fireworks_1.ChatFireworks
|
|
202
|
+
ChatFireworks: fireworks_1.ChatFireworks
|
|
182
203
|
};
|
|
183
204
|
exports.chat_models__fireworks = chat_models__fireworks;
|
|
184
205
|
const llms__fireworks = {
|
|
185
|
-
Fireworks: fireworks_2.Fireworks
|
|
206
|
+
Fireworks: fireworks_2.Fireworks
|
|
186
207
|
};
|
|
187
208
|
exports.llms__fireworks = llms__fireworks;
|
|
@@ -66,7 +66,7 @@ export * as smith from "../smith/index.js";
|
|
|
66
66
|
export * as runnables__remote from "../runnables/remote.js";
|
|
67
67
|
export * as indexes from "../indexes/index.js";
|
|
68
68
|
import { ChatOpenAI, OpenAI, OpenAIEmbeddings } from "@langchain/openai";
|
|
69
|
-
import { PromptTemplate, AIMessagePromptTemplate, ChatMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate, MessagesPlaceholder, SystemMessagePromptTemplate, PipelinePromptTemplate } from "@langchain/core/prompts";
|
|
69
|
+
import { PromptTemplate, AIMessagePromptTemplate, ChatMessagePromptTemplate, ChatPromptTemplate, HumanMessagePromptTemplate, MessagesPlaceholder, SystemMessagePromptTemplate, ImagePromptTemplate, PipelinePromptTemplate } from "@langchain/core/prompts";
|
|
70
70
|
import { AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, ChatMessage, ChatMessageChunk, FunctionMessage, FunctionMessageChunk, HumanMessage, HumanMessageChunk, SystemMessage, SystemMessageChunk, ToolMessage, ToolMessageChunk } from "@langchain/core/messages";
|
|
71
71
|
import { StringPromptValue } from "@langchain/core/prompt_values";
|
|
72
72
|
import { RouterRunnable, RunnableAssign, RunnableBinding, RunnableBranch, RunnableEach, RunnableMap, RunnableParallel, RunnablePassthrough, RunnablePick, RunnableRetry, RunnableSequence, RunnableWithFallbacks, RunnableWithMessageHistory } from "@langchain/core/runnables";
|
|
@@ -107,6 +107,23 @@ declare const schema__messages: {
|
|
|
107
107
|
ToolMessageChunk: typeof ToolMessageChunk;
|
|
108
108
|
};
|
|
109
109
|
export { schema__messages };
|
|
110
|
+
declare const schema: {
|
|
111
|
+
AIMessage: typeof AIMessage;
|
|
112
|
+
AIMessageChunk: typeof AIMessageChunk;
|
|
113
|
+
BaseMessage: typeof BaseMessage;
|
|
114
|
+
BaseMessageChunk: typeof BaseMessageChunk;
|
|
115
|
+
ChatMessage: typeof ChatMessage;
|
|
116
|
+
ChatMessageChunk: typeof ChatMessageChunk;
|
|
117
|
+
FunctionMessage: typeof FunctionMessage;
|
|
118
|
+
FunctionMessageChunk: typeof FunctionMessageChunk;
|
|
119
|
+
HumanMessage: typeof HumanMessage;
|
|
120
|
+
HumanMessageChunk: typeof HumanMessageChunk;
|
|
121
|
+
SystemMessage: typeof SystemMessage;
|
|
122
|
+
SystemMessageChunk: typeof SystemMessageChunk;
|
|
123
|
+
ToolMessage: typeof ToolMessage;
|
|
124
|
+
ToolMessageChunk: typeof ToolMessageChunk;
|
|
125
|
+
};
|
|
126
|
+
export { schema };
|
|
110
127
|
declare const prompts__chat: {
|
|
111
128
|
AIMessagePromptTemplate: typeof AIMessagePromptTemplate;
|
|
112
129
|
ChatMessagePromptTemplate: typeof ChatMessagePromptTemplate;
|
|
@@ -116,6 +133,10 @@ declare const prompts__chat: {
|
|
|
116
133
|
SystemMessagePromptTemplate: typeof SystemMessagePromptTemplate;
|
|
117
134
|
};
|
|
118
135
|
export { prompts__chat };
|
|
136
|
+
declare const prompts__image: {
|
|
137
|
+
ImagePromptTemplate: typeof ImagePromptTemplate;
|
|
138
|
+
};
|
|
139
|
+
export { prompts__image };
|
|
119
140
|
declare const prompts__pipeline: {
|
|
120
141
|
PipelinePromptTemplate: typeof PipelinePromptTemplate;
|
|
121
142
|
};
|