langchain 0.3.10 → 0.3.12

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.
@@ -11,7 +11,7 @@ const base_js_1 = require("./base.cjs");
11
11
  * OpenAIModerationChainInput interface.
12
12
  * @example
13
13
  * ```typescript
14
- * const moderation = new ChatOpenAIModerationChain({ throwError: true });
14
+ * const moderation = new OpenAIModerationChain({ throwError: true });
15
15
  *
16
16
  * const badString = "Bad naughty words from user";
17
17
  *
@@ -19,7 +19,7 @@ export interface OpenAIModerationChainInput extends ChainInputs, AsyncCallerPara
19
19
  * OpenAIModerationChainInput interface.
20
20
  * @example
21
21
  * ```typescript
22
- * const moderation = new ChatOpenAIModerationChain({ throwError: true });
22
+ * const moderation = new OpenAIModerationChain({ throwError: true });
23
23
  *
24
24
  * const badString = "Bad naughty words from user";
25
25
  *
@@ -8,7 +8,7 @@ import { BaseChain } from "./base.js";
8
8
  * OpenAIModerationChainInput interface.
9
9
  * @example
10
10
  * ```typescript
11
- * const moderation = new ChatOpenAIModerationChain({ throwError: true });
11
+ * const moderation = new OpenAIModerationChain({ throwError: true });
12
12
  *
13
13
  * const badString = "Bad naughty words from user";
14
14
  *
package/dist/hub.cjs CHANGED
@@ -32,9 +32,21 @@ exports.push = push;
32
32
  */
33
33
  async function pull(ownerRepoCommit, options) {
34
34
  const client = new langsmith_1.Client(options);
35
- const result = await client._pullPrompt(ownerRepoCommit, {
35
+ const promptObject = await client.pullPromptCommit(ownerRepoCommit, {
36
36
  includeModel: options?.includeModel,
37
37
  });
38
- return (0, index_js_1.load)(result);
38
+ if (promptObject.manifest.kwargs?.metadata === undefined) {
39
+ promptObject.manifest.kwargs = {
40
+ ...promptObject.manifest.kwargs,
41
+ metadata: {},
42
+ };
43
+ }
44
+ promptObject.manifest.kwargs.metadata = {
45
+ ...promptObject.manifest.kwargs.metadata,
46
+ lc_hub_owner: promptObject.owner,
47
+ lc_hub_repo: promptObject.repo,
48
+ lc_hub_commit_hash: promptObject.commit_hash,
49
+ };
50
+ return (0, index_js_1.load)(JSON.stringify(promptObject.manifest));
39
51
  }
40
52
  exports.pull = pull;
package/dist/hub.js CHANGED
@@ -28,8 +28,20 @@ export async function push(repoFullName, runnable, options) {
28
28
  */
29
29
  export async function pull(ownerRepoCommit, options) {
30
30
  const client = new Client(options);
31
- const result = await client._pullPrompt(ownerRepoCommit, {
31
+ const promptObject = await client.pullPromptCommit(ownerRepoCommit, {
32
32
  includeModel: options?.includeModel,
33
33
  });
34
- return load(result);
34
+ if (promptObject.manifest.kwargs?.metadata === undefined) {
35
+ promptObject.manifest.kwargs = {
36
+ ...promptObject.manifest.kwargs,
37
+ metadata: {},
38
+ };
39
+ }
40
+ promptObject.manifest.kwargs.metadata = {
41
+ ...promptObject.manifest.kwargs.metadata,
42
+ lc_hub_owner: promptObject.owner,
43
+ lc_hub_repo: promptObject.repo,
44
+ lc_hub_commit_hash: promptObject.commit_hash,
45
+ };
46
+ return load(JSON.stringify(promptObject.manifest));
35
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -530,7 +530,7 @@
530
530
  "js-tiktoken": "^1.0.12",
531
531
  "js-yaml": "^4.1.0",
532
532
  "jsonpointer": "^5.0.1",
533
- "langsmith": "^0.2.8",
533
+ "langsmith": ">=0.2.8 <0.4.0",
534
534
  "openapi-types": "^12.1.3",
535
535
  "p-retry": "4",
536
536
  "uuid": "^10.0.0",