langchain 1.2.3 → 1.2.5

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 (62) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/agents/ReactAgent.cjs +3 -2
  3. package/dist/agents/ReactAgent.cjs.map +1 -1
  4. package/dist/agents/ReactAgent.js +3 -2
  5. package/dist/agents/ReactAgent.js.map +1 -1
  6. package/dist/agents/middleware/contextEditing.d.cts.map +1 -1
  7. package/dist/agents/middleware/contextEditing.d.ts.map +1 -1
  8. package/dist/agents/middleware/dynamicSystemPrompt.d.cts.map +1 -1
  9. package/dist/agents/middleware/dynamicSystemPrompt.d.ts.map +1 -1
  10. package/dist/agents/middleware/hitl.d.cts.map +1 -1
  11. package/dist/agents/middleware/llmToolSelector.d.ts +4 -4
  12. package/dist/agents/middleware/llmToolSelector.d.ts.map +1 -1
  13. package/dist/agents/middleware/modelCallLimit.d.cts.map +1 -1
  14. package/dist/agents/middleware/summarization.cjs +64 -2
  15. package/dist/agents/middleware/summarization.cjs.map +1 -1
  16. package/dist/agents/middleware/summarization.d.cts.map +1 -1
  17. package/dist/agents/middleware/summarization.d.ts +7 -7
  18. package/dist/agents/middleware/summarization.d.ts.map +1 -1
  19. package/dist/agents/middleware/summarization.js +65 -3
  20. package/dist/agents/middleware/summarization.js.map +1 -1
  21. package/dist/agents/middleware/todoListMiddleware.d.cts.map +1 -1
  22. package/dist/agents/middleware/toolCallLimit.d.cts.map +1 -1
  23. package/dist/agents/middleware/types.d.cts.map +1 -1
  24. package/dist/agents/responses.cjs +16 -6
  25. package/dist/agents/responses.cjs.map +1 -1
  26. package/dist/agents/responses.d.cts.map +1 -1
  27. package/dist/agents/responses.js +16 -6
  28. package/dist/agents/responses.js.map +1 -1
  29. package/dist/agents/runtime.d.cts +1 -1
  30. package/dist/agents/runtime.d.cts.map +1 -1
  31. package/dist/agents/runtime.d.ts +1 -1
  32. package/dist/agents/runtime.d.ts.map +1 -1
  33. package/dist/agents/types.d.cts.map +1 -1
  34. package/dist/chat_models/universal.cjs +3 -2
  35. package/dist/chat_models/universal.cjs.map +1 -1
  36. package/dist/chat_models/universal.js +3 -2
  37. package/dist/chat_models/universal.js.map +1 -1
  38. package/dist/hub/index.cjs +8 -1
  39. package/dist/hub/index.cjs.map +1 -1
  40. package/dist/hub/index.d.cts +9 -0
  41. package/dist/hub/index.d.cts.map +1 -1
  42. package/dist/hub/index.d.ts +9 -0
  43. package/dist/hub/index.d.ts.map +1 -1
  44. package/dist/hub/index.js +8 -1
  45. package/dist/hub/index.js.map +1 -1
  46. package/dist/hub/node.cjs +8 -1
  47. package/dist/hub/node.cjs.map +1 -1
  48. package/dist/hub/node.d.cts +9 -0
  49. package/dist/hub/node.d.cts.map +1 -1
  50. package/dist/hub/node.d.ts +9 -0
  51. package/dist/hub/node.d.ts.map +1 -1
  52. package/dist/hub/node.js +8 -1
  53. package/dist/hub/node.js.map +1 -1
  54. package/dist/load/index.cjs +5 -2
  55. package/dist/load/index.cjs.map +1 -1
  56. package/dist/load/index.d.cts +3 -1
  57. package/dist/load/index.d.cts.map +1 -1
  58. package/dist/load/index.d.ts +3 -1
  59. package/dist/load/index.d.ts.map +1 -1
  60. package/dist/load/index.js +5 -2
  61. package/dist/load/index.js.map +1 -1
  62. package/package.json +5 -5
@@ -18,6 +18,13 @@ import { Runnable } from "@langchain/core/runnables";
18
18
  * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,
19
19
  * you may instead import this function from "langchain/hub/node" and pass "includeModel: true" instead
20
20
  * of specifying this parameter.
21
+ * @param options.secrets A map of secrets to use when loading, e.g.
22
+ * {'OPENAI_API_KEY': 'sk-...'}`.
23
+ * If a secret is not found in the map, it will be loaded from the
24
+ * environment if `secrets_from_env` is `True`. Should only be needed when
25
+ * `includeModel` is `true`.
26
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
27
+ * Use with caution and only with trusted prompts.
21
28
  * @returns
22
29
  */
23
30
  declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
@@ -25,6 +32,8 @@ declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
25
32
  apiUrl?: string;
26
33
  includeModel?: boolean;
27
34
  modelClass?: new (...args: any[]) => BaseLanguageModel;
35
+ secrets?: Record<string, string>;
36
+ secretsFromEnv?: boolean;
28
37
  }): Promise<T>;
29
38
  //#endregion
30
39
  export { pull, basePush as push };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;AAoBA;;;;;AAKW;;;;;;;;;;iBALaI,eAAeJ;;;;uCAIEC;IACrCK,QAAQD"}
1
+ {"version":3,"file":"index.d.cts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Record","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;AA2BA;;;;;;AAOW;;;;;;;;;;;;;;;;iBAPaI,eAAeJ;;;;uCAIEC;YAC3BK;;IAEVC,QAAQF"}
@@ -18,6 +18,13 @@ import { BaseLanguageModel } from "@langchain/core/language_models/base";
18
18
  * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,
19
19
  * you may instead import this function from "langchain/hub/node" and pass "includeModel: true" instead
20
20
  * of specifying this parameter.
21
+ * @param options.secrets A map of secrets to use when loading, e.g.
22
+ * {'OPENAI_API_KEY': 'sk-...'}`.
23
+ * If a secret is not found in the map, it will be loaded from the
24
+ * environment if `secrets_from_env` is `True`. Should only be needed when
25
+ * `includeModel` is `true`.
26
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
27
+ * Use with caution and only with trusted prompts.
21
28
  * @returns
22
29
  */
23
30
  declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
@@ -25,6 +32,8 @@ declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
25
32
  apiUrl?: string;
26
33
  includeModel?: boolean;
27
34
  modelClass?: new (...args: any[]) => BaseLanguageModel;
35
+ secrets?: Record<string, string>;
36
+ secretsFromEnv?: boolean;
28
37
  }): Promise<T>;
29
38
  //#endregion
30
39
  export { pull, basePush as push };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;AAoBA;;;;;AAKW;;;;;;;;;;iBALaI,eAAeJ;;;;uCAIEC;IACrCK,QAAQD"}
1
+ {"version":3,"file":"index.d.ts","names":["Runnable","BaseLanguageModel","basePush","push","pull","T","Record","Promise"],"sources":["../../src/hub/index.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { basePush } from \"./base.js\";\nexport { basePush as push };\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;AA2BA;;;;;;AAOW;;;;;;;;;;;;;;;;iBAPaI,eAAeJ;;;;uCAIEC;YAC3BK;;IAEVC,QAAQF"}
package/dist/hub/index.js CHANGED
@@ -16,12 +16,19 @@ import { basePull, basePush, bindOutputSchema, generateModelImportMap, generateO
16
16
  * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,
17
17
  * you may instead import this function from "langchain/hub/node" and pass "includeModel: true" instead
18
18
  * of specifying this parameter.
19
+ * @param options.secrets A map of secrets to use when loading, e.g.
20
+ * {'OPENAI_API_KEY': 'sk-...'}`.
21
+ * If a secret is not found in the map, it will be loaded from the
22
+ * environment if `secrets_from_env` is `True`. Should only be needed when
23
+ * `includeModel` is `true`.
24
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
25
+ * Use with caution and only with trusted prompts.
19
26
  * @returns
20
27
  */
21
28
  async function pull(ownerRepoCommit, options) {
22
29
  const promptObject = await basePull(ownerRepoCommit, options);
23
30
  try {
24
- const loadedPrompt = await load(JSON.stringify(promptObject.manifest), void 0, generateOptionalImportMap(options?.modelClass), generateModelImportMap(options?.modelClass));
31
+ const loadedPrompt = await load(JSON.stringify(promptObject.manifest), options?.secrets, generateOptionalImportMap(options?.modelClass), generateModelImportMap(options?.modelClass), options?.secretsFromEnv);
25
32
  return bindOutputSchema(loadedPrompt);
26
33
  } catch (e) {
27
34
  if (options?.includeModel) throw new Error([
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n }","e: any"],"sources":["../../src/hub/index.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { load } from \"../load/index.js\";\nimport {\n basePush,\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\n\nexport { basePush as push };\n\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n try {\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n undefined,\n generateOptionalImportMap(options?.modelClass),\n generateModelImportMap(options?.modelClass)\n );\n return bindOutputSchema(loadedPrompt);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n if (options?.includeModel) {\n throw new Error(\n [\n e.message,\n \"\",\n `To load prompts with an associated non-OpenAI model, you must use the \"langchain/hub/node\" entrypoint, or pass a \"modelClass\" parameter like this:`,\n \"\",\n \"```\",\n `import { pull } from \"langchain/hub\";`,\n `import { ChatAnthropic } from \"@langchain/anthropic\";`,\n \"\",\n `const prompt = await pull(\"my-prompt\", {`,\n ` includeModel: true,`,\n ` modelClass: ChatAnthropic,`,\n `});`,\n \"```\",\n ].join(\"\\n\")\n );\n } else {\n throw e;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,eAAsB,KACpBA,iBACAC,SAOA;CACA,MAAM,eAAe,MAAM,SAAS,iBAAiB,QAAQ;AAC7D,KAAI;EACF,MAAM,eAAe,MAAM,KACzB,KAAK,UAAU,aAAa,SAAS,EACrC,QACA,0BAA0B,SAAS,WAAW,EAC9C,uBAAuB,SAAS,WAAW,CAC5C;AACD,SAAO,iBAAiB,aAAa;CAEtC,SAAQC,GAAQ;AACf,MAAI,SAAS,aACX,OAAM,IAAI,MACR;GACE,EAAE;GACF;GACA,CAAC,kJAAkJ,CAAC;GACpJ;GACA;GACA,CAAC,qCAAqC,CAAC;GACvC,CAAC,qDAAqD,CAAC;GACvD;GACA,CAAC,wCAAwC,CAAC;GAC1C,CAAC,qBAAqB,CAAC;GACvB,CAAC,4BAA4B,CAAC;GAC9B,CAAC,GAAG,CAAC;GACL;EACD,EAAC,KAAK,KAAK;MAGd,OAAM;CAET;AACF"}
1
+ {"version":3,"file":"index.js","names":["ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }","e: any"],"sources":["../../src/hub/index.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport type { BaseLanguageModel } from \"@langchain/core/language_models/base\";\nimport { load } from \"../load/index.js\";\nimport {\n basePush,\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\n\nexport { basePush as push };\n\n/**\n * Pull a prompt from the hub.\n *\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. For non-OpenAI models, you must also set \"modelClass\" to the\n * correct class of the model.\n * @param options.modelClass If includeModel is true, the class of the model to instantiate. Required\n * for non-OpenAI models. If you are running in Node or another environment that supports dynamic imports,\n * you may instead import this function from \"langchain/hub/node\" and pass \"includeModel: true\" instead\n * of specifying this parameter.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modelClass?: new (...args: any[]) => BaseLanguageModel;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n try {\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n options?.secrets,\n generateOptionalImportMap(options?.modelClass),\n generateModelImportMap(options?.modelClass),\n options?.secretsFromEnv\n );\n return bindOutputSchema(loadedPrompt);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (e: any) {\n if (options?.includeModel) {\n throw new Error(\n [\n e.message,\n \"\",\n `To load prompts with an associated non-OpenAI model, you must use the \"langchain/hub/node\" entrypoint, or pass a \"modelClass\" parameter like this:`,\n \"\",\n \"```\",\n `import { pull } from \"langchain/hub\";`,\n `import { ChatAnthropic } from \"@langchain/anthropic\";`,\n \"\",\n `const prompt = await pull(\"my-prompt\", {`,\n ` includeModel: true,`,\n ` modelClass: ChatAnthropic,`,\n `});`,\n \"```\",\n ].join(\"\\n\")\n );\n } else {\n throw e;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,eAAsB,KACpBA,iBACAC,SASA;CACA,MAAM,eAAe,MAAM,SAAS,iBAAiB,QAAQ;AAC7D,KAAI;EACF,MAAM,eAAe,MAAM,KACzB,KAAK,UAAU,aAAa,SAAS,EACrC,SAAS,SACT,0BAA0B,SAAS,WAAW,EAC9C,uBAAuB,SAAS,WAAW,EAC3C,SAAS,eACV;AACD,SAAO,iBAAiB,aAAa;CAEtC,SAAQC,GAAQ;AACf,MAAI,SAAS,aACX,OAAM,IAAI,MACR;GACE,EAAE;GACF;GACA,CAAC,kJAAkJ,CAAC;GACpJ;GACA;GACA,CAAC,qCAAqC,CAAC;GACvC,CAAC,qDAAqD,CAAC;GACvD;GACA,CAAC,wCAAwC,CAAC;GAC1C,CAAC,qBAAqB,CAAC;GACvB,CAAC,4BAA4B,CAAC;GAC9B,CAAC,GAAG,CAAC;GACL;EACD,EAAC,KAAK,KAAK;MAGd,OAAM;CAET;AACF"}
package/dist/hub/node.cjs CHANGED
@@ -30,6 +30,13 @@ function isRunnableBinding(a) {
30
30
  * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,
31
31
  * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will
32
32
  * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.
33
+ * @param options.secrets A map of secrets to use when loading, e.g.
34
+ * {'OPENAI_API_KEY': 'sk-...'}`.
35
+ * If a secret is not found in the map, it will be loaded from the
36
+ * environment if `secrets_from_env` is `True`. Should only be needed when
37
+ * `includeModel` is `true`.
38
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
39
+ * Use with caution and only with trusted prompts.
33
40
  * @returns
34
41
  */
35
42
  async function pull(ownerRepoCommit, options) {
@@ -45,7 +52,7 @@ async function pull(ownerRepoCommit, options) {
45
52
  }
46
53
  }
47
54
  }
48
- const loadedPrompt = await require_load_index.load(JSON.stringify(promptObject.manifest), void 0, require_base.generateOptionalImportMap(modelClass), require_base.generateModelImportMap(modelClass));
55
+ const loadedPrompt = await require_load_index.load(JSON.stringify(promptObject.manifest), options?.secrets, require_base.generateOptionalImportMap(modelClass), require_base.generateModelImportMap(modelClass), options?.secretsFromEnv);
49
56
  return require_base.bindOutputSchema(loadedPrompt);
50
57
  }
51
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"node.cjs","names":["a: string[]","b: string[]","ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n }","basePull","getChatModelByClassName","load","generateOptionalImportMap","generateModelImportMap","bindOutputSchema"],"sources":["../../src/hub/node.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport {\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\nimport { load } from \"../load/index.js\";\nimport { getChatModelByClassName } from \"../chat_models/universal.js\";\n\nexport { basePush as push } from \"./base.js\";\n\nfunction _idEquals(a: string[], b: string[]): boolean {\n if (!Array.isArray(a) || !Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction isRunnableBinding(a: string[]): boolean {\n const wellKnownIds = [\n [\"langchain_core\", \"runnables\", \"RunnableBinding\"],\n [\"langchain\", \"schema\", \"runnable\", \"RunnableBinding\"],\n ];\n return wellKnownIds.some((id) => _idEquals(a, id));\n}\n\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n let modelClass;\n if (options?.includeModel) {\n const chatModelObject = isRunnableBinding(\n promptObject.manifest.kwargs?.last?.id\n )\n ? promptObject.manifest.kwargs?.last?.kwargs?.bound\n : promptObject.manifest.kwargs?.last;\n\n if (Array.isArray(chatModelObject?.id)) {\n const modelName = chatModelObject?.id.at(-1);\n\n if (modelName) {\n modelClass = await getChatModelByClassName(modelName);\n if (!modelClass) {\n console.warn(\n `Received unknown model name from prompt hub: \"${modelName}\"`\n );\n }\n }\n }\n }\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n undefined,\n generateOptionalImportMap(modelClass),\n generateModelImportMap(modelClass)\n );\n return bindOutputSchema(loadedPrompt);\n}\n"],"mappings":";;;;;AAYA,SAAS,UAAUA,GAAaC,GAAsB;AACpD,KAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CACxC,QAAO;AAET,KAAI,EAAE,WAAW,EAAE,OACjB,QAAO;AAET,MAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,IAC5B,KAAI,EAAE,OAAO,EAAE,GACb,QAAO;AAGX,QAAO;AACR;AAED,SAAS,kBAAkBD,GAAsB;CAC/C,MAAM,eAAe,CACnB;EAAC;EAAkB;EAAa;CAAkB,GAClD;EAAC;EAAa;EAAU;EAAY;CAAkB,CACvD;AACD,QAAO,aAAa,KAAK,CAAC,OAAO,UAAU,GAAG,GAAG,CAAC;AACnD;;;;;;;;;;;AAYD,eAAsB,KACpBE,iBACAC,SAKA;CACA,MAAM,eAAe,MAAMC,sBAAS,iBAAiB,QAAQ;CAC7D,IAAI;AACJ,KAAI,SAAS,cAAc;EACzB,MAAM,kBAAkB,kBACtB,aAAa,SAAS,QAAQ,MAAM,GACrC,GACG,aAAa,SAAS,QAAQ,MAAM,QAAQ,QAC5C,aAAa,SAAS,QAAQ;AAElC,MAAI,MAAM,QAAQ,iBAAiB,GAAG,EAAE;GACtC,MAAM,YAAY,iBAAiB,GAAG,GAAG,GAAG;AAE5C,OAAI,WAAW;IACb,aAAa,MAAMC,sDAAwB,UAAU;AACrD,QAAI,CAAC,YACH,QAAQ,KACN,CAAC,8CAA8C,EAAE,UAAU,CAAC,CAAC,CAC9D;GAEJ;EACF;CACF;CACD,MAAM,eAAe,MAAMC,wBACzB,KAAK,UAAU,aAAa,SAAS,EACrC,QACAC,uCAA0B,WAAW,EACrCC,oCAAuB,WAAW,CACnC;AACD,QAAOC,8BAAiB,aAAa;AACtC"}
1
+ {"version":3,"file":"node.cjs","names":["a: string[]","b: string[]","ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }","basePull","getChatModelByClassName","load","generateOptionalImportMap","generateModelImportMap","bindOutputSchema"],"sources":["../../src/hub/node.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport {\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\nimport { load } from \"../load/index.js\";\nimport { getChatModelByClassName } from \"../chat_models/universal.js\";\n\nexport { basePush as push } from \"./base.js\";\n\nfunction _idEquals(a: string[], b: string[]): boolean {\n if (!Array.isArray(a) || !Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction isRunnableBinding(a: string[]): boolean {\n const wellKnownIds = [\n [\"langchain_core\", \"runnables\", \"RunnableBinding\"],\n [\"langchain\", \"schema\", \"runnable\", \"RunnableBinding\"],\n ];\n return wellKnownIds.some((id) => _idEquals(a, id));\n}\n\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n let modelClass;\n if (options?.includeModel) {\n const chatModelObject = isRunnableBinding(\n promptObject.manifest.kwargs?.last?.id\n )\n ? promptObject.manifest.kwargs?.last?.kwargs?.bound\n : promptObject.manifest.kwargs?.last;\n\n if (Array.isArray(chatModelObject?.id)) {\n const modelName = chatModelObject?.id.at(-1);\n\n if (modelName) {\n modelClass = await getChatModelByClassName(modelName);\n if (!modelClass) {\n console.warn(\n `Received unknown model name from prompt hub: \"${modelName}\"`\n );\n }\n }\n }\n }\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n options?.secrets,\n generateOptionalImportMap(modelClass),\n generateModelImportMap(modelClass),\n options?.secretsFromEnv\n );\n return bindOutputSchema(loadedPrompt);\n}\n"],"mappings":";;;;;AAYA,SAAS,UAAUA,GAAaC,GAAsB;AACpD,KAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CACxC,QAAO;AAET,KAAI,EAAE,WAAW,EAAE,OACjB,QAAO;AAET,MAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,IAC5B,KAAI,EAAE,OAAO,EAAE,GACb,QAAO;AAGX,QAAO;AACR;AAED,SAAS,kBAAkBD,GAAsB;CAC/C,MAAM,eAAe,CACnB;EAAC;EAAkB;EAAa;CAAkB,GAClD;EAAC;EAAa;EAAU;EAAY;CAAkB,CACvD;AACD,QAAO,aAAa,KAAK,CAAC,OAAO,UAAU,GAAG,GAAG,CAAC;AACnD;;;;;;;;;;;;;;;;;;AAmBD,eAAsB,KACpBE,iBACAC,SAOA;CACA,MAAM,eAAe,MAAMC,sBAAS,iBAAiB,QAAQ;CAC7D,IAAI;AACJ,KAAI,SAAS,cAAc;EACzB,MAAM,kBAAkB,kBACtB,aAAa,SAAS,QAAQ,MAAM,GACrC,GACG,aAAa,SAAS,QAAQ,MAAM,QAAQ,QAC5C,aAAa,SAAS,QAAQ;AAElC,MAAI,MAAM,QAAQ,iBAAiB,GAAG,EAAE;GACtC,MAAM,YAAY,iBAAiB,GAAG,GAAG,GAAG;AAE5C,OAAI,WAAW;IACb,aAAa,MAAMC,sDAAwB,UAAU;AACrD,QAAI,CAAC,YACH,QAAQ,KACN,CAAC,8CAA8C,EAAE,UAAU,CAAC,CAAC,CAC9D;GAEJ;EACF;CACF;CACD,MAAM,eAAe,MAAMC,wBACzB,KAAK,UAAU,aAAa,SAAS,EACrC,SAAS,SACTC,uCAA0B,WAAW,EACrCC,oCAAuB,WAAW,EAClC,SAAS,eACV;AACD,QAAOC,8BAAiB,aAAa;AACtC"}
@@ -11,12 +11,21 @@ import { Runnable } from "@langchain/core/runnables";
11
11
  * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,
12
12
  * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will
13
13
  * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.
14
+ * @param options.secrets A map of secrets to use when loading, e.g.
15
+ * {'OPENAI_API_KEY': 'sk-...'}`.
16
+ * If a secret is not found in the map, it will be loaded from the
17
+ * environment if `secrets_from_env` is `True`. Should only be needed when
18
+ * `includeModel` is `true`.
19
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
20
+ * Use with caution and only with trusted prompts.
14
21
  * @returns
15
22
  */
16
23
  declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
17
24
  apiKey?: string;
18
25
  apiUrl?: string;
19
26
  includeModel?: boolean;
27
+ secrets?: Record<string, string>;
28
+ secretsFromEnv?: boolean;
20
29
  }): Promise<T>;
21
30
  //#endregion
22
31
  export { pull, basePush as push };
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.cts","names":["Runnable","basePush","push","pull","T","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=node.d.ts.map"],"mappings":";;;;;;;AAYA;;;;AAIW;;;;iBAJaG,eAAeH;;;;IAInCK,QAAQD"}
1
+ {"version":3,"file":"node.d.cts","names":["Runnable","basePush","push","pull","T","Record","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=node.d.ts.map"],"mappings":";;;;;;;AAmBA;;;;;AAMW;;;;;;;;;;iBANaG,eAAeH;;;;YAIzBK;;IAEVC,QAAQF"}
@@ -11,12 +11,21 @@ import { Runnable } from "@langchain/core/runnables";
11
11
  * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,
12
12
  * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will
13
13
  * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.
14
+ * @param options.secrets A map of secrets to use when loading, e.g.
15
+ * {'OPENAI_API_KEY': 'sk-...'}`.
16
+ * If a secret is not found in the map, it will be loaded from the
17
+ * environment if `secrets_from_env` is `True`. Should only be needed when
18
+ * `includeModel` is `true`.
19
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
20
+ * Use with caution and only with trusted prompts.
14
21
  * @returns
15
22
  */
16
23
  declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {
17
24
  apiKey?: string;
18
25
  apiUrl?: string;
19
26
  includeModel?: boolean;
27
+ secrets?: Record<string, string>;
28
+ secretsFromEnv?: boolean;
20
29
  }): Promise<T>;
21
30
  //#endregion
22
31
  export { pull, basePush as push };
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","names":["Runnable","basePush","push","pull","T","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=node.d.ts.map"],"mappings":";;;;;;;AAYA;;;;AAIW;;;;iBAJaG,eAAeH;;;;IAInCK,QAAQD"}
1
+ {"version":3,"file":"node.d.ts","names":["Runnable","basePush","push","pull","T","Record","Promise"],"sources":["../../src/hub/node.d.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nexport { basePush as push } from \"./base.js\";\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport declare function pull<T extends Runnable>(ownerRepoCommit: string, options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n}): Promise<T>;\n//# sourceMappingURL=node.d.ts.map"],"mappings":";;;;;;;AAmBA;;;;;AAMW;;;;;;;;;;iBANaG,eAAeH;;;;YAIzBK;;IAEVC,QAAQF"}
package/dist/hub/node.js CHANGED
@@ -30,6 +30,13 @@ function isRunnableBinding(a) {
30
30
  * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,
31
31
  * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will
32
32
  * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.
33
+ * @param options.secrets A map of secrets to use when loading, e.g.
34
+ * {'OPENAI_API_KEY': 'sk-...'}`.
35
+ * If a secret is not found in the map, it will be loaded from the
36
+ * environment if `secrets_from_env` is `True`. Should only be needed when
37
+ * `includeModel` is `true`.
38
+ * @param options.secretsFromEnv Whether to load secrets from environment variables.
39
+ * Use with caution and only with trusted prompts.
33
40
  * @returns
34
41
  */
35
42
  async function pull(ownerRepoCommit, options) {
@@ -45,7 +52,7 @@ async function pull(ownerRepoCommit, options) {
45
52
  }
46
53
  }
47
54
  }
48
- const loadedPrompt = await load(JSON.stringify(promptObject.manifest), void 0, generateOptionalImportMap(modelClass), generateModelImportMap(modelClass));
55
+ const loadedPrompt = await load(JSON.stringify(promptObject.manifest), options?.secrets, generateOptionalImportMap(modelClass), generateModelImportMap(modelClass), options?.secretsFromEnv);
49
56
  return bindOutputSchema(loadedPrompt);
50
57
  }
51
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["a: string[]","b: string[]","ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n }"],"sources":["../../src/hub/node.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport {\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\nimport { load } from \"../load/index.js\";\nimport { getChatModelByClassName } from \"../chat_models/universal.js\";\n\nexport { basePush as push } from \"./base.js\";\n\nfunction _idEquals(a: string[], b: string[]): boolean {\n if (!Array.isArray(a) || !Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction isRunnableBinding(a: string[]): boolean {\n const wellKnownIds = [\n [\"langchain_core\", \"runnables\", \"RunnableBinding\"],\n [\"langchain\", \"schema\", \"runnable\", \"RunnableBinding\"],\n ];\n return wellKnownIds.some((id) => _idEquals(a, id));\n}\n\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n let modelClass;\n if (options?.includeModel) {\n const chatModelObject = isRunnableBinding(\n promptObject.manifest.kwargs?.last?.id\n )\n ? promptObject.manifest.kwargs?.last?.kwargs?.bound\n : promptObject.manifest.kwargs?.last;\n\n if (Array.isArray(chatModelObject?.id)) {\n const modelName = chatModelObject?.id.at(-1);\n\n if (modelName) {\n modelClass = await getChatModelByClassName(modelName);\n if (!modelClass) {\n console.warn(\n `Received unknown model name from prompt hub: \"${modelName}\"`\n );\n }\n }\n }\n }\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n undefined,\n generateOptionalImportMap(modelClass),\n generateModelImportMap(modelClass)\n );\n return bindOutputSchema(loadedPrompt);\n}\n"],"mappings":";;;;;AAYA,SAAS,UAAUA,GAAaC,GAAsB;AACpD,KAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CACxC,QAAO;AAET,KAAI,EAAE,WAAW,EAAE,OACjB,QAAO;AAET,MAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,IAC5B,KAAI,EAAE,OAAO,EAAE,GACb,QAAO;AAGX,QAAO;AACR;AAED,SAAS,kBAAkBD,GAAsB;CAC/C,MAAM,eAAe,CACnB;EAAC;EAAkB;EAAa;CAAkB,GAClD;EAAC;EAAa;EAAU;EAAY;CAAkB,CACvD;AACD,QAAO,aAAa,KAAK,CAAC,OAAO,UAAU,GAAG,GAAG,CAAC;AACnD;;;;;;;;;;;AAYD,eAAsB,KACpBE,iBACAC,SAKA;CACA,MAAM,eAAe,MAAM,SAAS,iBAAiB,QAAQ;CAC7D,IAAI;AACJ,KAAI,SAAS,cAAc;EACzB,MAAM,kBAAkB,kBACtB,aAAa,SAAS,QAAQ,MAAM,GACrC,GACG,aAAa,SAAS,QAAQ,MAAM,QAAQ,QAC5C,aAAa,SAAS,QAAQ;AAElC,MAAI,MAAM,QAAQ,iBAAiB,GAAG,EAAE;GACtC,MAAM,YAAY,iBAAiB,GAAG,GAAG,GAAG;AAE5C,OAAI,WAAW;IACb,aAAa,MAAM,wBAAwB,UAAU;AACrD,QAAI,CAAC,YACH,QAAQ,KACN,CAAC,8CAA8C,EAAE,UAAU,CAAC,CAAC,CAC9D;GAEJ;EACF;CACF;CACD,MAAM,eAAe,MAAM,KACzB,KAAK,UAAU,aAAa,SAAS,EACrC,QACA,0BAA0B,WAAW,EACrC,uBAAuB,WAAW,CACnC;AACD,QAAO,iBAAiB,aAAa;AACtC"}
1
+ {"version":3,"file":"node.js","names":["a: string[]","b: string[]","ownerRepoCommit: string","options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }"],"sources":["../../src/hub/node.ts"],"sourcesContent":["import { Runnable } from \"@langchain/core/runnables\";\nimport {\n basePull,\n generateModelImportMap,\n generateOptionalImportMap,\n bindOutputSchema,\n} from \"./base.js\";\nimport { load } from \"../load/index.js\";\nimport { getChatModelByClassName } from \"../chat_models/universal.js\";\n\nexport { basePush as push } from \"./base.js\";\n\nfunction _idEquals(a: string[], b: string[]): boolean {\n if (!Array.isArray(a) || !Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction isRunnableBinding(a: string[]): boolean {\n const wellKnownIds = [\n [\"langchain_core\", \"runnables\", \"RunnableBinding\"],\n [\"langchain\", \"schema\", \"runnable\", \"RunnableBinding\"],\n ];\n return wellKnownIds.some((id) => _idEquals(a, id));\n}\n\n/**\n * Pull a prompt from the hub.\n * @param ownerRepoCommit The name of the repo containing the prompt, as well as an optional commit hash separated by a slash.\n * @param options.apiKey LangSmith API key to use when pulling the prompt\n * @param options.apiUrl LangSmith API URL to use when pulling the prompt\n * @param options.includeModel Whether to also instantiate and attach a model instance to the prompt,\n * if the prompt has associated model metadata. If set to true, invoking the resulting pulled prompt will\n * also invoke the instantiated model. You must have the appropriate LangChain integration package installed.\n * @param options.secrets A map of secrets to use when loading, e.g.\n * {'OPENAI_API_KEY': 'sk-...'}`.\n * If a secret is not found in the map, it will be loaded from the\n * environment if `secrets_from_env` is `True`. Should only be needed when\n * `includeModel` is `true`.\n * @param options.secretsFromEnv Whether to load secrets from environment variables.\n * Use with caution and only with trusted prompts.\n * @returns\n */\nexport async function pull<T extends Runnable>(\n ownerRepoCommit: string,\n options?: {\n apiKey?: string;\n apiUrl?: string;\n includeModel?: boolean;\n secrets?: Record<string, string>;\n secretsFromEnv?: boolean;\n }\n) {\n const promptObject = await basePull(ownerRepoCommit, options);\n let modelClass;\n if (options?.includeModel) {\n const chatModelObject = isRunnableBinding(\n promptObject.manifest.kwargs?.last?.id\n )\n ? promptObject.manifest.kwargs?.last?.kwargs?.bound\n : promptObject.manifest.kwargs?.last;\n\n if (Array.isArray(chatModelObject?.id)) {\n const modelName = chatModelObject?.id.at(-1);\n\n if (modelName) {\n modelClass = await getChatModelByClassName(modelName);\n if (!modelClass) {\n console.warn(\n `Received unknown model name from prompt hub: \"${modelName}\"`\n );\n }\n }\n }\n }\n const loadedPrompt = await load<T>(\n JSON.stringify(promptObject.manifest),\n options?.secrets,\n generateOptionalImportMap(modelClass),\n generateModelImportMap(modelClass),\n options?.secretsFromEnv\n );\n return bindOutputSchema(loadedPrompt);\n}\n"],"mappings":";;;;;AAYA,SAAS,UAAUA,GAAaC,GAAsB;AACpD,KAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CACxC,QAAO;AAET,KAAI,EAAE,WAAW,EAAE,OACjB,QAAO;AAET,MAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,IAC5B,KAAI,EAAE,OAAO,EAAE,GACb,QAAO;AAGX,QAAO;AACR;AAED,SAAS,kBAAkBD,GAAsB;CAC/C,MAAM,eAAe,CACnB;EAAC;EAAkB;EAAa;CAAkB,GAClD;EAAC;EAAa;EAAU;EAAY;CAAkB,CACvD;AACD,QAAO,aAAa,KAAK,CAAC,OAAO,UAAU,GAAG,GAAG,CAAC;AACnD;;;;;;;;;;;;;;;;;;AAmBD,eAAsB,KACpBE,iBACAC,SAOA;CACA,MAAM,eAAe,MAAM,SAAS,iBAAiB,QAAQ;CAC7D,IAAI;AACJ,KAAI,SAAS,cAAc;EACzB,MAAM,kBAAkB,kBACtB,aAAa,SAAS,QAAQ,MAAM,GACrC,GACG,aAAa,SAAS,QAAQ,MAAM,QAAQ,QAC5C,aAAa,SAAS,QAAQ;AAElC,MAAI,MAAM,QAAQ,iBAAiB,GAAG,EAAE;GACtC,MAAM,YAAY,iBAAiB,GAAG,GAAG,GAAG;AAE5C,OAAI,WAAW;IACb,aAAa,MAAM,wBAAwB,UAAU;AACrD,QAAI,CAAC,YACH,QAAQ,KACN,CAAC,8CAA8C,EAAE,UAAU,CAAC,CAAC,CAC9D;GAEJ;EACF;CACF;CACD,MAAM,eAAe,MAAM,KACzB,KAAK,UAAU,aAAa,SAAS,EACrC,SAAS,SACT,0BAA0B,WAAW,EACrC,uBAAuB,WAAW,EAClC,SAAS,eACV;AACD,QAAO,iBAAiB,aAAa;AACtC"}
@@ -11,9 +11,11 @@ const __langchain_core_load = require_rolldown_runtime.__toESM(require("@langcha
11
11
  * @param text Serialized text representation of the module.
12
12
  * @param secretsMap
13
13
  * @param optionalImportsMap
14
+ * @param additionalImportsMap
15
+ * @param secretsFromEnv
14
16
  * @returns A loaded instance of a LangChain module.
15
17
  */
16
- async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalImportsMap = {}) {
18
+ async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalImportsMap = {}, secretsFromEnv) {
17
19
  return (0, __langchain_core_load.load)(text, {
18
20
  secretsMap,
19
21
  optionalImportsMap,
@@ -21,7 +23,8 @@ async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalIm
21
23
  importMap: {
22
24
  ...require_import_map.import_map_exports,
23
25
  ...additionalImportsMap
24
- }
26
+ },
27
+ secretsFromEnv
25
28
  });
26
29
  }
27
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["text: string","secretsMap: Record<string, any>","optionalImportsMap: OptionalImportMap & Record<string, any>","additionalImportsMap: Record<string, any>","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {}\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,eAAsB,KACpBA,MAEAC,aAAkC,CAAE,GAEpCC,qBAA8D,CAAE,GAEhEC,uBAA4C,CAAE,GAClC;AACZ,wCAAgB,MAAM;EACpB;EACA;EACA;EACA,WAAW;GAAE,GAAGC;GAAW,GAAG;EAAsB;CACrD,EAAC;AACH"}
1
+ {"version":3,"file":"index.cjs","names":["text: string","secretsMap: Record<string, any>","optionalImportsMap: OptionalImportMap & Record<string, any>","additionalImportsMap: Record<string, any>","secretsFromEnv?: boolean","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @param additionalImportsMap\n * @param secretsFromEnv\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,eAAsB,KACpBA,MAEAC,aAAkC,CAAE,GAEpCC,qBAA8D,CAAE,GAEhEC,uBAA4C,CAAE,GAC9CC,gBACY;AACZ,wCAAgB,MAAM;EACpB;EACA;EACA;EACA,WAAW;GAAE,GAAGC;GAAW,GAAG;EAAsB;EACpD;CACD,EAAC;AACH"}
@@ -9,9 +9,11 @@ import { OptionalImportMap } from "./import_type.cjs";
9
9
  * @param text Serialized text representation of the module.
10
10
  * @param secretsMap
11
11
  * @param optionalImportsMap
12
+ * @param additionalImportsMap
13
+ * @param secretsFromEnv
12
14
  * @returns A loaded instance of a LangChain module.
13
15
  */
14
- declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>): Promise<T>;
16
+ declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>, secretsFromEnv?: boolean): Promise<T>;
15
17
  //#endregion
16
18
  export { load };
17
19
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["OptionalImportMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAUA;;;;;;;AAAkM,iBAA1KC,IAA0K,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAvIE,MAAuI,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,EAA7FH,iBAA6F,GAAzEG,MAAyE,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,oBAAA,CAAA,EAA7BA,MAA6B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,EAAPC,OAAO,CAACF,CAAD,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["OptionalImportMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @param additionalImportsMap\n * @param secretsFromEnv\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>, secretsFromEnv?: boolean): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAYA;;;;;;;AAA4N;;iBAApMC,mCAAmCE,0CAA0CH,oBAAoBG,4CAA4CA,gDAAgDC,QAAQF"}
@@ -9,9 +9,11 @@ import { OptionalImportMap } from "./import_type.js";
9
9
  * @param text Serialized text representation of the module.
10
10
  * @param secretsMap
11
11
  * @param optionalImportsMap
12
+ * @param additionalImportsMap
13
+ * @param secretsFromEnv
12
14
  * @returns A loaded instance of a LangChain module.
13
15
  */
14
- declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>): Promise<T>;
16
+ declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>, secretsFromEnv?: boolean): Promise<T>;
15
17
  //#endregion
16
18
  export { load };
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["OptionalImportMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAUA;;;;;;;AAAkM,iBAA1KC,IAA0K,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAvIE,MAAuI,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,EAA7FH,iBAA6F,GAAzEG,MAAyE,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,oBAAA,CAAA,EAA7BA,MAA6B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,EAAPC,OAAO,CAACF,CAAD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["OptionalImportMap","load","T","Record","Promise"],"sources":["../../src/load/index.d.ts"],"sourcesContent":["import { OptionalImportMap } from \"./import_type.js\";\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @param additionalImportsMap\n * @param secretsFromEnv\n * @returns A loaded instance of a LangChain module.\n */\nexport declare function load<T>(text: string, secretsMap?: Record<string, any>, optionalImportsMap?: OptionalImportMap & Record<string, any>, additionalImportsMap?: Record<string, any>, secretsFromEnv?: boolean): Promise<T>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;AAYA;;;;;;;AAA4N;;iBAApMC,mCAAmCE,0CAA0CH,oBAAoBG,4CAA4CA,gDAAgDC,QAAQF"}
@@ -10,9 +10,11 @@ import { load as load$1 } from "@langchain/core/load";
10
10
  * @param text Serialized text representation of the module.
11
11
  * @param secretsMap
12
12
  * @param optionalImportsMap
13
+ * @param additionalImportsMap
14
+ * @param secretsFromEnv
13
15
  * @returns A loaded instance of a LangChain module.
14
16
  */
15
- async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalImportsMap = {}) {
17
+ async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalImportsMap = {}, secretsFromEnv) {
16
18
  return load$1(text, {
17
19
  secretsMap,
18
20
  optionalImportsMap,
@@ -20,7 +22,8 @@ async function load(text, secretsMap = {}, optionalImportsMap = {}, additionalIm
20
22
  importMap: {
21
23
  ...import_map_exports,
22
24
  ...additionalImportsMap
23
- }
25
+ },
26
+ secretsFromEnv
24
27
  });
25
28
  }
26
29
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["text: string","secretsMap: Record<string, any>","optionalImportsMap: OptionalImportMap & Record<string, any>","additionalImportsMap: Record<string, any>","coreLoad","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {}\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAcA,eAAsB,KACpBA,MAEAC,aAAkC,CAAE,GAEpCC,qBAA8D,CAAE,GAEhEC,uBAA4C,CAAE,GAClC;AACZ,QAAOC,OAAS,MAAM;EACpB;EACA;EACA;EACA,WAAW;GAAE,GAAGC;GAAW,GAAG;EAAsB;CACrD,EAAC;AACH"}
1
+ {"version":3,"file":"index.js","names":["text: string","secretsMap: Record<string, any>","optionalImportsMap: OptionalImportMap & Record<string, any>","additionalImportsMap: Record<string, any>","secretsFromEnv?: boolean","coreLoad","importMap"],"sources":["../../src/load/index.ts"],"sourcesContent":["import { load as coreLoad } from \"@langchain/core/load\";\nimport { optionalImportEntrypoints } from \"./import_constants.js\";\nimport * as importMap from \"./import_map.js\";\nimport { OptionalImportMap } from \"./import_type.js\";\n\n/**\n * Load a LangChain module from a serialized text representation.\n * NOTE: This functionality is currently in beta.\n * Loaded classes may change independently of semver.\n * @param text Serialized text representation of the module.\n * @param secretsMap\n * @param optionalImportsMap\n * @param additionalImportsMap\n * @param secretsFromEnv\n * @returns A loaded instance of a LangChain module.\n */\nexport async function load<T>(\n text: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n secretsMap: Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n optionalImportsMap: OptionalImportMap & Record<string, any> = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalImportsMap: Record<string, any> = {},\n secretsFromEnv?: boolean\n): Promise<T> {\n return coreLoad(text, {\n secretsMap,\n optionalImportsMap,\n optionalImportEntrypoints,\n importMap: { ...importMap, ...additionalImportsMap },\n secretsFromEnv,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,eAAsB,KACpBA,MAEAC,aAAkC,CAAE,GAEpCC,qBAA8D,CAAE,GAEhEC,uBAA4C,CAAE,GAC9CC,gBACY;AACZ,QAAOC,OAAS,MAAM;EACpB;EACA;EACA;EACA,WAAW;GAAE,GAAGC;GAAW,GAAG;EAAsB;EACpD;CACD,EAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -53,15 +53,15 @@
53
53
  "typescript": "~5.8.3",
54
54
  "vitest": "^3.2.4",
55
55
  "yaml": "^2.8.1",
56
- "@langchain/anthropic": "1.3.3",
56
+ "@langchain/anthropic": "1.3.5",
57
57
  "@langchain/cohere": "1.0.1",
58
- "@langchain/core": "1.1.8",
59
- "@langchain/openai": "1.2.0",
58
+ "@langchain/core": "1.1.10",
60
59
  "@langchain/eslint": "0.1.1",
60
+ "@langchain/openai": "1.2.1",
61
61
  "@langchain/tsconfig": "0.0.1"
62
62
  },
63
63
  "peerDependencies": {
64
- "@langchain/core": "1.1.8"
64
+ "@langchain/core": "1.1.10"
65
65
  },
66
66
  "dependencies": {
67
67
  "@langchain/langgraph": "^1.0.0",