langchain 0.0.198 → 0.0.199
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/agents/index.d.ts +1 -1
- package/dist/chains/conversational_retrieval_chain.cjs +16 -2
- package/dist/chains/conversational_retrieval_chain.d.ts +2 -0
- package/dist/chains/conversational_retrieval_chain.js +16 -2
- package/dist/chat_models/llama_cpp.cjs +41 -20
- package/dist/chat_models/llama_cpp.d.ts +1 -0
- package/dist/chat_models/llama_cpp.js +42 -21
- package/dist/document_loaders/fs/chatgpt.cjs +85 -0
- package/dist/document_loaders/fs/chatgpt.d.ts +8 -0
- package/dist/document_loaders/fs/chatgpt.js +81 -0
- package/dist/document_loaders/web/confluence.cjs +31 -7
- package/dist/document_loaders/web/confluence.d.ts +12 -5
- package/dist/document_loaders/web/confluence.js +31 -7
- package/dist/llms/gradient_ai.cjs +98 -0
- package/dist/llms/gradient_ai.d.ts +50 -0
- package/dist/llms/gradient_ai.js +94 -0
- package/dist/llms/watsonx_ai.cjs +154 -0
- package/dist/llms/watsonx_ai.d.ts +72 -0
- package/dist/llms/watsonx_ai.js +150 -0
- package/dist/load/import_constants.cjs +3 -0
- package/dist/load/import_constants.js +3 -0
- package/dist/load/import_map.cjs +4 -3
- package/dist/load/import_map.d.ts +1 -0
- package/dist/load/import_map.js +1 -0
- package/dist/tools/google_places.cjs +81 -0
- package/dist/tools/google_places.d.ts +21 -0
- package/dist/tools/google_places.js +77 -0
- package/dist/vectorstores/elasticsearch.cjs +16 -3
- package/dist/vectorstores/elasticsearch.d.ts +6 -2
- package/dist/vectorstores/elasticsearch.js +16 -3
- package/dist/vectorstores/prisma.cjs +1 -1
- package/dist/vectorstores/prisma.js +1 -1
- package/dist/vectorstores/weaviate.d.ts +1 -1
- package/dist/vectorstores/xata.cjs +3 -2
- package/dist/vectorstores/xata.js +3 -2
- package/document_loaders/fs/chatgpt.cjs +1 -0
- package/document_loaders/fs/chatgpt.d.ts +1 -0
- package/document_loaders/fs/chatgpt.js +1 -0
- package/llms/gradient_ai.cjs +1 -0
- package/llms/gradient_ai.d.ts +1 -0
- package/llms/gradient_ai.js +1 -0
- package/llms/watsonx_ai.cjs +1 -0
- package/llms/watsonx_ai.d.ts +1 -0
- package/llms/watsonx_ai.js +1 -0
- package/package.json +50 -11
- package/tools/google_places.cjs +1 -0
- package/tools/google_places.d.ts +1 -0
- package/tools/google_places.js +1 -0
package/dist/load/import_map.cjs
CHANGED
|
@@ -24,9 +24,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.runnables__remote = exports.runnables = exports.evaluation = void 0;
|
|
27
|
+
exports.chat_models__openai = exports.chat_models__base = 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.document = exports.memory = exports.text_splitter = exports.vectorstores__xata = exports.vectorstores__vectara = exports.vectorstores__prisma = exports.vectorstores__memory = exports.vectorstores__base = exports.prompts = exports.llms__fake = exports.llms__yandex = exports.llms__fireworks = exports.llms__ollama = exports.llms__cloudflare_workersai = exports.llms__aleph_alpha = exports.llms__ai21 = exports.llms__openai = exports.llms__base = exports.embeddings__voyage = exports.embeddings__minimax = exports.embeddings__openai = exports.embeddings__ollama = exports.embeddings__fake = exports.embeddings__cache_backed = exports.embeddings__base = exports.chains__openai_functions = exports.chains__combine_documents__reduce = exports.chains = exports.tools__google_places = exports.tools__render = exports.tools = exports.base_language = 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 = exports.load__serializable = void 0;
|
|
28
|
+
exports.experimental__chat_models__ollama_functions = 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 = exports.storage__in_memory = exports.storage__encoder_backed = exports.stores__message__in_memory = exports.stores__file__in_memory = exports.stores__doc__in_memory = exports.cache = 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__tavily_search_api = exports.retrievers__parent_document = exports.retrievers__multi_vector = exports.retrievers__multi_query = exports.retrievers__document_compressors = exports.retrievers__contextual_compression = exports.retrievers__databerry = exports.retrievers__chaindesk = exports.retrievers__remote = exports.output_parsers = exports.callbacks = exports.schema__storage = exports.schema__runnable = exports.schema__retriever = exports.schema__query_constructor = exports.schema__prompt_template = exports.schema__output_parser = exports.schema__document = exports.schema = exports.chat_models__fake = exports.chat_models__yandex = exports.chat_models__minimax = exports.chat_models__ollama = exports.chat_models__baiduwenxin = exports.chat_models__fireworks = exports.chat_models__cloudflare_workersai = exports.chat_models__anthropic = void 0;
|
|
29
|
+
exports.runnables__remote = exports.runnables = exports.evaluation = exports.experimental__chains__violation_of_expectations = void 0;
|
|
30
30
|
exports.load__serializable = __importStar(require("../load/serializable.cjs"));
|
|
31
31
|
exports.agents = __importStar(require("../agents/index.cjs"));
|
|
32
32
|
exports.agents__toolkits = __importStar(require("../agents/toolkits/index.cjs"));
|
|
@@ -41,6 +41,7 @@ exports.agents__openai__output_parser = __importStar(require("../agents/openai/o
|
|
|
41
41
|
exports.base_language = __importStar(require("../base_language/index.cjs"));
|
|
42
42
|
exports.tools = __importStar(require("../tools/index.cjs"));
|
|
43
43
|
exports.tools__render = __importStar(require("../tools/render.cjs"));
|
|
44
|
+
exports.tools__google_places = __importStar(require("../tools/google_places.cjs"));
|
|
44
45
|
exports.chains = __importStar(require("../chains/index.cjs"));
|
|
45
46
|
exports.chains__combine_documents__reduce = __importStar(require("../chains/combine_documents/reduce.cjs"));
|
|
46
47
|
exports.chains__openai_functions = __importStar(require("../chains/openai_functions/index.cjs"));
|
|
@@ -12,6 +12,7 @@ export * as agents__openai__output_parser from "../agents/openai/output_parser.j
|
|
|
12
12
|
export * as base_language from "../base_language/index.js";
|
|
13
13
|
export * as tools from "../tools/index.js";
|
|
14
14
|
export * as tools__render from "../tools/render.js";
|
|
15
|
+
export * as tools__google_places from "../tools/google_places.js";
|
|
15
16
|
export * as chains from "../chains/index.js";
|
|
16
17
|
export * as chains__combine_documents__reduce from "../chains/combine_documents/reduce.js";
|
|
17
18
|
export * as chains__openai_functions from "../chains/openai_functions/index.js";
|
package/dist/load/import_map.js
CHANGED
|
@@ -13,6 +13,7 @@ export * as agents__openai__output_parser from "../agents/openai/output_parser.j
|
|
|
13
13
|
export * as base_language from "../base_language/index.js";
|
|
14
14
|
export * as tools from "../tools/index.js";
|
|
15
15
|
export * as tools__render from "../tools/render.js";
|
|
16
|
+
export * as tools__google_places from "../tools/google_places.js";
|
|
16
17
|
export * as chains from "../chains/index.js";
|
|
17
18
|
export * as chains__combine_documents__reduce from "../chains/combine_documents/reduce.js";
|
|
18
19
|
export * as chains__openai_functions from "../chains/openai_functions/index.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GooglePlacesAPI = void 0;
|
|
4
|
+
const env_js_1 = require("../util/env.cjs");
|
|
5
|
+
const base_js_1 = require("./base.cjs");
|
|
6
|
+
/**
|
|
7
|
+
* Tool that queries the Google Places API
|
|
8
|
+
*/
|
|
9
|
+
class GooglePlacesAPI extends base_js_1.Tool {
|
|
10
|
+
static lc_name() {
|
|
11
|
+
return "GooglePlacesAPI";
|
|
12
|
+
}
|
|
13
|
+
get lc_secrets() {
|
|
14
|
+
return {
|
|
15
|
+
apiKey: "GOOGLE_PLACES_API_KEY",
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
constructor(fields) {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
Object.defineProperty(this, "name", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: "google_places"
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(this, "apiKey", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: void 0
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(this, "description", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: `A wrapper around Google Places API. Useful for when you need to validate or
|
|
37
|
+
discover addresses from ambiguous text. Input should be a search query.`
|
|
38
|
+
});
|
|
39
|
+
const apiKey = fields?.apiKey ?? (0, env_js_1.getEnvironmentVariable)("GOOGLE_PLACES_API_KEY");
|
|
40
|
+
if (apiKey === undefined) {
|
|
41
|
+
throw new Error(`Google Places API key not set. You can set it as "GOOGLE_PLACES_API_KEY" in your environment variables.`);
|
|
42
|
+
}
|
|
43
|
+
this.apiKey = apiKey;
|
|
44
|
+
}
|
|
45
|
+
async _call(input) {
|
|
46
|
+
const res = await fetch(`https://places.googleapis.com/v1/places:searchText`, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
body: JSON.stringify({
|
|
49
|
+
textQuery: input,
|
|
50
|
+
languageCode: "en",
|
|
51
|
+
}),
|
|
52
|
+
headers: {
|
|
53
|
+
"X-Goog-Api-Key": this.apiKey,
|
|
54
|
+
"X-Goog-FieldMask": "places.displayName,places.formattedAddress,places.id,places.internationalPhoneNumber,places.websiteUri",
|
|
55
|
+
"Content-Type": "application/json",
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
if (!res.ok) {
|
|
59
|
+
let message;
|
|
60
|
+
try {
|
|
61
|
+
const json = await res.json();
|
|
62
|
+
message = json.error.message;
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
message =
|
|
66
|
+
"Unable to parse error message: Google did not return a JSON response.";
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`Got ${res.status}: ${res.statusText} error from Google Places API: ${message}`);
|
|
69
|
+
}
|
|
70
|
+
const json = await res.json();
|
|
71
|
+
const results = json?.places?.map((place) => ({
|
|
72
|
+
name: place.displayName?.text,
|
|
73
|
+
id: place.id,
|
|
74
|
+
address: place.formattedAddress,
|
|
75
|
+
phoneNumber: place.internationalPhoneNumber,
|
|
76
|
+
website: place.websiteUri,
|
|
77
|
+
})) ?? [];
|
|
78
|
+
return JSON.stringify(results);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.GooglePlacesAPI = GooglePlacesAPI;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tool } from "./base.js";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for parameters required by GooglePlacesAPI class.
|
|
4
|
+
*/
|
|
5
|
+
export interface GooglePlacesAPIParams {
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Tool that queries the Google Places API
|
|
10
|
+
*/
|
|
11
|
+
export declare class GooglePlacesAPI extends Tool {
|
|
12
|
+
static lc_name(): string;
|
|
13
|
+
get lc_secrets(): {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
name: string;
|
|
17
|
+
protected apiKey: string;
|
|
18
|
+
description: string;
|
|
19
|
+
constructor(fields?: GooglePlacesAPIParams);
|
|
20
|
+
_call(input: string): Promise<string>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { getEnvironmentVariable } from "../util/env.js";
|
|
2
|
+
import { Tool } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Tool that queries the Google Places API
|
|
5
|
+
*/
|
|
6
|
+
export class GooglePlacesAPI extends Tool {
|
|
7
|
+
static lc_name() {
|
|
8
|
+
return "GooglePlacesAPI";
|
|
9
|
+
}
|
|
10
|
+
get lc_secrets() {
|
|
11
|
+
return {
|
|
12
|
+
apiKey: "GOOGLE_PLACES_API_KEY",
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
constructor(fields) {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
Object.defineProperty(this, "name", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: "google_places"
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(this, "apiKey", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: void 0
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(this, "description", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: `A wrapper around Google Places API. Useful for when you need to validate or
|
|
34
|
+
discover addresses from ambiguous text. Input should be a search query.`
|
|
35
|
+
});
|
|
36
|
+
const apiKey = fields?.apiKey ?? getEnvironmentVariable("GOOGLE_PLACES_API_KEY");
|
|
37
|
+
if (apiKey === undefined) {
|
|
38
|
+
throw new Error(`Google Places API key not set. You can set it as "GOOGLE_PLACES_API_KEY" in your environment variables.`);
|
|
39
|
+
}
|
|
40
|
+
this.apiKey = apiKey;
|
|
41
|
+
}
|
|
42
|
+
async _call(input) {
|
|
43
|
+
const res = await fetch(`https://places.googleapis.com/v1/places:searchText`, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: JSON.stringify({
|
|
46
|
+
textQuery: input,
|
|
47
|
+
languageCode: "en",
|
|
48
|
+
}),
|
|
49
|
+
headers: {
|
|
50
|
+
"X-Goog-Api-Key": this.apiKey,
|
|
51
|
+
"X-Goog-FieldMask": "places.displayName,places.formattedAddress,places.id,places.internationalPhoneNumber,places.websiteUri",
|
|
52
|
+
"Content-Type": "application/json",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
let message;
|
|
57
|
+
try {
|
|
58
|
+
const json = await res.json();
|
|
59
|
+
message = json.error.message;
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
message =
|
|
63
|
+
"Unable to parse error message: Google did not return a JSON response.";
|
|
64
|
+
}
|
|
65
|
+
throw new Error(`Got ${res.status}: ${res.statusText} error from Google Places API: ${message}`);
|
|
66
|
+
}
|
|
67
|
+
const json = await res.json();
|
|
68
|
+
const results = json?.places?.map((place) => ({
|
|
69
|
+
name: place.displayName?.text,
|
|
70
|
+
id: place.id,
|
|
71
|
+
address: place.formattedAddress,
|
|
72
|
+
phoneNumber: place.internationalPhoneNumber,
|
|
73
|
+
website: place.websiteUri,
|
|
74
|
+
})) ?? [];
|
|
75
|
+
return JSON.stringify(results);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -258,12 +258,25 @@ class ElasticVectorSearch extends base_js_1.VectorStore {
|
|
|
258
258
|
return;
|
|
259
259
|
await this.client.indices.create(request);
|
|
260
260
|
}
|
|
261
|
-
buildMetadataTerms(filter
|
|
261
|
+
buildMetadataTerms(filter
|
|
262
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
263
|
+
) {
|
|
262
264
|
if (filter == null)
|
|
263
265
|
return [];
|
|
264
266
|
const result = [];
|
|
265
|
-
|
|
266
|
-
|
|
267
|
+
const filters = Array.isArray(filter)
|
|
268
|
+
? filter
|
|
269
|
+
: Object.entries(filter).map(([key, value]) => ({
|
|
270
|
+
operator: "term",
|
|
271
|
+
field: key,
|
|
272
|
+
value,
|
|
273
|
+
}));
|
|
274
|
+
for (const condition of filters) {
|
|
275
|
+
result.push({
|
|
276
|
+
[condition.operator]: {
|
|
277
|
+
[`metadata.${condition.field}`]: condition.value,
|
|
278
|
+
},
|
|
279
|
+
});
|
|
267
280
|
}
|
|
268
281
|
return result;
|
|
269
282
|
}
|
|
@@ -33,7 +33,11 @@ export interface ElasticClientArgs {
|
|
|
33
33
|
/**
|
|
34
34
|
* Type representing a filter object in Elasticsearch.
|
|
35
35
|
*/
|
|
36
|
-
type ElasticFilter = object
|
|
36
|
+
type ElasticFilter = object | {
|
|
37
|
+
field: string;
|
|
38
|
+
operator: string;
|
|
39
|
+
value: any;
|
|
40
|
+
}[];
|
|
37
41
|
/**
|
|
38
42
|
* Class for interacting with an Elasticsearch database. It extends the
|
|
39
43
|
* VectorStore base class and provides methods for adding documents and
|
|
@@ -83,7 +87,7 @@ export declare class ElasticVectorSearch extends VectorStore {
|
|
|
83
87
|
* @param filter Optional filter to apply to the search.
|
|
84
88
|
* @returns A promise that resolves with an array of tuples, where each tuple contains a Document and its similarity score.
|
|
85
89
|
*/
|
|
86
|
-
similaritySearchVectorWithScore(query: number[], k: number, filter?: ElasticFilter
|
|
90
|
+
similaritySearchVectorWithScore(query: number[], k: number, filter?: ElasticFilter): Promise<[Document, number][]>;
|
|
87
91
|
/**
|
|
88
92
|
* Method to delete documents from the Elasticsearch database.
|
|
89
93
|
* @param params Object containing the IDs of the documents to delete.
|
|
@@ -232,12 +232,25 @@ export class ElasticVectorSearch extends VectorStore {
|
|
|
232
232
|
return;
|
|
233
233
|
await this.client.indices.create(request);
|
|
234
234
|
}
|
|
235
|
-
buildMetadataTerms(filter
|
|
235
|
+
buildMetadataTerms(filter
|
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
237
|
+
) {
|
|
236
238
|
if (filter == null)
|
|
237
239
|
return [];
|
|
238
240
|
const result = [];
|
|
239
|
-
|
|
240
|
-
|
|
241
|
+
const filters = Array.isArray(filter)
|
|
242
|
+
? filter
|
|
243
|
+
: Object.entries(filter).map(([key, value]) => ({
|
|
244
|
+
operator: "term",
|
|
245
|
+
field: key,
|
|
246
|
+
value,
|
|
247
|
+
}));
|
|
248
|
+
for (const condition of filters) {
|
|
249
|
+
result.push({
|
|
250
|
+
[condition.operator]: {
|
|
251
|
+
[`metadata.${condition.field}`]: condition.value,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
241
254
|
}
|
|
242
255
|
return result;
|
|
243
256
|
}
|
|
@@ -249,7 +249,7 @@ class PrismaVectorStore extends base_js_1.VectorStore {
|
|
|
249
249
|
!value.every((v) => typeof v === "string")) {
|
|
250
250
|
throw new Error(`Invalid filter: IN operator requires an array of strings. Received: ${JSON.stringify(value, null, 2)}`);
|
|
251
251
|
}
|
|
252
|
-
return this.Prisma.sql `${colRaw} ${opRaw} (${
|
|
252
|
+
return this.Prisma.sql `${colRaw} ${opRaw} (${this.Prisma.join(value)})`;
|
|
253
253
|
}
|
|
254
254
|
case OpMap.isNull:
|
|
255
255
|
case OpMap.isNotNull:
|
|
@@ -246,7 +246,7 @@ class PrismaVectorStore extends VectorStore {
|
|
|
246
246
|
!value.every((v) => typeof v === "string")) {
|
|
247
247
|
throw new Error(`Invalid filter: IN operator requires an array of strings. Received: ${JSON.stringify(value, null, 2)}`);
|
|
248
248
|
}
|
|
249
|
-
return this.Prisma.sql `${colRaw} ${opRaw} (${
|
|
249
|
+
return this.Prisma.sql `${colRaw} ${opRaw} (${this.Prisma.join(value)})`;
|
|
250
250
|
}
|
|
251
251
|
case OpMap.isNull:
|
|
252
252
|
case OpMap.isNotNull:
|
|
@@ -108,7 +108,7 @@ export declare class WeaviateStore extends VectorStore {
|
|
|
108
108
|
*
|
|
109
109
|
* @returns {Promise<Document[]>} - List of documents selected by maximal marginal relevance.
|
|
110
110
|
*/
|
|
111
|
-
maxMarginalRelevanceSearch(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks
|
|
111
|
+
maxMarginalRelevanceSearch(query: string, options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>, _callbacks?: undefined): Promise<Document[]>;
|
|
112
112
|
/**
|
|
113
113
|
* Static method to create a new `WeaviateStore` instance from a list of
|
|
114
114
|
* texts. It first creates documents from the texts and metadata, then
|
|
@@ -93,8 +93,9 @@ class XataVectorSearch extends base_js_1.VectorStore {
|
|
|
93
93
|
size: k,
|
|
94
94
|
filter,
|
|
95
95
|
});
|
|
96
|
+
return (
|
|
96
97
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
|
-
|
|
98
|
+
records?.map((record) => [
|
|
98
99
|
new document_js_1.Document({
|
|
99
100
|
pageContent: record.content,
|
|
100
101
|
metadata: Object.fromEntries(Object.entries(record).filter(([key]) => key !== "content" &&
|
|
@@ -103,7 +104,7 @@ class XataVectorSearch extends base_js_1.VectorStore {
|
|
|
103
104
|
key !== "id")),
|
|
104
105
|
}),
|
|
105
106
|
record.xata.score,
|
|
106
|
-
]);
|
|
107
|
+
]) ?? []);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
exports.XataVectorSearch = XataVectorSearch;
|
|
@@ -90,8 +90,9 @@ export class XataVectorSearch extends VectorStore {
|
|
|
90
90
|
size: k,
|
|
91
91
|
filter,
|
|
92
92
|
});
|
|
93
|
+
return (
|
|
93
94
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
|
-
|
|
95
|
+
records?.map((record) => [
|
|
95
96
|
new Document({
|
|
96
97
|
pageContent: record.content,
|
|
97
98
|
metadata: Object.fromEntries(Object.entries(record).filter(([key]) => key !== "content" &&
|
|
@@ -100,6 +101,6 @@ export class XataVectorSearch extends VectorStore {
|
|
|
100
101
|
key !== "id")),
|
|
101
102
|
}),
|
|
102
103
|
record.xata.score,
|
|
103
|
-
]);
|
|
104
|
+
]) ?? []);
|
|
104
105
|
}
|
|
105
106
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../dist/document_loaders/fs/chatgpt.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/document_loaders/fs/chatgpt.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../dist/document_loaders/fs/chatgpt.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/llms/gradient_ai.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/llms/gradient_ai.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/llms/gradient_ai.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/llms/watsonx_ai.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/llms/watsonx_ai.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/llms/watsonx_ai.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.199",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -82,6 +82,9 @@
|
|
|
82
82
|
"tools/google_calendar.cjs",
|
|
83
83
|
"tools/google_calendar.js",
|
|
84
84
|
"tools/google_calendar.d.ts",
|
|
85
|
+
"tools/google_places.cjs",
|
|
86
|
+
"tools/google_places.js",
|
|
87
|
+
"tools/google_places.d.ts",
|
|
85
88
|
"chains.cjs",
|
|
86
89
|
"chains.js",
|
|
87
90
|
"chains.d.ts",
|
|
@@ -187,6 +190,9 @@
|
|
|
187
190
|
"llms/replicate.cjs",
|
|
188
191
|
"llms/replicate.js",
|
|
189
192
|
"llms/replicate.d.ts",
|
|
193
|
+
"llms/fireworks.cjs",
|
|
194
|
+
"llms/fireworks.js",
|
|
195
|
+
"llms/fireworks.d.ts",
|
|
190
196
|
"llms/googlevertexai.cjs",
|
|
191
197
|
"llms/googlevertexai.js",
|
|
192
198
|
"llms/googlevertexai.d.ts",
|
|
@@ -196,12 +202,15 @@
|
|
|
196
202
|
"llms/googlepalm.cjs",
|
|
197
203
|
"llms/googlepalm.js",
|
|
198
204
|
"llms/googlepalm.d.ts",
|
|
199
|
-
"llms/
|
|
200
|
-
"llms/
|
|
201
|
-
"llms/
|
|
205
|
+
"llms/gradient_ai.cjs",
|
|
206
|
+
"llms/gradient_ai.js",
|
|
207
|
+
"llms/gradient_ai.d.ts",
|
|
202
208
|
"llms/sagemaker_endpoint.cjs",
|
|
203
209
|
"llms/sagemaker_endpoint.js",
|
|
204
210
|
"llms/sagemaker_endpoint.d.ts",
|
|
211
|
+
"llms/watsonx_ai.cjs",
|
|
212
|
+
"llms/watsonx_ai.js",
|
|
213
|
+
"llms/watsonx_ai.d.ts",
|
|
205
214
|
"llms/bedrock.cjs",
|
|
206
215
|
"llms/bedrock.js",
|
|
207
216
|
"llms/bedrock.d.ts",
|
|
@@ -442,6 +451,9 @@
|
|
|
442
451
|
"document_loaders/fs/buffer.cjs",
|
|
443
452
|
"document_loaders/fs/buffer.js",
|
|
444
453
|
"document_loaders/fs/buffer.d.ts",
|
|
454
|
+
"document_loaders/fs/chatgpt.cjs",
|
|
455
|
+
"document_loaders/fs/chatgpt.js",
|
|
456
|
+
"document_loaders/fs/chatgpt.d.ts",
|
|
445
457
|
"document_loaders/fs/text.cjs",
|
|
446
458
|
"document_loaders/fs/text.js",
|
|
447
459
|
"document_loaders/fs/text.d.ts",
|
|
@@ -834,8 +846,10 @@
|
|
|
834
846
|
"build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs",
|
|
835
847
|
"build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch",
|
|
836
848
|
"build:scripts": "node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js",
|
|
837
|
-
"lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src
|
|
838
|
-
"lint:
|
|
849
|
+
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src",
|
|
850
|
+
"lint:dpdm": "dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
851
|
+
"lint": "yarn lint:eslint && yarn lint:dpdm",
|
|
852
|
+
"lint:fix": "yarn lint:eslint --fix && yarn lint:dpdm",
|
|
839
853
|
"precommit": "lint-staged",
|
|
840
854
|
"clean": "rimraf dist/ && NODE_OPTIONS=--max-old-space-size=4096 node scripts/create-entrypoints.js pre",
|
|
841
855
|
"prepack": "yarn build",
|
|
@@ -872,6 +886,7 @@
|
|
|
872
886
|
"@gomomento/sdk-core": "^1.51.1",
|
|
873
887
|
"@google-ai/generativelanguage": "^0.2.1",
|
|
874
888
|
"@google-cloud/storage": "^6.10.1",
|
|
889
|
+
"@gradientai/nodejs-sdk": "^1.2.0",
|
|
875
890
|
"@huggingface/inference": "^2.6.4",
|
|
876
891
|
"@jest/globals": "^29.5.0",
|
|
877
892
|
"@mozilla/readability": "^0.4.4",
|
|
@@ -1013,6 +1028,7 @@
|
|
|
1013
1028
|
"@gomomento/sdk-web": "^1.51.1",
|
|
1014
1029
|
"@google-ai/generativelanguage": "^0.2.1",
|
|
1015
1030
|
"@google-cloud/storage": "^6.10.1",
|
|
1031
|
+
"@gradientai/nodejs-sdk": "^1.2.0",
|
|
1016
1032
|
"@huggingface/inference": "^2.6.4",
|
|
1017
1033
|
"@mozilla/readability": "*",
|
|
1018
1034
|
"@notionhq/client": "^2.2.10",
|
|
@@ -1155,6 +1171,9 @@
|
|
|
1155
1171
|
"@google-cloud/storage": {
|
|
1156
1172
|
"optional": true
|
|
1157
1173
|
},
|
|
1174
|
+
"@gradientai/nodejs-sdk": {
|
|
1175
|
+
"optional": true
|
|
1176
|
+
},
|
|
1158
1177
|
"@huggingface/inference": {
|
|
1159
1178
|
"optional": true
|
|
1160
1179
|
},
|
|
@@ -1398,7 +1417,7 @@
|
|
|
1398
1417
|
},
|
|
1399
1418
|
"dependencies": {
|
|
1400
1419
|
"@anthropic-ai/sdk": "^0.9.1",
|
|
1401
|
-
"@langchain/core": "~0.0.
|
|
1420
|
+
"@langchain/core": "~0.0.3",
|
|
1402
1421
|
"binary-extensions": "^2.2.0",
|
|
1403
1422
|
"expr-eval": "^2.0.2",
|
|
1404
1423
|
"flat": "^5.0.2",
|
|
@@ -1554,6 +1573,11 @@
|
|
|
1554
1573
|
"import": "./tools/google_calendar.js",
|
|
1555
1574
|
"require": "./tools/google_calendar.cjs"
|
|
1556
1575
|
},
|
|
1576
|
+
"./tools/google_places": {
|
|
1577
|
+
"types": "./tools/google_places.d.ts",
|
|
1578
|
+
"import": "./tools/google_places.js",
|
|
1579
|
+
"require": "./tools/google_places.cjs"
|
|
1580
|
+
},
|
|
1557
1581
|
"./chains": {
|
|
1558
1582
|
"types": "./chains.d.ts",
|
|
1559
1583
|
"import": "./chains.js",
|
|
@@ -1729,6 +1753,11 @@
|
|
|
1729
1753
|
"import": "./llms/replicate.js",
|
|
1730
1754
|
"require": "./llms/replicate.cjs"
|
|
1731
1755
|
},
|
|
1756
|
+
"./llms/fireworks": {
|
|
1757
|
+
"types": "./llms/fireworks.d.ts",
|
|
1758
|
+
"import": "./llms/fireworks.js",
|
|
1759
|
+
"require": "./llms/fireworks.cjs"
|
|
1760
|
+
},
|
|
1732
1761
|
"./llms/googlevertexai": {
|
|
1733
1762
|
"types": "./llms/googlevertexai.d.ts",
|
|
1734
1763
|
"import": "./llms/googlevertexai.js",
|
|
@@ -1744,16 +1773,21 @@
|
|
|
1744
1773
|
"import": "./llms/googlepalm.js",
|
|
1745
1774
|
"require": "./llms/googlepalm.cjs"
|
|
1746
1775
|
},
|
|
1747
|
-
"./llms/
|
|
1748
|
-
"types": "./llms/
|
|
1749
|
-
"import": "./llms/
|
|
1750
|
-
"require": "./llms/
|
|
1776
|
+
"./llms/gradient_ai": {
|
|
1777
|
+
"types": "./llms/gradient_ai.d.ts",
|
|
1778
|
+
"import": "./llms/gradient_ai.js",
|
|
1779
|
+
"require": "./llms/gradient_ai.cjs"
|
|
1751
1780
|
},
|
|
1752
1781
|
"./llms/sagemaker_endpoint": {
|
|
1753
1782
|
"types": "./llms/sagemaker_endpoint.d.ts",
|
|
1754
1783
|
"import": "./llms/sagemaker_endpoint.js",
|
|
1755
1784
|
"require": "./llms/sagemaker_endpoint.cjs"
|
|
1756
1785
|
},
|
|
1786
|
+
"./llms/watsonx_ai": {
|
|
1787
|
+
"types": "./llms/watsonx_ai.d.ts",
|
|
1788
|
+
"import": "./llms/watsonx_ai.js",
|
|
1789
|
+
"require": "./llms/watsonx_ai.cjs"
|
|
1790
|
+
},
|
|
1757
1791
|
"./llms/bedrock": {
|
|
1758
1792
|
"types": "./llms/bedrock.d.ts",
|
|
1759
1793
|
"import": "./llms/bedrock.js",
|
|
@@ -2154,6 +2188,11 @@
|
|
|
2154
2188
|
"import": "./document_loaders/fs/buffer.js",
|
|
2155
2189
|
"require": "./document_loaders/fs/buffer.cjs"
|
|
2156
2190
|
},
|
|
2191
|
+
"./document_loaders/fs/chatgpt": {
|
|
2192
|
+
"types": "./document_loaders/fs/chatgpt.d.ts",
|
|
2193
|
+
"import": "./document_loaders/fs/chatgpt.js",
|
|
2194
|
+
"require": "./document_loaders/fs/chatgpt.cjs"
|
|
2195
|
+
},
|
|
2157
2196
|
"./document_loaders/fs/text": {
|
|
2158
2197
|
"types": "./document_loaders/fs/text.d.ts",
|
|
2159
2198
|
"import": "./document_loaders/fs/text.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/tools/google_places.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/tools/google_places.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/tools/google_places.js'
|