@langchain/core 0.3.54 → 0.3.55

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.
@@ -5,16 +5,36 @@ export type AIMessageFields = BaseMessageFields & {
5
5
  invalid_tool_calls?: InvalidToolCall[];
6
6
  usage_metadata?: UsageMetadata;
7
7
  };
8
+ export type ModalitiesTokenDetails = {
9
+ /**
10
+ * Text tokens.
11
+ * Does not need to be reported, but some models will do so.
12
+ */
13
+ text?: number;
14
+ /**
15
+ * Image (non-video) tokens.
16
+ */
17
+ image?: number;
18
+ /**
19
+ * Audio tokens.
20
+ */
21
+ audio?: number;
22
+ /**
23
+ * Video tokens.
24
+ */
25
+ video?: number;
26
+ /**
27
+ * Document tokens.
28
+ * e.g. PDF
29
+ */
30
+ document?: number;
31
+ };
8
32
  /**
9
33
  * Breakdown of input token counts.
10
34
  *
11
35
  * Does not *need* to sum to full input token count. Does *not* need to have all keys.
12
36
  */
13
- export type InputTokenDetails = {
14
- /**
15
- * Audio input tokens.
16
- */
17
- audio?: number;
37
+ export type InputTokenDetails = ModalitiesTokenDetails & {
18
38
  /**
19
39
  * Input tokens that were cached and there was a cache hit.
20
40
  *
@@ -34,11 +54,7 @@ export type InputTokenDetails = {
34
54
  *
35
55
  * Does *not* need to sum to full output token count. Does *not* need to have all keys.
36
56
  */
37
- export type OutputTokenDetails = {
38
- /**
39
- * Audio output tokens
40
- */
41
- audio?: number;
57
+ export type OutputTokenDetails = ModalitiesTokenDetails & {
42
58
  /**
43
59
  * Reasoning output tokens.
44
60
  *
@@ -51,7 +51,7 @@ export declare abstract class Runnable<RunInput = any, RunOutput = any, CallOpti
51
51
  * @param config New configuration parameters to attach to the new runnable.
52
52
  * @returns A new RunnableBinding with a config matching what's passed.
53
53
  */
54
- withConfig(config: RunnableConfig): Runnable<RunInput, RunOutput, CallOptions>;
54
+ withConfig(config: Partial<CallOptions>): Runnable<RunInput, RunOutput, CallOptions>;
55
55
  /**
56
56
  * Create a new runnable from the current one that will try invoking
57
57
  * other passed fallback runnables if the initial invocation fails.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.3.54",
3
+ "version": "0.3.55",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {