@orq-ai/node 4.10.26 → 4.10.30

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 (160) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/lib/event-streams.d.ts +7 -2
  5. package/lib/event-streams.d.ts.map +1 -1
  6. package/lib/event-streams.js +2 -1
  7. package/lib/event-streams.js.map +1 -1
  8. package/models/components/azurefoundrydeployment.d.ts +3 -0
  9. package/models/components/azurefoundrydeployment.d.ts.map +1 -1
  10. package/models/components/azurefoundrydeployment.js +4 -0
  11. package/models/components/azurefoundrydeployment.js.map +1 -1
  12. package/models/components/reasoningpart.js +1 -1
  13. package/models/operations/createdataset.js +1 -1
  14. package/models/operations/createdatasetitem.js +4 -4
  15. package/models/operations/createdatasource.js +1 -1
  16. package/models/operations/createeval.js +16 -16
  17. package/models/operations/createtool.js +6 -6
  18. package/models/operations/getalltools.js +6 -6
  19. package/models/operations/getevals.js +16 -16
  20. package/models/operations/getv2humanevalsets.js +2 -2
  21. package/models/operations/getv2humanevalsetsid.js +2 -2
  22. package/models/operations/listdatasetdatapoints.js +4 -4
  23. package/models/operations/listdatasets.js +1 -1
  24. package/models/operations/listdatasources.js +1 -1
  25. package/models/operations/modelcreateawsbedrock.d.ts +4 -0
  26. package/models/operations/modelcreateawsbedrock.d.ts.map +1 -1
  27. package/models/operations/modelcreateawsbedrock.js +4 -0
  28. package/models/operations/modelcreateawsbedrock.js.map +1 -1
  29. package/models/operations/modelupdateawsbedrock.d.ts +4 -2
  30. package/models/operations/modelupdateawsbedrock.d.ts.map +1 -1
  31. package/models/operations/modelupdateawsbedrock.js +4 -2
  32. package/models/operations/modelupdateawsbedrock.js.map +1 -1
  33. package/models/operations/modelvalidateawsbedrock.d.ts +2 -0
  34. package/models/operations/modelvalidateawsbedrock.d.ts.map +1 -1
  35. package/models/operations/modelvalidateawsbedrock.js +2 -0
  36. package/models/operations/modelvalidateawsbedrock.js.map +1 -1
  37. package/models/operations/patchv2humanevalsetsid.js +2 -2
  38. package/models/operations/postv2feedbackevaluation.js +3 -3
  39. package/models/operations/postv2humanevalsets.js +2 -2
  40. package/models/operations/retrievedatapoint.js +4 -4
  41. package/models/operations/retrievedataset.js +1 -1
  42. package/models/operations/retrievedatasource.js +1 -1
  43. package/models/operations/retrievetool.js +6 -6
  44. package/models/operations/runagent.js +1 -1
  45. package/models/operations/streamrunagent.js +1 -1
  46. package/models/operations/updatedatapoint.js +4 -4
  47. package/models/operations/updatedataset.js +1 -1
  48. package/models/operations/updatedatasource.js +1 -1
  49. package/models/operations/updateeval.js +16 -16
  50. package/models/operations/updatetool.js +7 -7
  51. package/package.json +3 -3
  52. package/packages/orq-rc/src/funcs/agentsInvoke.ts +2 -2
  53. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +8 -5
  54. package/packages/orq-rc/src/funcs/agentsStream.ts +2 -2
  55. package/packages/orq-rc/src/funcs/annotationsCreate.ts +1 -1
  56. package/packages/orq-rc/src/funcs/annotationsDelete.ts +1 -1
  57. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +4 -4
  58. package/packages/orq-rc/src/funcs/promptsCreate.ts +4 -3
  59. package/packages/orq-rc/src/lib/config.ts +3 -3
  60. package/packages/orq-rc/src/lib/event-streams.ts +15 -7
  61. package/packages/orq-rc/src/models/components/agentresponserequest.ts +565 -0
  62. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +55 -43
  63. package/packages/orq-rc/src/models/components/budget.ts +12 -0
  64. package/packages/orq-rc/src/models/components/budgetlimits.ts +12 -4
  65. package/packages/orq-rc/src/models/components/budgetusage.ts +54 -0
  66. package/packages/orq-rc/src/models/components/getbudgetconsumptionresponse.ts +7 -3
  67. package/packages/orq-rc/src/models/components/index.ts +3 -4
  68. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +3457 -0
  69. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  70. package/packages/orq-rc/src/models/components/toolexecutionstartedstreamingevent.ts +24 -14
  71. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +4 -550
  72. package/packages/orq-rc/src/models/operations/createannotation.ts +110 -16
  73. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  74. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +335 -19
  75. package/packages/orq-rc/src/models/operations/createdatasource.ts +4 -1
  76. package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
  77. package/packages/orq-rc/src/models/operations/createprompt.ts +13 -9
  78. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  79. package/packages/orq-rc/src/models/operations/deleteannotation.ts +46 -3
  80. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +1156 -1606
  81. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +221 -3675
  82. package/packages/orq-rc/src/models/operations/deployments.ts +0 -1
  83. package/packages/orq-rc/src/models/operations/deploymentstream.ts +244 -286
  84. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -1
  85. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  86. package/packages/orq-rc/src/models/operations/getevals.ts +16 -16
  87. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1
  88. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -1
  89. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  90. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  91. package/packages/orq-rc/src/models/operations/invokeagent.ts +90 -116
  92. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +378 -19
  93. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  94. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  95. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -1
  96. package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +8 -0
  97. package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +8 -4
  98. package/packages/orq-rc/src/models/operations/modelvalidateawsbedrock.ts +4 -0
  99. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +42 -18
  101. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +363 -19
  103. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  104. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  105. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  106. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  107. package/packages/orq-rc/src/models/operations/streamagent.ts +16 -11
  108. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  109. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +366 -19
  110. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  111. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  112. package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
  113. package/packages/orq-rc/src/models/operations/updateprompt.ts +17 -12
  114. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  115. package/packages/orq-rc/src/sdk/agents.ts +2 -2
  116. package/packages/orq-rc/src/sdk/annotations.ts +2 -2
  117. package/packages/orq-rc/src/sdk/deployments.ts +2 -1
  118. package/packages/orq-rc/src/sdk/feedback.ts +1 -4
  119. package/packages/orq-rc/src/sdk/models.ts +0 -35
  120. package/packages/orq-rc/src/sdk/orqresponses.ts +2 -2
  121. package/packages/orq-rc/src/sdk/prompts.ts +1 -1
  122. package/src/lib/config.ts +3 -3
  123. package/src/lib/event-streams.ts +15 -7
  124. package/src/models/components/azurefoundrydeployment.ts +7 -0
  125. package/src/models/components/reasoningpart.ts +1 -1
  126. package/src/models/operations/createdataset.ts +1 -1
  127. package/src/models/operations/createdatasetitem.ts +4 -4
  128. package/src/models/operations/createdatasource.ts +1 -1
  129. package/src/models/operations/createeval.ts +16 -16
  130. package/src/models/operations/createtool.ts +6 -6
  131. package/src/models/operations/getalltools.ts +6 -6
  132. package/src/models/operations/getevals.ts +16 -16
  133. package/src/models/operations/getv2humanevalsets.ts +2 -2
  134. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  135. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  136. package/src/models/operations/listdatasets.ts +1 -1
  137. package/src/models/operations/listdatasources.ts +1 -1
  138. package/src/models/operations/modelcreateawsbedrock.ts +8 -0
  139. package/src/models/operations/modelupdateawsbedrock.ts +8 -4
  140. package/src/models/operations/modelvalidateawsbedrock.ts +4 -0
  141. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  142. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  143. package/src/models/operations/postv2humanevalsets.ts +2 -2
  144. package/src/models/operations/retrievedatapoint.ts +4 -4
  145. package/src/models/operations/retrievedataset.ts +1 -1
  146. package/src/models/operations/retrievedatasource.ts +1 -1
  147. package/src/models/operations/retrievetool.ts +6 -6
  148. package/src/models/operations/runagent.ts +1 -1
  149. package/src/models/operations/streamrunagent.ts +1 -1
  150. package/src/models/operations/updatedatapoint.ts +4 -4
  151. package/src/models/operations/updatedataset.ts +1 -1
  152. package/src/models/operations/updatedatasource.ts +1 -1
  153. package/src/models/operations/updateeval.ts +16 -16
  154. package/src/models/operations/updatetool.ts +7 -7
  155. package/packages/orq-rc/src/funcs/modelsImportLitellm.ts +0 -166
  156. package/packages/orq-rc/src/funcs/modelsListLitellm.ts +0 -144
  157. package/packages/orq-rc/src/models/components/litellmmodel.ts +0 -50
  158. package/packages/orq-rc/src/models/components/litellmmodelinfo.ts +0 -97
  159. package/packages/orq-rc/src/models/components/litellmparams.ts +0 -43
  160. package/packages/orq-rc/src/models/components/modeldocument.ts +0 -112
@@ -83,7 +83,7 @@ export type AgentThoughtStreamingEventFunction = {
83
83
  arguments?: string | undefined;
84
84
  };
85
85
 
86
- export type ToolCalls = {
86
+ export type AgentThoughtStreamingEventToolCalls = {
87
87
  index?: number | undefined;
88
88
  id?: string | undefined;
89
89
  type?: AgentThoughtStreamingEventDataType | undefined;
@@ -104,7 +104,7 @@ export type AgentThoughtStreamingEventDataRole = ClosedEnum<
104
104
  /**
105
105
  * If the audio output modality is requested, this object contains data about the audio response from the model.
106
106
  */
107
- export type Audio = {
107
+ export type AgentThoughtStreamingEventAudio = {
108
108
  id: string;
109
109
  expiresAt: number;
110
110
  data: string;
@@ -117,7 +117,7 @@ export type Audio = {
117
117
  export type AgentThoughtStreamingEventMessage = {
118
118
  content?: string | null | undefined;
119
119
  refusal?: string | null | undefined;
120
- toolCalls?: Array<ToolCalls> | undefined;
120
+ toolCalls?: Array<AgentThoughtStreamingEventToolCalls> | undefined;
121
121
  role?: AgentThoughtStreamingEventDataRole | undefined;
122
122
  /**
123
123
  * Internal thought process of the model
@@ -134,7 +134,7 @@ export type AgentThoughtStreamingEventMessage = {
134
134
  /**
135
135
  * If the audio output modality is requested, this object contains data about the audio response from the model.
136
136
  */
137
- audio?: Audio | null | undefined;
137
+ audio?: AgentThoughtStreamingEventAudio | null | undefined;
138
138
  };
139
139
 
140
140
  export type TopLogprobs = {
@@ -152,7 +152,7 @@ export type TopLogprobs = {
152
152
  bytes: Array<number> | null;
153
153
  };
154
154
 
155
- export type Content = {
155
+ export type AgentThoughtStreamingEventContent = {
156
156
  /**
157
157
  * The token.
158
158
  */
@@ -212,7 +212,7 @@ export type Logprobs = {
212
212
  /**
213
213
  * A list of message content tokens with log probability information.
214
214
  */
215
- content: Array<Content> | null;
215
+ content: Array<AgentThoughtStreamingEventContent> | null;
216
216
  /**
217
217
  * A list of message refusal tokens with log probability information.
218
218
  */
@@ -411,8 +411,8 @@ export function agentThoughtStreamingEventFunctionFromJSON(
411
411
  }
412
412
 
413
413
  /** @internal */
414
- export const ToolCalls$inboundSchema: z.ZodType<
415
- ToolCalls,
414
+ export const AgentThoughtStreamingEventToolCalls$inboundSchema: z.ZodType<
415
+ AgentThoughtStreamingEventToolCalls,
416
416
  z.ZodTypeDef,
417
417
  unknown
418
418
  > = z.object({
@@ -428,13 +428,14 @@ export const ToolCalls$inboundSchema: z.ZodType<
428
428
  });
429
429
  });
430
430
 
431
- export function toolCallsFromJSON(
431
+ export function agentThoughtStreamingEventToolCallsFromJSON(
432
432
  jsonString: string,
433
- ): SafeParseResult<ToolCalls, SDKValidationError> {
433
+ ): SafeParseResult<AgentThoughtStreamingEventToolCalls, SDKValidationError> {
434
434
  return safeParse(
435
435
  jsonString,
436
- (x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
437
- `Failed to parse 'ToolCalls' from JSON`,
436
+ (x) =>
437
+ AgentThoughtStreamingEventToolCalls$inboundSchema.parse(JSON.parse(x)),
438
+ `Failed to parse 'AgentThoughtStreamingEventToolCalls' from JSON`,
438
439
  );
439
440
  }
440
441
 
@@ -444,25 +445,28 @@ export const AgentThoughtStreamingEventDataRole$inboundSchema: z.ZodNativeEnum<
444
445
  > = z.nativeEnum(AgentThoughtStreamingEventDataRole);
445
446
 
446
447
  /** @internal */
447
- export const Audio$inboundSchema: z.ZodType<Audio, z.ZodTypeDef, unknown> = z
448
- .object({
449
- id: z.string(),
450
- expires_at: z.number().int(),
451
- data: z.string(),
452
- transcript: z.string(),
453
- }).transform((v) => {
454
- return remap$(v, {
455
- "expires_at": "expiresAt",
456
- });
448
+ export const AgentThoughtStreamingEventAudio$inboundSchema: z.ZodType<
449
+ AgentThoughtStreamingEventAudio,
450
+ z.ZodTypeDef,
451
+ unknown
452
+ > = z.object({
453
+ id: z.string(),
454
+ expires_at: z.number().int(),
455
+ data: z.string(),
456
+ transcript: z.string(),
457
+ }).transform((v) => {
458
+ return remap$(v, {
459
+ "expires_at": "expiresAt",
457
460
  });
461
+ });
458
462
 
459
- export function audioFromJSON(
463
+ export function agentThoughtStreamingEventAudioFromJSON(
460
464
  jsonString: string,
461
- ): SafeParseResult<Audio, SDKValidationError> {
465
+ ): SafeParseResult<AgentThoughtStreamingEventAudio, SDKValidationError> {
462
466
  return safeParse(
463
467
  jsonString,
464
- (x) => Audio$inboundSchema.parse(JSON.parse(x)),
465
- `Failed to parse 'Audio' from JSON`,
468
+ (x) => AgentThoughtStreamingEventAudio$inboundSchema.parse(JSON.parse(x)),
469
+ `Failed to parse 'AgentThoughtStreamingEventAudio' from JSON`,
466
470
  );
467
471
  }
468
472
 
@@ -474,12 +478,15 @@ export const AgentThoughtStreamingEventMessage$inboundSchema: z.ZodType<
474
478
  > = z.object({
475
479
  content: z.nullable(z.string()).optional(),
476
480
  refusal: z.nullable(z.string()).optional(),
477
- tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
481
+ tool_calls: z.array(
482
+ z.lazy(() => AgentThoughtStreamingEventToolCalls$inboundSchema),
483
+ ).optional(),
478
484
  role: AgentThoughtStreamingEventDataRole$inboundSchema.optional(),
479
485
  reasoning: z.nullable(z.string()).optional(),
480
486
  reasoning_signature: z.nullable(z.string()).optional(),
481
487
  redacted_reasoning: z.string().optional(),
482
- audio: z.nullable(z.lazy(() => Audio$inboundSchema)).optional(),
488
+ audio: z.nullable(z.lazy(() => AgentThoughtStreamingEventAudio$inboundSchema))
489
+ .optional(),
483
490
  }).transform((v) => {
484
491
  return remap$(v, {
485
492
  "tool_calls": "toolCalls",
@@ -520,25 +527,28 @@ export function topLogprobsFromJSON(
520
527
  }
521
528
 
522
529
  /** @internal */
523
- export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
524
- z.object({
525
- token: z.string(),
526
- logprob: z.number(),
527
- bytes: z.nullable(z.array(z.number())),
528
- top_logprobs: z.array(z.lazy(() => TopLogprobs$inboundSchema)),
529
- }).transform((v) => {
530
- return remap$(v, {
531
- "top_logprobs": "topLogprobs",
532
- });
530
+ export const AgentThoughtStreamingEventContent$inboundSchema: z.ZodType<
531
+ AgentThoughtStreamingEventContent,
532
+ z.ZodTypeDef,
533
+ unknown
534
+ > = z.object({
535
+ token: z.string(),
536
+ logprob: z.number(),
537
+ bytes: z.nullable(z.array(z.number())),
538
+ top_logprobs: z.array(z.lazy(() => TopLogprobs$inboundSchema)),
539
+ }).transform((v) => {
540
+ return remap$(v, {
541
+ "top_logprobs": "topLogprobs",
533
542
  });
543
+ });
534
544
 
535
- export function contentFromJSON(
545
+ export function agentThoughtStreamingEventContentFromJSON(
536
546
  jsonString: string,
537
- ): SafeParseResult<Content, SDKValidationError> {
547
+ ): SafeParseResult<AgentThoughtStreamingEventContent, SDKValidationError> {
538
548
  return safeParse(
539
549
  jsonString,
540
- (x) => Content$inboundSchema.parse(JSON.parse(x)),
541
- `Failed to parse 'Content' from JSON`,
550
+ (x) => AgentThoughtStreamingEventContent$inboundSchema.parse(JSON.parse(x)),
551
+ `Failed to parse 'AgentThoughtStreamingEventContent' from JSON`,
542
552
  );
543
553
  }
544
554
 
@@ -595,7 +605,9 @@ export const Logprobs$inboundSchema: z.ZodType<
595
605
  z.ZodTypeDef,
596
606
  unknown
597
607
  > = z.object({
598
- content: z.nullable(z.array(z.lazy(() => Content$inboundSchema))),
608
+ content: z.nullable(
609
+ z.array(z.lazy(() => AgentThoughtStreamingEventContent$inboundSchema)),
610
+ ),
599
611
  refusal: z.nullable(z.array(z.lazy(() => Refusal$inboundSchema))),
600
612
  });
601
613
 
@@ -10,6 +10,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
11
11
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
12
12
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
13
+ import { BudgetUsage, BudgetUsage$inboundSchema } from "./budgetusage.js";
13
14
  import { RateLimit, RateLimit$inboundSchema } from "./ratelimit.js";
14
15
 
15
16
  /**
@@ -60,6 +61,16 @@ export type Budget = {
60
61
  expiresAt?: Date | undefined;
61
62
  createdAt?: Date | undefined;
62
63
  updatedAt?: Date | undefined;
64
+ /**
65
+ * Live consumption for the current period, read from the Redis
66
+ *
67
+ * @remarks
68
+ * counters the enforcement gate maintains. Populated by read paths
69
+ * (Get / List); omitted on write responses (Create / Update / Reset)
70
+ * where it carries no signal. Absent or all-zero for a budget that
71
+ * has not been spent against in the current period.
72
+ */
73
+ usage?: BudgetUsage | undefined;
63
74
  };
64
75
 
65
76
  /** @internal */
@@ -80,6 +91,7 @@ export const Budget$inboundSchema: z.ZodType<Budget, z.ZodTypeDef, unknown> = z
80
91
  updated_at: z.string().datetime({ offset: true }).transform(v =>
81
92
  new Date(v)
82
93
  ).optional(),
94
+ usage: BudgetUsage$inboundSchema.optional(),
83
95
  }).transform((v) => {
84
96
  return remap$(v, {
85
97
  "budget_id": "budgetId",
@@ -23,7 +23,15 @@ import {
23
23
  export type BudgetLimits = {
24
24
  period?: BudgetPeriod | undefined;
25
25
  amount?: number | undefined;
26
- tokenLimit?: string | undefined;
26
+ /**
27
+ * Token ceiling. Carried as a double so it serializes as a JSON number
28
+ *
29
+ * @remarks
30
+ * (proto int64 would serialize as a quoted string); token counts are
31
+ * whole and well within double's exact-integer range (2^53). Stored as
32
+ * an integer server-side.
33
+ */
34
+ tokenLimit?: number | undefined;
27
35
  };
28
36
 
29
37
  /** @internal */
@@ -34,7 +42,7 @@ export const BudgetLimits$inboundSchema: z.ZodType<
34
42
  > = z.object({
35
43
  period: BudgetPeriod$inboundSchema.optional(),
36
44
  amount: z.number().optional(),
37
- token_limit: z.string().optional(),
45
+ token_limit: z.number().optional(),
38
46
  }).transform((v) => {
39
47
  return remap$(v, {
40
48
  "token_limit": "tokenLimit",
@@ -44,7 +52,7 @@ export const BudgetLimits$inboundSchema: z.ZodType<
44
52
  export type BudgetLimits$Outbound = {
45
53
  period?: string | undefined;
46
54
  amount?: number | undefined;
47
- token_limit?: string | undefined;
55
+ token_limit?: number | undefined;
48
56
  };
49
57
 
50
58
  /** @internal */
@@ -55,7 +63,7 @@ export const BudgetLimits$outboundSchema: z.ZodType<
55
63
  > = z.object({
56
64
  period: BudgetPeriod$outboundSchema.optional(),
57
65
  amount: z.number().optional(),
58
- tokenLimit: z.string().optional(),
66
+ tokenLimit: z.number().optional(),
59
67
  }).transform((v) => {
60
68
  return remap$(v, {
61
69
  tokenLimit: "token_limit",
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * BudgetUsage is the current-period consumption of a budget, sourced
12
+ *
13
+ * @remarks
14
+ * from the live Redis counters (not the exact ledger). Each dimension is
15
+ * the consumed side of the matching limit dimension: `amount` is the
16
+ * accumulated cost in USD (vs limits.amount), `tokens` is the accumulated
17
+ * token count (vs limits.token_limit), and `requests` is the count in the
18
+ * rolling 60-second window (vs rate_limit.requests_per_minute). All three
19
+ * are explicit-presence so the triple is always emitted in full, zeros
20
+ * included — a never-spent budget serializes {amount:0, tokens:0,
21
+ * requests:0} rather than dropping its zero dimensions.
22
+ */
23
+ export type BudgetUsage = {
24
+ amount?: number | undefined;
25
+ /**
26
+ * Carried as a double (not int64) so it serializes as a JSON number
27
+ *
28
+ * @remarks
29
+ * rather than a quoted string, matching limits.token_limit.
30
+ */
31
+ tokens?: number | undefined;
32
+ requests?: number | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const BudgetUsage$inboundSchema: z.ZodType<
37
+ BudgetUsage,
38
+ z.ZodTypeDef,
39
+ unknown
40
+ > = z.object({
41
+ amount: z.number().optional(),
42
+ tokens: z.number().optional(),
43
+ requests: z.number().int().optional(),
44
+ });
45
+
46
+ export function budgetUsageFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<BudgetUsage, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) => BudgetUsage$inboundSchema.parse(JSON.parse(x)),
52
+ `Failed to parse 'BudgetUsage' from JSON`,
53
+ );
54
+ }
@@ -27,9 +27,13 @@ export type GetBudgetConsumptionResponse = {
27
27
  */
28
28
  cost?: number | undefined;
29
29
  /**
30
- * Tokens accumulated in the current period.
30
+ * Tokens accumulated in the current period. Carried as a double (not
31
+ *
32
+ * @remarks
33
+ * int64) so it serializes as a JSON number rather than a quoted
34
+ * string, matching BudgetUsage.tokens and limits.token_limit.
31
35
  */
32
- tokens?: string | undefined;
36
+ tokens?: number | undefined;
33
37
  /**
34
38
  * Requests counted in the current 60-second rolling window.
35
39
  */
@@ -46,7 +50,7 @@ export const GetBudgetConsumptionResponse$inboundSchema: z.ZodType<
46
50
  period: BudgetPeriod$inboundSchema.optional(),
47
51
  period_date: z.string().optional(),
48
52
  cost: z.number().optional(),
49
- tokens: z.string().optional(),
53
+ tokens: z.number().optional(),
50
54
  requests_in_window: z.number().int().optional(),
51
55
  }).transform((v) => {
52
56
  return remap$(v, {
@@ -10,6 +10,7 @@ export * from "./agenthandedoffstreamingevent.js";
10
10
  export * from "./agentinactivestreamingevent.js";
11
11
  export * from "./agentmessagecreatedstreamingevent.js";
12
12
  export * from "./agentresponsemessage.js";
13
+ export * from "./agentresponserequest.js";
13
14
  export * from "./agentstartedstreamingevent.js";
14
15
  export * from "./agentthoughtstreamingevent.js";
15
16
  export * from "./allprojects.js";
@@ -30,6 +31,7 @@ export * from "./budgetrejection.js";
30
31
  export * from "./budgetscope.js";
31
32
  export * from "./budgetscopekind.js";
32
33
  export * from "./budgetsortfield.js";
34
+ export * from "./budgetusage.js";
33
35
  export * from "./checkbudgetsrequest.js";
34
36
  export * from "./checkbudgetsresponse.js";
35
37
  export * from "./conversationparam.js";
@@ -98,6 +100,7 @@ export * from "./identitysortfield.js";
98
100
  export * from "./imagecontentpartschema.js";
99
101
  export * from "./incompletedetails.js";
100
102
  export * from "./inputtokensdetails.js";
103
+ export * from "./invokedeploymentrequest.js";
101
104
  export * from "./legacytokenfamily.js";
102
105
  export * from "./limits.js";
103
106
  export * from "./listapikeysresponse.js";
@@ -107,13 +110,9 @@ export * from "./listfilesresponse.js";
107
110
  export * from "./listidentitiesresponse.js";
108
111
  export * from "./listprojectsresponse.js";
109
112
  export * from "./listskillsresponse.js";
110
- export * from "./litellmmodel.js";
111
- export * from "./litellmmodelinfo.js";
112
- export * from "./litellmparams.js";
113
113
  export * from "./memoryparam.js";
114
114
  export * from "./modelbudgetscope.js";
115
115
  export * from "./modelconfigurationresponse.js";
116
- export * from "./modeldocument.js";
117
116
  export * from "./modelmetadata.js";
118
117
  export * from "./modelparameterdocument.js";
119
118
  export * from "./modelref.js";