@langchain/core 0.3.19-rc.1 → 0.3.20

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.
@@ -21,6 +21,8 @@ class BytesOutputParser extends transform_js_1.BaseTransformOutputParser {
21
21
  writable: true,
22
22
  value: true
23
23
  });
24
+ // TODO: Figure out why explicit typing is needed
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
26
  Object.defineProperty(this, "textEncoder", {
25
27
  enumerable: true,
26
28
  configurable: true,
@@ -7,7 +7,7 @@ export declare class BytesOutputParser extends BaseTransformOutputParser<Uint8Ar
7
7
  static lc_name(): string;
8
8
  lc_namespace: string[];
9
9
  lc_serializable: boolean;
10
- protected textEncoder: TextEncoder;
10
+ protected textEncoder: any;
11
11
  parse(text: string): Promise<Uint8Array>;
12
12
  getFormatInstructions(): string;
13
13
  }
@@ -18,6 +18,8 @@ export class BytesOutputParser extends BaseTransformOutputParser {
18
18
  writable: true,
19
19
  value: true
20
20
  });
21
+ // TODO: Figure out why explicit typing is needed
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
23
  Object.defineProperty(this, "textEncoder", {
22
24
  enumerable: true,
23
25
  configurable: true,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDefaultLangChainClientSingleton = void 0;
3
+ exports.setDefaultLangChainClientSingleton = exports.getDefaultLangChainClientSingleton = void 0;
4
4
  const langsmith_1 = require("langsmith");
5
5
  const env_js_1 = require("../utils/env.cjs");
6
6
  let client;
@@ -17,3 +17,7 @@ const getDefaultLangChainClientSingleton = () => {
17
17
  return client;
18
18
  };
19
19
  exports.getDefaultLangChainClientSingleton = getDefaultLangChainClientSingleton;
20
+ const setDefaultLangChainClientSingleton = (newClient) => {
21
+ client = newClient;
22
+ };
23
+ exports.setDefaultLangChainClientSingleton = setDefaultLangChainClientSingleton;
@@ -1,2 +1,3 @@
1
1
  import { Client } from "langsmith";
2
2
  export declare const getDefaultLangChainClientSingleton: () => Client;
3
+ export declare const setDefaultLangChainClientSingleton: (newClient: Client) => void;
@@ -13,3 +13,6 @@ export const getDefaultLangChainClientSingleton = () => {
13
13
  }
14
14
  return client;
15
15
  };
16
+ export const setDefaultLangChainClientSingleton = (newClient) => {
17
+ client = newClient;
18
+ };
@@ -56,7 +56,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
56
56
  reference_example_id?: string | undefined;
57
57
  parent_run_id?: string | undefined;
58
58
  tags?: string[] | undefined;
59
- attachments?: Record<string, [string, Uint8Array]> | undefined;
59
+ attachments?: import("langsmith/schemas").Attachments | undefined;
60
60
  };
61
61
  protected _endTrace(run: Run): Promise<void>;
62
62
  protected _getExecutionOrder(parentRunId: string | undefined): number;
@@ -89,7 +89,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
89
89
  reference_example_id?: string | undefined;
90
90
  parent_run_id?: string | undefined;
91
91
  tags?: string[] | undefined;
92
- attachments?: Record<string, [string, Uint8Array]> | undefined;
92
+ attachments?: import("langsmith/schemas").Attachments | undefined;
93
93
  };
94
94
  handleLLMStart(llm: Serialized, prompts: string[], runId: string, parentRunId?: string, extraParams?: KVMap, tags?: string[], metadata?: KVMap, name?: string): Promise<Run>;
95
95
  /**
@@ -121,7 +121,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
121
121
  reference_example_id?: string | undefined;
122
122
  parent_run_id?: string | undefined;
123
123
  tags?: string[] | undefined;
124
- attachments?: Record<string, [string, Uint8Array]> | undefined;
124
+ attachments?: import("langsmith/schemas").Attachments | undefined;
125
125
  };
126
126
  handleChatModelStart(llm: Serialized, messages: BaseMessage[][], runId: string, parentRunId?: string, extraParams?: KVMap, tags?: string[], metadata?: KVMap, name?: string): Promise<Run>;
127
127
  handleLLMEnd(output: LLMResult, runId: string): Promise<Run>;
@@ -155,7 +155,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
155
155
  reference_example_id?: string | undefined;
156
156
  parent_run_id?: string | undefined;
157
157
  tags?: string[] | undefined;
158
- attachments?: Record<string, [string, Uint8Array]> | undefined;
158
+ attachments?: import("langsmith/schemas").Attachments | undefined;
159
159
  };
160
160
  handleChainStart(chain: Serialized, inputs: ChainValues, runId: string, parentRunId?: string, tags?: string[], metadata?: KVMap, runType?: string, name?: string): Promise<Run>;
161
161
  handleChainEnd(outputs: ChainValues, runId: string, _parentRunId?: string, _tags?: string[], kwargs?: {
@@ -193,7 +193,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
193
193
  reference_example_id?: string | undefined;
194
194
  parent_run_id?: string | undefined;
195
195
  tags?: string[] | undefined;
196
- attachments?: Record<string, [string, Uint8Array]> | undefined;
196
+ attachments?: import("langsmith/schemas").Attachments | undefined;
197
197
  };
198
198
  handleToolStart(tool: Serialized, input: string, runId: string, parentRunId?: string, tags?: string[], metadata?: KVMap, name?: string): Promise<Run>;
199
199
  handleToolEnd(output: any, runId: string): Promise<Run>;
@@ -229,7 +229,7 @@ export declare abstract class BaseTracer extends BaseCallbackHandler {
229
229
  reference_example_id?: string | undefined;
230
230
  parent_run_id?: string | undefined;
231
231
  tags?: string[] | undefined;
232
- attachments?: Record<string, [string, Uint8Array]> | undefined;
232
+ attachments?: import("langsmith/schemas").Attachments | undefined;
233
233
  };
234
234
  handleRetrieverStart(retriever: Serialized, query: string, runId: string, parentRunId?: string, tags?: string[], metadata?: KVMap, name?: string): Promise<Run>;
235
235
  handleRetrieverEnd(documents: Document<Record<string, unknown>>[], runId: string): Promise<Run>;
@@ -1,4 +1,4 @@
1
- import { Client } from "langsmith";
1
+ import type { LangSmithTracingClientInterface } from "langsmith";
2
2
  import { RunTree } from "langsmith/run_trees";
3
3
  import { BaseRun, RunCreate, RunUpdate as BaseRunUpdate, KVMap } from "langsmith/schemas";
4
4
  import { BaseTracer } from "./base.js";
@@ -23,13 +23,13 @@ export interface RunUpdate extends BaseRunUpdate {
23
23
  export interface LangChainTracerFields extends BaseCallbackHandlerInput {
24
24
  exampleId?: string;
25
25
  projectName?: string;
26
- client?: Client;
26
+ client?: LangSmithTracingClientInterface;
27
27
  }
28
28
  export declare class LangChainTracer extends BaseTracer implements LangChainTracerFields {
29
29
  name: string;
30
30
  projectName?: string;
31
31
  exampleId?: string;
32
- client: Client;
32
+ client: LangSmithTracingClientInterface;
33
33
  constructor(fields?: LangChainTracerFields);
34
34
  private _convertToCreate;
35
35
  protected persistRun(_run: Run): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.3.19-rc.1",
3
+ "version": "0.3.20",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {
@@ -37,7 +37,7 @@
37
37
  "camelcase": "6",
38
38
  "decamelize": "1.2.0",
39
39
  "js-tiktoken": "^1.0.12",
40
- "langsmith": "^0.2.0",
40
+ "langsmith": "^0.2.8",
41
41
  "mustache": "^4.2.0",
42
42
  "p-queue": "^6.6.2",
43
43
  "p-retry": "4",