@orq-ai/node 4.11.0-rc.5 → 4.11.0-rc.7

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 (187) 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/models/components/index.d.ts +23 -0
  5. package/models/components/index.d.ts.map +1 -1
  6. package/models/components/index.js +23 -0
  7. package/models/components/index.js.map +1 -1
  8. package/models/components/publicresponseresource.d.ts +105 -0
  9. package/models/components/publicresponseresource.d.ts.map +1 -0
  10. package/models/components/publicresponseresource.js +138 -0
  11. package/models/components/publicresponseresource.js.map +1 -0
  12. package/models/components/reasoningpart.js +1 -1
  13. package/models/components/responsecodeinterpretercodedeltastreamevent.d.ts +61 -0
  14. package/models/components/responsecodeinterpretercodedeltastreamevent.d.ts.map +1 -0
  15. package/models/components/responsecodeinterpretercodedeltastreamevent.js +89 -0
  16. package/models/components/responsecodeinterpretercodedeltastreamevent.js.map +1 -0
  17. package/models/components/responsecodeinterpretercodedonestreamevent.d.ts +61 -0
  18. package/models/components/responsecodeinterpretercodedonestreamevent.d.ts.map +1 -0
  19. package/models/components/responsecodeinterpretercodedonestreamevent.js +89 -0
  20. package/models/components/responsecodeinterpretercodedonestreamevent.js.map +1 -0
  21. package/models/components/responsecontentpartstreamevent.d.ts +81 -0
  22. package/models/components/responsecontentpartstreamevent.d.ts.map +1 -0
  23. package/models/components/responsecontentpartstreamevent.js +100 -0
  24. package/models/components/responsecontentpartstreamevent.js.map +1 -0
  25. package/models/components/responseerrorstreamevent.d.ts +51 -0
  26. package/models/components/responseerrorstreamevent.d.ts.map +1 -0
  27. package/models/components/responseerrorstreamevent.js +85 -0
  28. package/models/components/responseerrorstreamevent.js.map +1 -0
  29. package/models/components/responsefunctioncallargumentsdeltastreamevent.d.ts +65 -0
  30. package/models/components/responsefunctioncallargumentsdeltastreamevent.d.ts.map +1 -0
  31. package/models/components/responsefunctioncallargumentsdeltastreamevent.js +90 -0
  32. package/models/components/responsefunctioncallargumentsdeltastreamevent.js.map +1 -0
  33. package/models/components/responsefunctioncallargumentsdonestreamevent.d.ts +61 -0
  34. package/models/components/responsefunctioncallargumentsdonestreamevent.d.ts.map +1 -0
  35. package/models/components/responsefunctioncallargumentsdonestreamevent.js +89 -0
  36. package/models/components/responsefunctioncallargumentsdonestreamevent.js.map +1 -0
  37. package/models/components/responsehostedtoolcallstreamevent.d.ts +97 -0
  38. package/models/components/responsehostedtoolcallstreamevent.d.ts.map +1 -0
  39. package/models/components/responsehostedtoolcallstreamevent.js +123 -0
  40. package/models/components/responsehostedtoolcallstreamevent.js.map +1 -0
  41. package/models/components/responseimagegenerationpartialimagestreamevent.d.ts +65 -0
  42. package/models/components/responseimagegenerationpartialimagestreamevent.d.ts.map +1 -0
  43. package/models/components/responseimagegenerationpartialimagestreamevent.js +92 -0
  44. package/models/components/responseimagegenerationpartialimagestreamevent.js.map +1 -0
  45. package/models/components/responselifecyclestreamevent.d.ts +73 -0
  46. package/models/components/responselifecyclestreamevent.d.ts.map +1 -0
  47. package/models/components/responselifecyclestreamevent.js +103 -0
  48. package/models/components/responselifecyclestreamevent.js.map +1 -0
  49. package/models/components/responsemcpcallargumentsdeltastreamevent.d.ts +61 -0
  50. package/models/components/responsemcpcallargumentsdeltastreamevent.d.ts.map +1 -0
  51. package/models/components/responsemcpcallargumentsdeltastreamevent.js +89 -0
  52. package/models/components/responsemcpcallargumentsdeltastreamevent.js.map +1 -0
  53. package/models/components/responsemcpcallargumentsdonestreamevent.d.ts +61 -0
  54. package/models/components/responsemcpcallargumentsdonestreamevent.d.ts.map +1 -0
  55. package/models/components/responsemcpcallargumentsdonestreamevent.js +89 -0
  56. package/models/components/responsemcpcallargumentsdonestreamevent.js.map +1 -0
  57. package/models/components/responseoutputitemstreamevent.d.ts +73 -0
  58. package/models/components/responseoutputitemstreamevent.d.ts.map +1 -0
  59. package/models/components/responseoutputitemstreamevent.js +96 -0
  60. package/models/components/responseoutputitemstreamevent.js.map +1 -0
  61. package/models/components/responseoutputtextannotationaddedstreamevent.d.ts +71 -0
  62. package/models/components/responseoutputtextannotationaddedstreamevent.d.ts.map +1 -0
  63. package/models/components/responseoutputtextannotationaddedstreamevent.js +93 -0
  64. package/models/components/responseoutputtextannotationaddedstreamevent.js.map +1 -0
  65. package/models/components/responseoutputtextdeltastreamevent.d.ts +75 -0
  66. package/models/components/responseoutputtextdeltastreamevent.d.ts.map +1 -0
  67. package/models/components/responseoutputtextdeltastreamevent.js +92 -0
  68. package/models/components/responseoutputtextdeltastreamevent.js.map +1 -0
  69. package/models/components/responseoutputtextdonestreamevent.d.ts +71 -0
  70. package/models/components/responseoutputtextdonestreamevent.d.ts.map +1 -0
  71. package/models/components/responseoutputtextdonestreamevent.js +91 -0
  72. package/models/components/responseoutputtextdonestreamevent.js.map +1 -0
  73. package/models/components/responsereasoningdeltastreamevent.d.ts +83 -0
  74. package/models/components/responsereasoningdeltastreamevent.d.ts.map +1 -0
  75. package/models/components/responsereasoningdeltastreamevent.js +101 -0
  76. package/models/components/responsereasoningdeltastreamevent.js.map +1 -0
  77. package/models/components/responsereasoningdonestreamevent.d.ts +79 -0
  78. package/models/components/responsereasoningdonestreamevent.d.ts.map +1 -0
  79. package/models/components/responsereasoningdonestreamevent.js +100 -0
  80. package/models/components/responsereasoningdonestreamevent.js.map +1 -0
  81. package/models/components/responsereasoningsummarypartstreamevent.d.ts +81 -0
  82. package/models/components/responsereasoningsummarypartstreamevent.d.ts.map +1 -0
  83. package/models/components/responsereasoningsummarypartstreamevent.js +102 -0
  84. package/models/components/responsereasoningsummarypartstreamevent.js.map +1 -0
  85. package/models/components/responsereasoningsummarytextdeltastreamevent.d.ts +69 -0
  86. package/models/components/responsereasoningsummarytextdeltastreamevent.d.ts.map +1 -0
  87. package/models/components/responsereasoningsummarytextdeltastreamevent.js +92 -0
  88. package/models/components/responsereasoningsummarytextdeltastreamevent.js.map +1 -0
  89. package/models/components/responsereasoningsummarytextdonestreamevent.d.ts +65 -0
  90. package/models/components/responsereasoningsummarytextdonestreamevent.d.ts.map +1 -0
  91. package/models/components/responsereasoningsummarytextdonestreamevent.js +91 -0
  92. package/models/components/responsereasoningsummarytextdonestreamevent.js.map +1 -0
  93. package/models/components/responserefusaldeltastreamevent.d.ts +65 -0
  94. package/models/components/responserefusaldeltastreamevent.d.ts.map +1 -0
  95. package/models/components/responserefusaldeltastreamevent.js +90 -0
  96. package/models/components/responserefusaldeltastreamevent.js.map +1 -0
  97. package/models/components/responserefusaldonestreamevent.d.ts +65 -0
  98. package/models/components/responserefusaldonestreamevent.d.ts.map +1 -0
  99. package/models/components/responserefusaldonestreamevent.js +90 -0
  100. package/models/components/responserefusaldonestreamevent.js.map +1 -0
  101. package/models/operations/createdataset.js +1 -1
  102. package/models/operations/createdatasetitem.js +4 -4
  103. package/models/operations/createdatasource.js +1 -1
  104. package/models/operations/createeval.js +16 -16
  105. package/models/operations/createrouterresponse.d.ts +127 -57
  106. package/models/operations/createrouterresponse.d.ts.map +1 -1
  107. package/models/operations/createrouterresponse.js +142 -61
  108. package/models/operations/createrouterresponse.js.map +1 -1
  109. package/models/operations/createtool.js +6 -6
  110. package/models/operations/getalltools.js +6 -6
  111. package/models/operations/getevals.js +16 -16
  112. package/models/operations/getv2humanevalsets.js +2 -2
  113. package/models/operations/getv2humanevalsetsid.js +2 -2
  114. package/models/operations/listdatasetdatapoints.js +4 -4
  115. package/models/operations/listdatasets.js +1 -1
  116. package/models/operations/listdatasources.js +1 -1
  117. package/models/operations/patchv2humanevalsetsid.js +2 -2
  118. package/models/operations/postv2feedbackevaluation.js +3 -3
  119. package/models/operations/postv2humanevalsets.js +2 -2
  120. package/models/operations/retrievedatapoint.js +4 -4
  121. package/models/operations/retrievedataset.js +1 -1
  122. package/models/operations/retrievedatasource.js +1 -1
  123. package/models/operations/retrievetool.js +6 -6
  124. package/models/operations/runagent.js +1 -1
  125. package/models/operations/streamrunagent.js +1 -1
  126. package/models/operations/updatedatapoint.js +4 -4
  127. package/models/operations/updatedataset.js +1 -1
  128. package/models/operations/updatedatasource.js +1 -1
  129. package/models/operations/updateeval.js +16 -16
  130. package/models/operations/updatetool.js +7 -7
  131. package/package.json +5 -5
  132. package/sdk/feedback.d.ts +1 -1
  133. package/sdk/feedback.js +1 -1
  134. package/src/lib/config.ts +3 -3
  135. package/src/models/components/index.ts +23 -0
  136. package/src/models/components/publicresponseresource.ts +196 -0
  137. package/src/models/components/reasoningpart.ts +1 -1
  138. package/src/models/components/responsecodeinterpretercodedeltastreamevent.ts +149 -0
  139. package/src/models/components/responsecodeinterpretercodedonestreamevent.ts +146 -0
  140. package/src/models/components/responsecontentpartstreamevent.ts +157 -0
  141. package/src/models/components/responseerrorstreamevent.ts +116 -0
  142. package/src/models/components/responsefunctioncallargumentsdeltastreamevent.ts +153 -0
  143. package/src/models/components/responsefunctioncallargumentsdonestreamevent.ts +148 -0
  144. package/src/models/components/responsehostedtoolcallstreamevent.ts +186 -0
  145. package/src/models/components/responseimagegenerationpartialimagestreamevent.ts +156 -0
  146. package/src/models/components/responselifecyclestreamevent.ts +145 -0
  147. package/src/models/components/responsemcpcallargumentsdeltastreamevent.ts +145 -0
  148. package/src/models/components/responsemcpcallargumentsdonestreamevent.ts +145 -0
  149. package/src/models/components/responseoutputitemstreamevent.ts +144 -0
  150. package/src/models/components/responseoutputtextannotationaddedstreamevent.ts +160 -0
  151. package/src/models/components/responseoutputtextdeltastreamevent.ts +149 -0
  152. package/src/models/components/responseoutputtextdonestreamevent.ts +143 -0
  153. package/src/models/components/responsereasoningdeltastreamevent.ts +164 -0
  154. package/src/models/components/responsereasoningdonestreamevent.ts +159 -0
  155. package/src/models/components/responsereasoningsummarypartstreamevent.ts +171 -0
  156. package/src/models/components/responsereasoningsummarytextdeltastreamevent.ts +159 -0
  157. package/src/models/components/responsereasoningsummarytextdonestreamevent.ts +154 -0
  158. package/src/models/components/responserefusaldeltastreamevent.ts +137 -0
  159. package/src/models/components/responserefusaldonestreamevent.ts +137 -0
  160. package/src/models/operations/createdataset.ts +1 -1
  161. package/src/models/operations/createdatasetitem.ts +4 -4
  162. package/src/models/operations/createdatasource.ts +1 -1
  163. package/src/models/operations/createeval.ts +16 -16
  164. package/src/models/operations/createrouterresponse.ts +468 -101
  165. package/src/models/operations/createtool.ts +6 -6
  166. package/src/models/operations/getalltools.ts +6 -6
  167. package/src/models/operations/getevals.ts +16 -16
  168. package/src/models/operations/getv2humanevalsets.ts +2 -2
  169. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  170. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  171. package/src/models/operations/listdatasets.ts +1 -1
  172. package/src/models/operations/listdatasources.ts +1 -1
  173. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  174. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  175. package/src/models/operations/postv2humanevalsets.ts +2 -2
  176. package/src/models/operations/retrievedatapoint.ts +4 -4
  177. package/src/models/operations/retrievedataset.ts +1 -1
  178. package/src/models/operations/retrievedatasource.ts +1 -1
  179. package/src/models/operations/retrievetool.ts +6 -6
  180. package/src/models/operations/runagent.ts +1 -1
  181. package/src/models/operations/streamrunagent.ts +1 -1
  182. package/src/models/operations/updatedatapoint.ts +4 -4
  183. package/src/models/operations/updatedataset.ts +1 -1
  184. package/src/models/operations/updatedatasource.ts +1 -1
  185. package/src/models/operations/updateeval.ts +16 -16
  186. package/src/models/operations/updatetool.ts +7 -7
  187. package/src/sdk/feedback.ts +1 -1
@@ -0,0 +1,186 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ collectExtraKeys as collectExtraKeys$,
9
+ safeParse,
10
+ } from "../../lib/schemas.js";
11
+ import { ClosedEnum } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+
15
+ /**
16
+ * The event type. Matches the SSE `event` field.
17
+ */
18
+ export const ResponseHostedToolCallStreamEventType = {
19
+ ResponseWebSearchCallInProgress: "response.web_search_call.in_progress",
20
+ ResponseWebSearchCallSearching: "response.web_search_call.searching",
21
+ ResponseWebSearchCallCompleted: "response.web_search_call.completed",
22
+ ResponseFileSearchCallInProgress: "response.file_search_call.in_progress",
23
+ ResponseFileSearchCallSearching: "response.file_search_call.searching",
24
+ ResponseFileSearchCallCompleted: "response.file_search_call.completed",
25
+ ResponseCodeInterpreterCallInProgress:
26
+ "response.code_interpreter_call.in_progress",
27
+ ResponseCodeInterpreterCallInterpreting:
28
+ "response.code_interpreter_call.interpreting",
29
+ ResponseCodeInterpreterCallCompleted:
30
+ "response.code_interpreter_call.completed",
31
+ ResponseImageGenerationCallInProgress:
32
+ "response.image_generation_call.in_progress",
33
+ ResponseImageGenerationCallGenerating:
34
+ "response.image_generation_call.generating",
35
+ ResponseImageGenerationCallCompleted:
36
+ "response.image_generation_call.completed",
37
+ ResponseMcpCallInProgress: "response.mcp_call.in_progress",
38
+ ResponseMcpCallCompleted: "response.mcp_call.completed",
39
+ ResponseMcpCallFailed: "response.mcp_call.failed",
40
+ } as const;
41
+ /**
42
+ * The event type. Matches the SSE `event` field.
43
+ */
44
+ export type ResponseHostedToolCallStreamEventType = ClosedEnum<
45
+ typeof ResponseHostedToolCallStreamEventType
46
+ >;
47
+
48
+ /**
49
+ * The event payload.
50
+ */
51
+ export type ResponseHostedToolCallStreamEventData = {
52
+ /**
53
+ * ID of the output item this event refers to.
54
+ */
55
+ itemId: string;
56
+ /**
57
+ * Index of the output item in the response output array.
58
+ */
59
+ outputIndex: number;
60
+ /**
61
+ * Monotonically increasing sequence number for ordering events.
62
+ */
63
+ sequenceNumber: number;
64
+ /**
65
+ * The event type. Matches the SSE `event` field.
66
+ */
67
+ type: ResponseHostedToolCallStreamEventType;
68
+ additionalProperties?: { [k: string]: any } | undefined;
69
+ };
70
+
71
+ /**
72
+ * The SSE event name, equal to the payload's `type`.
73
+ */
74
+ export const ResponseHostedToolCallStreamEventEvent = {
75
+ ResponseWebSearchCallInProgress: "response.web_search_call.in_progress",
76
+ ResponseWebSearchCallSearching: "response.web_search_call.searching",
77
+ ResponseWebSearchCallCompleted: "response.web_search_call.completed",
78
+ ResponseFileSearchCallInProgress: "response.file_search_call.in_progress",
79
+ ResponseFileSearchCallSearching: "response.file_search_call.searching",
80
+ ResponseFileSearchCallCompleted: "response.file_search_call.completed",
81
+ ResponseCodeInterpreterCallInProgress:
82
+ "response.code_interpreter_call.in_progress",
83
+ ResponseCodeInterpreterCallInterpreting:
84
+ "response.code_interpreter_call.interpreting",
85
+ ResponseCodeInterpreterCallCompleted:
86
+ "response.code_interpreter_call.completed",
87
+ ResponseImageGenerationCallInProgress:
88
+ "response.image_generation_call.in_progress",
89
+ ResponseImageGenerationCallGenerating:
90
+ "response.image_generation_call.generating",
91
+ ResponseImageGenerationCallCompleted:
92
+ "response.image_generation_call.completed",
93
+ ResponseMcpCallInProgress: "response.mcp_call.in_progress",
94
+ ResponseMcpCallCompleted: "response.mcp_call.completed",
95
+ ResponseMcpCallFailed: "response.mcp_call.failed",
96
+ } as const;
97
+ /**
98
+ * The SSE event name, equal to the payload's `type`.
99
+ */
100
+ export type ResponseHostedToolCallStreamEventEvent = ClosedEnum<
101
+ typeof ResponseHostedToolCallStreamEventEvent
102
+ >;
103
+
104
+ export type ResponseHostedToolCallStreamEvent = {
105
+ /**
106
+ * The event payload.
107
+ */
108
+ data: ResponseHostedToolCallStreamEventData;
109
+ /**
110
+ * The SSE event name, equal to the payload's `type`.
111
+ */
112
+ event: ResponseHostedToolCallStreamEventEvent;
113
+ };
114
+
115
+ /** @internal */
116
+ export const ResponseHostedToolCallStreamEventType$inboundSchema:
117
+ z.ZodNativeEnum<typeof ResponseHostedToolCallStreamEventType> = z.nativeEnum(
118
+ ResponseHostedToolCallStreamEventType,
119
+ );
120
+
121
+ /** @internal */
122
+ export const ResponseHostedToolCallStreamEventData$inboundSchema: z.ZodType<
123
+ ResponseHostedToolCallStreamEventData,
124
+ z.ZodTypeDef,
125
+ unknown
126
+ > = collectExtraKeys$(
127
+ z.object({
128
+ item_id: z.string(),
129
+ output_index: z.number().int(),
130
+ sequence_number: z.number().int(),
131
+ type: ResponseHostedToolCallStreamEventType$inboundSchema,
132
+ }).catchall(z.any()),
133
+ "additionalProperties",
134
+ true,
135
+ ).transform((v) => {
136
+ return remap$(v, {
137
+ "item_id": "itemId",
138
+ "output_index": "outputIndex",
139
+ "sequence_number": "sequenceNumber",
140
+ });
141
+ });
142
+
143
+ export function responseHostedToolCallStreamEventDataFromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<ResponseHostedToolCallStreamEventData, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) =>
149
+ ResponseHostedToolCallStreamEventData$inboundSchema.parse(JSON.parse(x)),
150
+ `Failed to parse 'ResponseHostedToolCallStreamEventData' from JSON`,
151
+ );
152
+ }
153
+
154
+ /** @internal */
155
+ export const ResponseHostedToolCallStreamEventEvent$inboundSchema:
156
+ z.ZodNativeEnum<typeof ResponseHostedToolCallStreamEventEvent> = z.nativeEnum(
157
+ ResponseHostedToolCallStreamEventEvent,
158
+ );
159
+
160
+ /** @internal */
161
+ export const ResponseHostedToolCallStreamEvent$inboundSchema: z.ZodType<
162
+ ResponseHostedToolCallStreamEvent,
163
+ z.ZodTypeDef,
164
+ unknown
165
+ > = z.object({
166
+ data: z.unknown().transform((v, ctx) => {
167
+ if (typeof v !== "string") return v;
168
+ try {
169
+ return JSON.parse(v);
170
+ } catch (err) {
171
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
172
+ return z.NEVER;
173
+ }
174
+ }).pipe(z.lazy(() => ResponseHostedToolCallStreamEventData$inboundSchema)),
175
+ event: ResponseHostedToolCallStreamEventEvent$inboundSchema,
176
+ });
177
+
178
+ export function responseHostedToolCallStreamEventFromJSON(
179
+ jsonString: string,
180
+ ): SafeParseResult<ResponseHostedToolCallStreamEvent, SDKValidationError> {
181
+ return safeParse(
182
+ jsonString,
183
+ (x) => ResponseHostedToolCallStreamEvent$inboundSchema.parse(JSON.parse(x)),
184
+ `Failed to parse 'ResponseHostedToolCallStreamEvent' from JSON`,
185
+ );
186
+ }
@@ -0,0 +1,156 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ collectExtraKeys as collectExtraKeys$,
9
+ safeParse,
10
+ } from "../../lib/schemas.js";
11
+ import { ClosedEnum } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+
15
+ /**
16
+ * The event type. Matches the SSE `event` field.
17
+ */
18
+ export const ResponseImageGenerationPartialImageStreamEventType = {
19
+ ResponseImageGenerationCallPartialImage:
20
+ "response.image_generation_call.partial_image",
21
+ } as const;
22
+ /**
23
+ * The event type. Matches the SSE `event` field.
24
+ */
25
+ export type ResponseImageGenerationPartialImageStreamEventType = ClosedEnum<
26
+ typeof ResponseImageGenerationPartialImageStreamEventType
27
+ >;
28
+
29
+ /**
30
+ * The event payload.
31
+ */
32
+ export type ResponseImageGenerationPartialImageStreamEventData = {
33
+ /**
34
+ * ID of the output item this event refers to.
35
+ */
36
+ itemId: string;
37
+ /**
38
+ * Index of the output item in the response output array.
39
+ */
40
+ outputIndex: number;
41
+ /**
42
+ * Base64-encoded partial image.
43
+ */
44
+ partialImageB64: string;
45
+ /**
46
+ * Index of the partial image.
47
+ */
48
+ partialImageIndex: number;
49
+ /**
50
+ * Monotonically increasing sequence number for ordering events.
51
+ */
52
+ sequenceNumber: number;
53
+ /**
54
+ * The event type. Matches the SSE `event` field.
55
+ */
56
+ type: ResponseImageGenerationPartialImageStreamEventType;
57
+ additionalProperties?: { [k: string]: any } | undefined;
58
+ };
59
+
60
+ export type ResponseImageGenerationPartialImageStreamEvent = {
61
+ /**
62
+ * The event payload.
63
+ */
64
+ data: ResponseImageGenerationPartialImageStreamEventData;
65
+ /**
66
+ * The SSE event name, equal to the payload's `type`.
67
+ */
68
+ event: "response.image_generation_call.partial_image";
69
+ };
70
+
71
+ /** @internal */
72
+ export const ResponseImageGenerationPartialImageStreamEventType$inboundSchema:
73
+ z.ZodNativeEnum<typeof ResponseImageGenerationPartialImageStreamEventType> = z
74
+ .nativeEnum(ResponseImageGenerationPartialImageStreamEventType);
75
+
76
+ /** @internal */
77
+ export const ResponseImageGenerationPartialImageStreamEventData$inboundSchema:
78
+ z.ZodType<
79
+ ResponseImageGenerationPartialImageStreamEventData,
80
+ z.ZodTypeDef,
81
+ unknown
82
+ > = collectExtraKeys$(
83
+ z.object({
84
+ item_id: z.string(),
85
+ output_index: z.number().int(),
86
+ partial_image_b64: z.string(),
87
+ partial_image_index: z.number().int(),
88
+ sequence_number: z.number().int(),
89
+ type: ResponseImageGenerationPartialImageStreamEventType$inboundSchema,
90
+ }).catchall(z.any()),
91
+ "additionalProperties",
92
+ true,
93
+ ).transform((v) => {
94
+ return remap$(v, {
95
+ "item_id": "itemId",
96
+ "output_index": "outputIndex",
97
+ "partial_image_b64": "partialImageB64",
98
+ "partial_image_index": "partialImageIndex",
99
+ "sequence_number": "sequenceNumber",
100
+ });
101
+ });
102
+
103
+ export function responseImageGenerationPartialImageStreamEventDataFromJSON(
104
+ jsonString: string,
105
+ ): SafeParseResult<
106
+ ResponseImageGenerationPartialImageStreamEventData,
107
+ SDKValidationError
108
+ > {
109
+ return safeParse(
110
+ jsonString,
111
+ (x) =>
112
+ ResponseImageGenerationPartialImageStreamEventData$inboundSchema.parse(
113
+ JSON.parse(x),
114
+ ),
115
+ `Failed to parse 'ResponseImageGenerationPartialImageStreamEventData' from JSON`,
116
+ );
117
+ }
118
+
119
+ /** @internal */
120
+ export const ResponseImageGenerationPartialImageStreamEvent$inboundSchema:
121
+ z.ZodType<
122
+ ResponseImageGenerationPartialImageStreamEvent,
123
+ z.ZodTypeDef,
124
+ unknown
125
+ > = z.object({
126
+ data: z.unknown().transform((v, ctx) => {
127
+ if (typeof v !== "string") return v;
128
+ try {
129
+ return JSON.parse(v);
130
+ } catch (err) {
131
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
132
+ return z.NEVER;
133
+ }
134
+ }).pipe(
135
+ z.lazy(() =>
136
+ ResponseImageGenerationPartialImageStreamEventData$inboundSchema
137
+ ),
138
+ ),
139
+ event: z.literal("response.image_generation_call.partial_image"),
140
+ });
141
+
142
+ export function responseImageGenerationPartialImageStreamEventFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<
145
+ ResponseImageGenerationPartialImageStreamEvent,
146
+ SDKValidationError
147
+ > {
148
+ return safeParse(
149
+ jsonString,
150
+ (x) =>
151
+ ResponseImageGenerationPartialImageStreamEvent$inboundSchema.parse(
152
+ JSON.parse(x),
153
+ ),
154
+ `Failed to parse 'ResponseImageGenerationPartialImageStreamEvent' from JSON`,
155
+ );
156
+ }
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ collectExtraKeys as collectExtraKeys$,
9
+ safeParse,
10
+ } from "../../lib/schemas.js";
11
+ import { ClosedEnum } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+ import {
15
+ PublicResponseResource,
16
+ PublicResponseResource$inboundSchema,
17
+ } from "./publicresponseresource.js";
18
+
19
+ /**
20
+ * The event type. Matches the SSE `event` field.
21
+ */
22
+ export const ResponseLifecycleStreamEventType = {
23
+ ResponseCreated: "response.created",
24
+ ResponseQueued: "response.queued",
25
+ ResponseInProgress: "response.in_progress",
26
+ ResponseCompleted: "response.completed",
27
+ ResponseFailed: "response.failed",
28
+ ResponseIncomplete: "response.incomplete",
29
+ } as const;
30
+ /**
31
+ * The event type. Matches the SSE `event` field.
32
+ */
33
+ export type ResponseLifecycleStreamEventType = ClosedEnum<
34
+ typeof ResponseLifecycleStreamEventType
35
+ >;
36
+
37
+ /**
38
+ * The event payload.
39
+ */
40
+ export type ResponseLifecycleStreamEventData = {
41
+ response: PublicResponseResource;
42
+ /**
43
+ * Monotonically increasing sequence number for ordering events.
44
+ */
45
+ sequenceNumber: number;
46
+ /**
47
+ * The event type. Matches the SSE `event` field.
48
+ */
49
+ type: ResponseLifecycleStreamEventType;
50
+ additionalProperties?: { [k: string]: any } | undefined;
51
+ };
52
+
53
+ /**
54
+ * The SSE event name, equal to the payload's `type`.
55
+ */
56
+ export const Event = {
57
+ ResponseCreated: "response.created",
58
+ ResponseQueued: "response.queued",
59
+ ResponseInProgress: "response.in_progress",
60
+ ResponseCompleted: "response.completed",
61
+ ResponseFailed: "response.failed",
62
+ ResponseIncomplete: "response.incomplete",
63
+ } as const;
64
+ /**
65
+ * The SSE event name, equal to the payload's `type`.
66
+ */
67
+ export type Event = ClosedEnum<typeof Event>;
68
+
69
+ export type ResponseLifecycleStreamEvent = {
70
+ /**
71
+ * The event payload.
72
+ */
73
+ data: ResponseLifecycleStreamEventData;
74
+ /**
75
+ * The SSE event name, equal to the payload's `type`.
76
+ */
77
+ event: Event;
78
+ };
79
+
80
+ /** @internal */
81
+ export const ResponseLifecycleStreamEventType$inboundSchema: z.ZodNativeEnum<
82
+ typeof ResponseLifecycleStreamEventType
83
+ > = z.nativeEnum(ResponseLifecycleStreamEventType);
84
+
85
+ /** @internal */
86
+ export const ResponseLifecycleStreamEventData$inboundSchema: z.ZodType<
87
+ ResponseLifecycleStreamEventData,
88
+ z.ZodTypeDef,
89
+ unknown
90
+ > = collectExtraKeys$(
91
+ z.object({
92
+ response: PublicResponseResource$inboundSchema,
93
+ sequence_number: z.number().int(),
94
+ type: ResponseLifecycleStreamEventType$inboundSchema,
95
+ }).catchall(z.any()),
96
+ "additionalProperties",
97
+ true,
98
+ ).transform((v) => {
99
+ return remap$(v, {
100
+ "sequence_number": "sequenceNumber",
101
+ });
102
+ });
103
+
104
+ export function responseLifecycleStreamEventDataFromJSON(
105
+ jsonString: string,
106
+ ): SafeParseResult<ResponseLifecycleStreamEventData, SDKValidationError> {
107
+ return safeParse(
108
+ jsonString,
109
+ (x) => ResponseLifecycleStreamEventData$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'ResponseLifecycleStreamEventData' from JSON`,
111
+ );
112
+ }
113
+
114
+ /** @internal */
115
+ export const Event$inboundSchema: z.ZodNativeEnum<typeof Event> = z.nativeEnum(
116
+ Event,
117
+ );
118
+
119
+ /** @internal */
120
+ export const ResponseLifecycleStreamEvent$inboundSchema: z.ZodType<
121
+ ResponseLifecycleStreamEvent,
122
+ z.ZodTypeDef,
123
+ unknown
124
+ > = z.object({
125
+ data: z.unknown().transform((v, ctx) => {
126
+ if (typeof v !== "string") return v;
127
+ try {
128
+ return JSON.parse(v);
129
+ } catch (err) {
130
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
131
+ return z.NEVER;
132
+ }
133
+ }).pipe(z.lazy(() => ResponseLifecycleStreamEventData$inboundSchema)),
134
+ event: Event$inboundSchema,
135
+ });
136
+
137
+ export function responseLifecycleStreamEventFromJSON(
138
+ jsonString: string,
139
+ ): SafeParseResult<ResponseLifecycleStreamEvent, SDKValidationError> {
140
+ return safeParse(
141
+ jsonString,
142
+ (x) => ResponseLifecycleStreamEvent$inboundSchema.parse(JSON.parse(x)),
143
+ `Failed to parse 'ResponseLifecycleStreamEvent' from JSON`,
144
+ );
145
+ }
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ collectExtraKeys as collectExtraKeys$,
9
+ safeParse,
10
+ } from "../../lib/schemas.js";
11
+ import { ClosedEnum } from "../../types/enums.js";
12
+ import { Result as SafeParseResult } from "../../types/fp.js";
13
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
+
15
+ /**
16
+ * The event type. Matches the SSE `event` field.
17
+ */
18
+ export const ResponseMcpCallArgumentsDeltaStreamEventType = {
19
+ ResponseMcpCallArgumentsDelta: "response.mcp_call_arguments.delta",
20
+ } as const;
21
+ /**
22
+ * The event type. Matches the SSE `event` field.
23
+ */
24
+ export type ResponseMcpCallArgumentsDeltaStreamEventType = ClosedEnum<
25
+ typeof ResponseMcpCallArgumentsDeltaStreamEventType
26
+ >;
27
+
28
+ /**
29
+ * The event payload.
30
+ */
31
+ export type ResponseMcpCallArgumentsDeltaStreamEventData = {
32
+ /**
33
+ * Incremental text or argument chunk.
34
+ */
35
+ delta: string;
36
+ /**
37
+ * ID of the output item this event refers to.
38
+ */
39
+ itemId: string;
40
+ /**
41
+ * Index of the output item in the response output array.
42
+ */
43
+ outputIndex: number;
44
+ /**
45
+ * Monotonically increasing sequence number for ordering events.
46
+ */
47
+ sequenceNumber: number;
48
+ /**
49
+ * The event type. Matches the SSE `event` field.
50
+ */
51
+ type: ResponseMcpCallArgumentsDeltaStreamEventType;
52
+ additionalProperties?: { [k: string]: any } | undefined;
53
+ };
54
+
55
+ export type ResponseMcpCallArgumentsDeltaStreamEvent = {
56
+ /**
57
+ * The event payload.
58
+ */
59
+ data: ResponseMcpCallArgumentsDeltaStreamEventData;
60
+ /**
61
+ * The SSE event name, equal to the payload's `type`.
62
+ */
63
+ event: "response.mcp_call_arguments.delta";
64
+ };
65
+
66
+ /** @internal */
67
+ export const ResponseMcpCallArgumentsDeltaStreamEventType$inboundSchema:
68
+ z.ZodNativeEnum<typeof ResponseMcpCallArgumentsDeltaStreamEventType> = z
69
+ .nativeEnum(ResponseMcpCallArgumentsDeltaStreamEventType);
70
+
71
+ /** @internal */
72
+ export const ResponseMcpCallArgumentsDeltaStreamEventData$inboundSchema:
73
+ z.ZodType<
74
+ ResponseMcpCallArgumentsDeltaStreamEventData,
75
+ z.ZodTypeDef,
76
+ unknown
77
+ > = collectExtraKeys$(
78
+ z.object({
79
+ delta: z.string(),
80
+ item_id: z.string(),
81
+ output_index: z.number().int(),
82
+ sequence_number: z.number().int(),
83
+ type: ResponseMcpCallArgumentsDeltaStreamEventType$inboundSchema,
84
+ }).catchall(z.any()),
85
+ "additionalProperties",
86
+ true,
87
+ ).transform((v) => {
88
+ return remap$(v, {
89
+ "item_id": "itemId",
90
+ "output_index": "outputIndex",
91
+ "sequence_number": "sequenceNumber",
92
+ });
93
+ });
94
+
95
+ export function responseMcpCallArgumentsDeltaStreamEventDataFromJSON(
96
+ jsonString: string,
97
+ ): SafeParseResult<
98
+ ResponseMcpCallArgumentsDeltaStreamEventData,
99
+ SDKValidationError
100
+ > {
101
+ return safeParse(
102
+ jsonString,
103
+ (x) =>
104
+ ResponseMcpCallArgumentsDeltaStreamEventData$inboundSchema.parse(
105
+ JSON.parse(x),
106
+ ),
107
+ `Failed to parse 'ResponseMcpCallArgumentsDeltaStreamEventData' from JSON`,
108
+ );
109
+ }
110
+
111
+ /** @internal */
112
+ export const ResponseMcpCallArgumentsDeltaStreamEvent$inboundSchema: z.ZodType<
113
+ ResponseMcpCallArgumentsDeltaStreamEvent,
114
+ z.ZodTypeDef,
115
+ unknown
116
+ > = z.object({
117
+ data: z.unknown().transform((v, ctx) => {
118
+ if (typeof v !== "string") return v;
119
+ try {
120
+ return JSON.parse(v);
121
+ } catch (err) {
122
+ ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
123
+ return z.NEVER;
124
+ }
125
+ }).pipe(
126
+ z.lazy(() => ResponseMcpCallArgumentsDeltaStreamEventData$inboundSchema),
127
+ ),
128
+ event: z.literal("response.mcp_call_arguments.delta"),
129
+ });
130
+
131
+ export function responseMcpCallArgumentsDeltaStreamEventFromJSON(
132
+ jsonString: string,
133
+ ): SafeParseResult<
134
+ ResponseMcpCallArgumentsDeltaStreamEvent,
135
+ SDKValidationError
136
+ > {
137
+ return safeParse(
138
+ jsonString,
139
+ (x) =>
140
+ ResponseMcpCallArgumentsDeltaStreamEvent$inboundSchema.parse(
141
+ JSON.parse(x),
142
+ ),
143
+ `Failed to parse 'ResponseMcpCallArgumentsDeltaStreamEvent' from JSON`,
144
+ );
145
+ }