langchain 0.0.176 → 0.0.177

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.
Files changed (52) hide show
  1. package/dist/chat_models/bedrock.cjs +25 -4
  2. package/dist/chat_models/bedrock.d.ts +2 -1
  3. package/dist/chat_models/bedrock.js +25 -4
  4. package/dist/chat_models/llama_cpp.cjs +31 -79
  5. package/dist/chat_models/llama_cpp.d.ts +15 -58
  6. package/dist/chat_models/llama_cpp.js +32 -80
  7. package/dist/chat_models/openai.cjs +91 -6
  8. package/dist/chat_models/openai.d.ts +10 -0
  9. package/dist/chat_models/openai.js +91 -6
  10. package/dist/embeddings/hf.cjs +10 -1
  11. package/dist/embeddings/hf.d.ts +4 -2
  12. package/dist/embeddings/hf.js +10 -1
  13. package/dist/embeddings/llama_cpp.cjs +67 -0
  14. package/dist/embeddings/llama_cpp.d.ts +26 -0
  15. package/dist/embeddings/llama_cpp.js +63 -0
  16. package/dist/embeddings/ollama.cjs +7 -1
  17. package/dist/embeddings/ollama.js +7 -1
  18. package/dist/llms/bedrock.cjs +25 -3
  19. package/dist/llms/bedrock.d.ts +2 -1
  20. package/dist/llms/bedrock.js +25 -3
  21. package/dist/llms/hf.cjs +10 -1
  22. package/dist/llms/hf.d.ts +3 -0
  23. package/dist/llms/hf.js +10 -1
  24. package/dist/llms/llama_cpp.cjs +25 -65
  25. package/dist/llms/llama_cpp.d.ts +7 -43
  26. package/dist/llms/llama_cpp.js +25 -65
  27. package/dist/load/import_constants.cjs +1 -0
  28. package/dist/load/import_constants.js +1 -0
  29. package/dist/prompts/few_shot.cjs +162 -1
  30. package/dist/prompts/few_shot.d.ts +90 -2
  31. package/dist/prompts/few_shot.js +160 -0
  32. package/dist/prompts/index.cjs +2 -1
  33. package/dist/prompts/index.d.ts +1 -1
  34. package/dist/prompts/index.js +1 -1
  35. package/dist/retrievers/zep.cjs +26 -3
  36. package/dist/retrievers/zep.d.ts +11 -2
  37. package/dist/retrievers/zep.js +26 -3
  38. package/dist/util/bedrock.d.ts +2 -0
  39. package/dist/util/llama_cpp.cjs +34 -0
  40. package/dist/util/llama_cpp.d.ts +46 -0
  41. package/dist/util/llama_cpp.js +28 -0
  42. package/dist/util/openai-format-fndef.cjs +81 -0
  43. package/dist/util/openai-format-fndef.d.ts +44 -0
  44. package/dist/util/openai-format-fndef.js +77 -0
  45. package/dist/util/openapi.d.ts +2 -2
  46. package/dist/vectorstores/pinecone.cjs +5 -5
  47. package/dist/vectorstores/pinecone.d.ts +2 -2
  48. package/dist/vectorstores/pinecone.js +5 -5
  49. package/embeddings/llama_cpp.cjs +1 -0
  50. package/embeddings/llama_cpp.d.ts +1 -0
  51. package/embeddings/llama_cpp.js +1 -0
  52. package/package.json +13 -5
@@ -44,6 +44,12 @@ export class ZepRetriever extends BaseRetriever {
44
44
  writable: true,
45
45
  value: void 0
46
46
  });
47
+ Object.defineProperty(this, "searchScope", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: void 0
52
+ });
47
53
  Object.defineProperty(this, "searchType", {
48
54
  enumerable: true,
49
55
  configurable: true,
@@ -64,17 +70,18 @@ export class ZepRetriever extends BaseRetriever {
64
70
  });
65
71
  this.sessionId = config.sessionId;
66
72
  this.topK = config.topK;
73
+ this.searchScope = config.searchScope;
67
74
  this.searchType = config.searchType;
68
75
  this.mmrLambda = config.mmrLambda;
69
76
  this.filter = config.filter;
70
77
  this.zepClientPromise = ZepClient.init(config.url, config.apiKey);
71
78
  }
72
79
  /**
73
- * Converts an array of search results to an array of Document objects.
80
+ * Converts an array of message search results to an array of Document objects.
74
81
  * @param {MemorySearchResult[]} results - The array of search results.
75
82
  * @returns {Document[]} An array of Document objects representing the search results.
76
83
  */
77
- searchResultToDoc(results) {
84
+ searchMessageResultToDoc(results) {
78
85
  return results
79
86
  .filter((r) => r.message)
80
87
  .map(({ message: { content, metadata: messageMetadata } = {}, dist, ...rest }) => new Document({
@@ -82,6 +89,19 @@ export class ZepRetriever extends BaseRetriever {
82
89
  metadata: { score: dist, ...messageMetadata, ...rest },
83
90
  }));
84
91
  }
92
+ /**
93
+ * Converts an array of summary search results to an array of Document objects.
94
+ * @param {MemorySearchResult[]} results - The array of search results.
95
+ * @returns {Document[]} An array of Document objects representing the search results.
96
+ */
97
+ searchSummaryResultToDoc(results) {
98
+ return results
99
+ .filter((r) => r.summary)
100
+ .map(({ summary: { content, metadata: summaryMetadata } = {}, dist, ...rest }) => new Document({
101
+ pageContent: content ?? "",
102
+ metadata: { score: dist, ...summaryMetadata, ...rest },
103
+ }));
104
+ }
85
105
  /**
86
106
  * Retrieves the relevant documents based on the given query.
87
107
  * @param {string} query - The query string.
@@ -91,6 +111,7 @@ export class ZepRetriever extends BaseRetriever {
91
111
  const payload = {
92
112
  text: query,
93
113
  metadata: this.filter,
114
+ search_scope: this.searchScope,
94
115
  search_type: this.searchType,
95
116
  mmr_lambda: this.mmrLambda,
96
117
  };
@@ -101,7 +122,9 @@ export class ZepRetriever extends BaseRetriever {
101
122
  }
102
123
  try {
103
124
  const results = await zepClient.memory.searchMemory(this.sessionId, payload, this.topK);
104
- return this.searchResultToDoc(results);
125
+ return this.searchScope === "summary"
126
+ ? this.searchSummaryResultToDoc(results)
127
+ : this.searchMessageResultToDoc(results);
105
128
  }
106
129
  catch (error) {
107
130
  // eslint-disable-next-line no-instanceof/no-instanceof
@@ -33,6 +33,8 @@ export interface BaseBedrockInput {
33
33
  stopSequences?: string[];
34
34
  /** Additional kwargs to pass to the model. */
35
35
  modelKwargs?: Record<string, unknown>;
36
+ /** Whether or not to stream responses */
37
+ streaming: boolean;
36
38
  }
37
39
  type Dict = {
38
40
  [key: string]: unknown;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLlamaSession = exports.createLlamaContext = exports.createLlamaModel = void 0;
4
+ const node_llama_cpp_1 = require("node-llama-cpp");
5
+ function createLlamaModel(inputs) {
6
+ const options = {
7
+ gpuLayers: inputs?.gpuLayers,
8
+ modelPath: inputs.modelPath,
9
+ useMlock: inputs?.useMlock,
10
+ useMmap: inputs?.useMmap,
11
+ vocabOnly: inputs?.vocabOnly,
12
+ };
13
+ return new node_llama_cpp_1.LlamaModel(options);
14
+ }
15
+ exports.createLlamaModel = createLlamaModel;
16
+ function createLlamaContext(model, inputs) {
17
+ const options = {
18
+ batchSize: inputs?.batchSize,
19
+ contextSize: inputs?.contextSize,
20
+ embedding: inputs?.embedding,
21
+ f16Kv: inputs?.f16Kv,
22
+ logitsAll: inputs?.logitsAll,
23
+ model,
24
+ prependBos: inputs?.prependBos,
25
+ seed: inputs?.seed,
26
+ threads: inputs?.threads,
27
+ };
28
+ return new node_llama_cpp_1.LlamaContext(options);
29
+ }
30
+ exports.createLlamaContext = createLlamaContext;
31
+ function createLlamaSession(context) {
32
+ return new node_llama_cpp_1.LlamaChatSession({ context });
33
+ }
34
+ exports.createLlamaSession = createLlamaSession;
@@ -0,0 +1,46 @@
1
+ import { LlamaModel, LlamaContext, LlamaChatSession } from "node-llama-cpp";
2
+ /**
3
+ * Note that the modelPath is the only required parameter. For testing you
4
+ * can set this in the environment variable `LLAMA_PATH`.
5
+ */
6
+ export interface LlamaBaseCppInputs {
7
+ /** Prompt processing batch size. */
8
+ batchSize?: number;
9
+ /** Text context size. */
10
+ contextSize?: number;
11
+ /** Embedding mode only. */
12
+ embedding?: boolean;
13
+ /** Use fp16 for KV cache. */
14
+ f16Kv?: boolean;
15
+ /** Number of layers to store in VRAM. */
16
+ gpuLayers?: number;
17
+ /** The llama_eval() call computes all logits, not just the last one. */
18
+ logitsAll?: boolean;
19
+ /** */
20
+ maxTokens?: number;
21
+ /** Path to the model on the filesystem. */
22
+ modelPath: string;
23
+ /** Add the begining of sentence token. */
24
+ prependBos?: boolean;
25
+ /** If null, a random seed will be used. */
26
+ seed?: null | number;
27
+ /** The randomness of the responses, e.g. 0.1 deterministic, 1.5 creative, 0.8 balanced, 0 disables. */
28
+ temperature?: number;
29
+ /** Number of threads to use to evaluate tokens. */
30
+ threads?: number;
31
+ /** Trim whitespace from the end of the generated text Disabled by default. */
32
+ trimWhitespaceSuffix?: boolean;
33
+ /** Consider the n most likely tokens, where n is 1 to vocabulary size, 0 disables (uses full vocabulary). Note: only applies when `temperature` > 0. */
34
+ topK?: number;
35
+ /** Selects the smallest token set whose probability exceeds P, where P is between 0 - 1, 1 disables. Note: only applies when `temperature` > 0. */
36
+ topP?: number;
37
+ /** Force system to keep model in RAM. */
38
+ useMlock?: boolean;
39
+ /** Use mmap if possible. */
40
+ useMmap?: boolean;
41
+ /** Only load the vocabulary, no weights. */
42
+ vocabOnly?: boolean;
43
+ }
44
+ export declare function createLlamaModel(inputs: LlamaBaseCppInputs): LlamaModel;
45
+ export declare function createLlamaContext(model: LlamaModel, inputs: LlamaBaseCppInputs): LlamaContext;
46
+ export declare function createLlamaSession(context: LlamaContext): LlamaChatSession;
@@ -0,0 +1,28 @@
1
+ import { LlamaModel, LlamaContext, LlamaChatSession } from "node-llama-cpp";
2
+ export function createLlamaModel(inputs) {
3
+ const options = {
4
+ gpuLayers: inputs?.gpuLayers,
5
+ modelPath: inputs.modelPath,
6
+ useMlock: inputs?.useMlock,
7
+ useMmap: inputs?.useMmap,
8
+ vocabOnly: inputs?.vocabOnly,
9
+ };
10
+ return new LlamaModel(options);
11
+ }
12
+ export function createLlamaContext(model, inputs) {
13
+ const options = {
14
+ batchSize: inputs?.batchSize,
15
+ contextSize: inputs?.contextSize,
16
+ embedding: inputs?.embedding,
17
+ f16Kv: inputs?.f16Kv,
18
+ logitsAll: inputs?.logitsAll,
19
+ model,
20
+ prependBos: inputs?.prependBos,
21
+ seed: inputs?.seed,
22
+ threads: inputs?.threads,
23
+ };
24
+ return new LlamaContext(options);
25
+ }
26
+ export function createLlamaSession(context) {
27
+ return new LlamaChatSession({ context });
28
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatFunctionDefinitions = void 0;
4
+ function isAnyOfProp(prop) {
5
+ return (prop.anyOf !== undefined &&
6
+ Array.isArray(prop.anyOf));
7
+ }
8
+ // When OpenAI use functions in the prompt, they format them as TypeScript definitions rather than OpenAPI JSON schemas.
9
+ // This function converts the JSON schemas into TypeScript definitions.
10
+ function formatFunctionDefinitions(functions) {
11
+ const lines = ["namespace functions {", ""];
12
+ for (const f of functions) {
13
+ if (f.description) {
14
+ lines.push(`// ${f.description}`);
15
+ }
16
+ if (Object.keys(f.parameters.properties ?? {}).length > 0) {
17
+ lines.push(`type ${f.name} = (_: {`);
18
+ lines.push(formatObjectProperties(f.parameters, 0));
19
+ lines.push("}) => any;");
20
+ }
21
+ else {
22
+ lines.push(`type ${f.name} = () => any;`);
23
+ }
24
+ lines.push("");
25
+ }
26
+ lines.push("} // namespace functions");
27
+ return lines.join("\n");
28
+ }
29
+ exports.formatFunctionDefinitions = formatFunctionDefinitions;
30
+ // Format just the properties of an object (not including the surrounding braces)
31
+ function formatObjectProperties(obj, indent) {
32
+ const lines = [];
33
+ for (const [name, param] of Object.entries(obj.properties ?? {})) {
34
+ if (param.description && indent < 2) {
35
+ lines.push(`// ${param.description}`);
36
+ }
37
+ if (obj.required?.includes(name)) {
38
+ lines.push(`${name}: ${formatType(param, indent)},`);
39
+ }
40
+ else {
41
+ lines.push(`${name}?: ${formatType(param, indent)},`);
42
+ }
43
+ }
44
+ return lines.map((line) => " ".repeat(indent) + line).join("\n");
45
+ }
46
+ // Format a single property type
47
+ function formatType(param, indent) {
48
+ if (isAnyOfProp(param)) {
49
+ return param.anyOf.map((v) => formatType(v, indent)).join(" | ");
50
+ }
51
+ switch (param.type) {
52
+ case "string":
53
+ if (param.enum) {
54
+ return param.enum.map((v) => `"${v}"`).join(" | ");
55
+ }
56
+ return "string";
57
+ case "number":
58
+ if (param.enum) {
59
+ return param.enum.map((v) => `${v}`).join(" | ");
60
+ }
61
+ return "number";
62
+ case "integer":
63
+ if (param.enum) {
64
+ return param.enum.map((v) => `${v}`).join(" | ");
65
+ }
66
+ return "number";
67
+ case "boolean":
68
+ return "boolean";
69
+ case "null":
70
+ return "null";
71
+ case "object":
72
+ return ["{", formatObjectProperties(param, indent + 2), "}"].join("\n");
73
+ case "array":
74
+ if (param.items) {
75
+ return `${formatType(param.items, indent)}[]`;
76
+ }
77
+ return "any[]";
78
+ default:
79
+ return "";
80
+ }
81
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Formatting function definitions for calculating openai function defination token usage.
3
+ *
4
+ * https://github.com/hmarr/openai-chat-tokens/blob/main/src/functions.ts
5
+ * (c) 2023 Harry Marr
6
+ * MIT license
7
+ */
8
+ import OpenAI from "openai";
9
+ type OpenAIFunction = OpenAI.Chat.ChatCompletionCreateParams.Function;
10
+ export interface FunctionDef extends Omit<OpenAIFunction, "parameters"> {
11
+ name: string;
12
+ description?: string;
13
+ parameters: ObjectProp;
14
+ }
15
+ interface ObjectProp {
16
+ type: "object";
17
+ properties?: {
18
+ [key: string]: Prop;
19
+ };
20
+ required?: string[];
21
+ }
22
+ interface AnyOfProp {
23
+ anyOf: Prop[];
24
+ }
25
+ type Prop = {
26
+ description?: string;
27
+ } & (AnyOfProp | ObjectProp | {
28
+ type: "string";
29
+ enum?: string[];
30
+ } | {
31
+ type: "number" | "integer";
32
+ minimum?: number;
33
+ maximum?: number;
34
+ enum?: number[];
35
+ } | {
36
+ type: "boolean";
37
+ } | {
38
+ type: "null";
39
+ } | {
40
+ type: "array";
41
+ items?: Prop;
42
+ });
43
+ export declare function formatFunctionDefinitions(functions: FunctionDef[]): string;
44
+ export {};
@@ -0,0 +1,77 @@
1
+ function isAnyOfProp(prop) {
2
+ return (prop.anyOf !== undefined &&
3
+ Array.isArray(prop.anyOf));
4
+ }
5
+ // When OpenAI use functions in the prompt, they format them as TypeScript definitions rather than OpenAPI JSON schemas.
6
+ // This function converts the JSON schemas into TypeScript definitions.
7
+ export function formatFunctionDefinitions(functions) {
8
+ const lines = ["namespace functions {", ""];
9
+ for (const f of functions) {
10
+ if (f.description) {
11
+ lines.push(`// ${f.description}`);
12
+ }
13
+ if (Object.keys(f.parameters.properties ?? {}).length > 0) {
14
+ lines.push(`type ${f.name} = (_: {`);
15
+ lines.push(formatObjectProperties(f.parameters, 0));
16
+ lines.push("}) => any;");
17
+ }
18
+ else {
19
+ lines.push(`type ${f.name} = () => any;`);
20
+ }
21
+ lines.push("");
22
+ }
23
+ lines.push("} // namespace functions");
24
+ return lines.join("\n");
25
+ }
26
+ // Format just the properties of an object (not including the surrounding braces)
27
+ function formatObjectProperties(obj, indent) {
28
+ const lines = [];
29
+ for (const [name, param] of Object.entries(obj.properties ?? {})) {
30
+ if (param.description && indent < 2) {
31
+ lines.push(`// ${param.description}`);
32
+ }
33
+ if (obj.required?.includes(name)) {
34
+ lines.push(`${name}: ${formatType(param, indent)},`);
35
+ }
36
+ else {
37
+ lines.push(`${name}?: ${formatType(param, indent)},`);
38
+ }
39
+ }
40
+ return lines.map((line) => " ".repeat(indent) + line).join("\n");
41
+ }
42
+ // Format a single property type
43
+ function formatType(param, indent) {
44
+ if (isAnyOfProp(param)) {
45
+ return param.anyOf.map((v) => formatType(v, indent)).join(" | ");
46
+ }
47
+ switch (param.type) {
48
+ case "string":
49
+ if (param.enum) {
50
+ return param.enum.map((v) => `"${v}"`).join(" | ");
51
+ }
52
+ return "string";
53
+ case "number":
54
+ if (param.enum) {
55
+ return param.enum.map((v) => `${v}`).join(" | ");
56
+ }
57
+ return "number";
58
+ case "integer":
59
+ if (param.enum) {
60
+ return param.enum.map((v) => `${v}`).join(" | ");
61
+ }
62
+ return "number";
63
+ case "boolean":
64
+ return "boolean";
65
+ case "null":
66
+ return "null";
67
+ case "object":
68
+ return ["{", formatObjectProperties(param, indent + 2), "}"].join("\n");
69
+ case "array":
70
+ if (param.items) {
71
+ return `${formatType(param.items, indent)}[]`;
72
+ }
73
+ return "any[]";
74
+ default:
75
+ return "";
76
+ }
77
+ }
@@ -7,7 +7,7 @@ export declare class OpenAPISpec {
7
7
  getParametersStrict(): Record<string, OpenAPIV3.ParameterObject | OpenAPIV3_1.ReferenceObject>;
8
8
  getSchemasStrict(): Record<string, OpenAPIV3_1.SchemaObject>;
9
9
  getRequestBodiesStrict(): Record<string, OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.RequestBodyObject>;
10
- getPathStrict(path: string): Omit<OpenAPIV3.PathItemObject<{}>, "servers" | "parameters"> & {
10
+ getPathStrict(path: string): Omit<OpenAPIV3.PathItemObject<{}>, "parameters" | "servers"> & {
11
11
  servers?: OpenAPIV3_1.ServerObject[] | undefined;
12
12
  parameters?: (OpenAPIV3.ParameterObject | OpenAPIV3_1.ReferenceObject)[] | undefined;
13
13
  } & {
@@ -59,7 +59,7 @@ export declare class OpenAPISpec {
59
59
  deprecated?: boolean | undefined;
60
60
  security?: OpenAPIV3.SecurityRequirementObject[] | undefined;
61
61
  servers?: OpenAPIV3.ServerObject[] | undefined;
62
- }, "callbacks" | "servers" | "parameters" | "responses" | "requestBody"> & {
62
+ }, "callbacks" | "parameters" | "servers" | "responses" | "requestBody"> & {
63
63
  parameters?: (OpenAPIV3.ParameterObject | OpenAPIV3_1.ReferenceObject)[] | undefined;
64
64
  requestBody?: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.RequestBodyObject | undefined;
65
65
  responses?: OpenAPIV3_1.ResponsesObject | undefined;
@@ -34,6 +34,7 @@ const base_js_1 = require("./base.cjs");
34
34
  const document_js_1 = require("../document.cjs");
35
35
  const async_caller_js_1 = require("../util/async_caller.cjs");
36
36
  const math_js_1 = require("../util/math.cjs");
37
+ const chunk_js_1 = require("../util/chunk.cjs");
37
38
  /**
38
39
  * Class that extends the VectorStore class and provides methods to
39
40
  * interact with the Pinecone vector database.
@@ -138,11 +139,10 @@ class PineconeStore extends base_js_1.VectorStore {
138
139
  });
139
140
  const namespace = this.pineconeIndex.namespace(this.namespace ?? "");
140
141
  // Pinecone recommends a limit of 100 vectors per upsert request
141
- const chunkSize = 50;
142
- for (let i = 0; i < pineconeVectors.length; i += chunkSize) {
143
- const chunk = pineconeVectors.slice(i, i + chunkSize);
144
- await namespace.upsert(chunk);
145
- }
142
+ const chunkSize = 100;
143
+ const chunkedVectors = (0, chunk_js_1.chunkArray)(pineconeVectors, chunkSize);
144
+ const batchRequests = chunkedVectors.map((chunk) => this.caller.call(async () => namespace.upsert(chunk)));
145
+ await Promise.all(batchRequests);
146
146
  return documentIds;
147
147
  }
148
148
  /**
@@ -2,9 +2,9 @@ import { RecordMetadata, Index as PineconeIndex } from "@pinecone-database/pinec
2
2
  import { MaxMarginalRelevanceSearchOptions, VectorStore } from "./base.js";
3
3
  import { Embeddings } from "../embeddings/base.js";
4
4
  import { Document } from "../document.js";
5
- import { AsyncCaller } from "../util/async_caller.js";
5
+ import { AsyncCaller, AsyncCallerParams } from "../util/async_caller.js";
6
6
  type PineconeMetadata = Record<string, any>;
7
- export interface PineconeLibArgs {
7
+ export interface PineconeLibArgs extends AsyncCallerParams {
8
8
  pineconeIndex: PineconeIndex;
9
9
  textKey?: string;
10
10
  namespace?: string;
@@ -5,6 +5,7 @@ import { VectorStore } from "./base.js";
5
5
  import { Document } from "../document.js";
6
6
  import { AsyncCaller } from "../util/async_caller.js";
7
7
  import { maximalMarginalRelevance } from "../util/math.js";
8
+ import { chunkArray } from "../util/chunk.js";
8
9
  /**
9
10
  * Class that extends the VectorStore class and provides methods to
10
11
  * interact with the Pinecone vector database.
@@ -109,11 +110,10 @@ export class PineconeStore extends VectorStore {
109
110
  });
110
111
  const namespace = this.pineconeIndex.namespace(this.namespace ?? "");
111
112
  // Pinecone recommends a limit of 100 vectors per upsert request
112
- const chunkSize = 50;
113
- for (let i = 0; i < pineconeVectors.length; i += chunkSize) {
114
- const chunk = pineconeVectors.slice(i, i + chunkSize);
115
- await namespace.upsert(chunk);
116
- }
113
+ const chunkSize = 100;
114
+ const chunkedVectors = chunkArray(pineconeVectors, chunkSize);
115
+ const batchRequests = chunkedVectors.map((chunk) => this.caller.call(async () => namespace.upsert(chunk)));
116
+ await Promise.all(batchRequests);
117
117
  return documentIds;
118
118
  }
119
119
  /**
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/embeddings/llama_cpp.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/embeddings/llama_cpp.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/embeddings/llama_cpp.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.176",
3
+ "version": "0.0.177",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -142,6 +142,9 @@
142
142
  "embeddings/minimax.cjs",
143
143
  "embeddings/minimax.js",
144
144
  "embeddings/minimax.d.ts",
145
+ "embeddings/llama_cpp.cjs",
146
+ "embeddings/llama_cpp.js",
147
+ "embeddings/llama_cpp.d.ts",
145
148
  "llms/load.cjs",
146
149
  "llms/load.js",
147
150
  "llms/load.d.ts",
@@ -806,12 +809,12 @@
806
809
  "@elastic/elasticsearch": "^8.4.0",
807
810
  "@faker-js/faker": "^7.6.0",
808
811
  "@getmetal/metal-sdk": "^4.0.0",
809
- "@getzep/zep-js": "^0.8.0",
812
+ "@getzep/zep-js": "^0.9.0",
810
813
  "@gomomento/sdk": "^1.44.1",
811
814
  "@gomomento/sdk-core": "^1.44.1",
812
815
  "@google-ai/generativelanguage": "^0.2.1",
813
816
  "@google-cloud/storage": "^6.10.1",
814
- "@huggingface/inference": "^1.5.1",
817
+ "@huggingface/inference": "^2.6.4",
815
818
  "@jest/globals": "^29.5.0",
816
819
  "@mozilla/readability": "^0.4.4",
817
820
  "@notionhq/client": "^2.2.10",
@@ -942,13 +945,13 @@
942
945
  "@cloudflare/ai": "^1.0.12",
943
946
  "@elastic/elasticsearch": "^8.4.0",
944
947
  "@getmetal/metal-sdk": "*",
945
- "@getzep/zep-js": "^0.8.0",
948
+ "@getzep/zep-js": "^0.9.0",
946
949
  "@gomomento/sdk": "^1.44.1",
947
950
  "@gomomento/sdk-core": "^1.44.1",
948
951
  "@gomomento/sdk-web": "^1.44.1",
949
952
  "@google-ai/generativelanguage": "^0.2.1",
950
953
  "@google-cloud/storage": "^6.10.1",
951
- "@huggingface/inference": "^1.5.1",
954
+ "@huggingface/inference": "^2.6.4",
952
955
  "@mozilla/readability": "*",
953
956
  "@notionhq/client": "^2.2.10",
954
957
  "@opensearch-project/opensearch": "*",
@@ -1577,6 +1580,11 @@
1577
1580
  "import": "./embeddings/minimax.js",
1578
1581
  "require": "./embeddings/minimax.cjs"
1579
1582
  },
1583
+ "./embeddings/llama_cpp": {
1584
+ "types": "./embeddings/llama_cpp.d.ts",
1585
+ "import": "./embeddings/llama_cpp.js",
1586
+ "require": "./embeddings/llama_cpp.cjs"
1587
+ },
1580
1588
  "./llms/load": {
1581
1589
  "types": "./llms/load.d.ts",
1582
1590
  "import": "./llms/load.js",