@opencode/ai 2.1.2 → 2.1.4

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 (140) hide show
  1. package/dist/cache-policy.js +6 -5
  2. package/dist/experimental/evaluation.d.ts +7 -6
  3. package/dist/experimental/evaluation.js +3 -11
  4. package/dist/experimental/realtime.d.ts +59 -0
  5. package/dist/experimental/realtime.js +21 -13
  6. package/dist/experimental.d.ts +1 -1
  7. package/dist/generation.js +1 -1
  8. package/dist/image-client.d.ts +11 -9
  9. package/dist/image.d.ts +158 -150
  10. package/dist/image.js +2 -2
  11. package/dist/llm.d.ts +2 -4
  12. package/dist/llm.js +2 -2
  13. package/dist/media-model.d.ts +2 -2
  14. package/dist/media-model.js +1 -1
  15. package/dist/promise.d.ts +121 -121
  16. package/dist/promise.js +3 -5
  17. package/dist/protocols/alibaba-chat.d.ts +18 -18
  18. package/dist/protocols/alibaba-chat.js +3 -3
  19. package/dist/protocols/alibaba-messages.d.ts +12 -12
  20. package/dist/protocols/alibaba-messages.js +1 -1
  21. package/dist/protocols/alibaba-responses.d.ts +38 -38
  22. package/dist/protocols/anthropic-messages.d.ts +40 -44
  23. package/dist/protocols/anthropic-messages.js +13 -15
  24. package/dist/protocols/bedrock-converse.d.ts +36 -85
  25. package/dist/protocols/bedrock-converse.js +6 -6
  26. package/dist/protocols/bedrock-event-stream.d.ts +6 -1
  27. package/dist/protocols/bedrock-event-stream.js +9 -8
  28. package/dist/protocols/cartesia-speech.d.ts +32 -32
  29. package/dist/protocols/cohere-chat.d.ts +13 -10
  30. package/dist/protocols/cohere-chat.js +2 -2
  31. package/dist/protocols/deepgram-speech.d.ts +32 -32
  32. package/dist/protocols/elevenlabs-speech.d.ts +32 -32
  33. package/dist/protocols/gemini.d.ts +46 -36
  34. package/dist/protocols/gemini.js +12 -15
  35. package/dist/protocols/google-interactions.d.ts +14 -13
  36. package/dist/protocols/google-interactions.js +16 -11
  37. package/dist/protocols/google-speech.d.ts +32 -32
  38. package/dist/protocols/google-transcription.d.ts +32 -32
  39. package/dist/protocols/meta-messages.d.ts +23 -23
  40. package/dist/protocols/meta-responses.d.ts +84 -84
  41. package/dist/protocols/mistral-chat.d.ts +81 -78
  42. package/dist/protocols/mistral-chat.js +3 -5
  43. package/dist/protocols/open-responses-channel.js +47 -46
  44. package/dist/protocols/open-responses-continuation.d.ts +8 -2
  45. package/dist/protocols/open-responses-continuation.js +3 -1
  46. package/dist/protocols/open-responses.d.ts +419 -419
  47. package/dist/protocols/open-responses.js +11 -10
  48. package/dist/protocols/openai-chat.d.ts +68 -67
  49. package/dist/protocols/openai-chat.js +7 -8
  50. package/dist/protocols/openai-compatible-chat.d.ts +13 -14
  51. package/dist/protocols/openai-compatible-responses.d.ts +39 -40
  52. package/dist/protocols/openai-images.d.ts +32 -32
  53. package/dist/protocols/openai-responses.d.ts +253 -253
  54. package/dist/protocols/openai-responses.js +1 -1
  55. package/dist/protocols/openai-speech.d.ts +32 -32
  56. package/dist/protocols/openai-transcription.d.ts +32 -32
  57. package/dist/protocols/openai-transcription.js +12 -7
  58. package/dist/protocols/utils/open-responses-options.d.ts +8 -8
  59. package/dist/protocols/utils/open-responses-options.js +4 -6
  60. package/dist/protocols/utils/partial-json-options.d.ts +0 -1
  61. package/dist/protocols/utils/partial-json-options.js +0 -1
  62. package/dist/protocols/utils/partial-json.js +5 -4
  63. package/dist/protocols/utils/tool-schema.d.ts +0 -3
  64. package/dist/protocols/utils/tool-schema.js +0 -4
  65. package/dist/protocols/utils/tool-stream.d.ts +1 -1
  66. package/dist/protocols/venice-chat.d.ts +52 -53
  67. package/dist/protocols/venice-chat.js +6 -5
  68. package/dist/protocols/xai-images.js +3 -4
  69. package/dist/protocols/xai-responses.d.ts +81 -81
  70. package/dist/protocols/zai-chat.d.ts +33 -30
  71. package/dist/protocols/zai-chat.js +8 -3
  72. package/dist/protocols/zai-messages.d.ts +21 -19
  73. package/dist/protocols/zai-messages.js +3 -2
  74. package/dist/provider-error.js +8 -7
  75. package/dist/providers/alibaba.d.ts +74 -74
  76. package/dist/providers/amazon-bedrock-mantle.d.ts +202 -202
  77. package/dist/providers/amazon-bedrock.d.ts +16 -13
  78. package/dist/providers/anthropic-compatible.d.ts +13 -13
  79. package/dist/providers/anthropic.d.ts +13 -13
  80. package/dist/providers/azure.d.ts +112 -112
  81. package/dist/providers/baseten.d.ts +24 -24
  82. package/dist/providers/cerebras.d.ts +24 -24
  83. package/dist/providers/cloudflare-ai-gateway.d.ts +237 -234
  84. package/dist/providers/cloudflare-ai-gateway.js +3 -6
  85. package/dist/providers/cloudflare-workers-ai.d.ts +24 -24
  86. package/dist/providers/cohere.d.ts +78 -74
  87. package/dist/providers/deepinfra.d.ts +24 -24
  88. package/dist/providers/deepseek.d.ts +24 -24
  89. package/dist/providers/digitalocean.d.ts +36 -36
  90. package/dist/providers/fireworks.d.ts +24 -24
  91. package/dist/providers/google-vertex-chat.d.ts +12 -12
  92. package/dist/providers/google-vertex-interactions.d.ts +3 -3
  93. package/dist/providers/google-vertex-messages.d.ts +20 -20
  94. package/dist/providers/google-vertex-mistral.d.ts +14 -14
  95. package/dist/providers/google-vertex-responses.d.ts +38 -38
  96. package/dist/providers/google-vertex.d.ts +17 -17
  97. package/dist/providers/google-vertex.js +2 -2
  98. package/dist/providers/google.d.ts +79 -79
  99. package/dist/providers/groq.d.ts +24 -24
  100. package/dist/providers/meta.d.ts +189 -189
  101. package/dist/providers/minimax.d.ts +202 -202
  102. package/dist/providers/mistral.d.ts +28 -28
  103. package/dist/providers/moonshot.d.ts +202 -202
  104. package/dist/providers/open-responses-options.d.ts +0 -1
  105. package/dist/providers/open-responses-options.js +1 -1
  106. package/dist/providers/openai-compatible-responses.d.ts +38 -38
  107. package/dist/providers/openai-compatible.d.ts +12 -12
  108. package/dist/providers/openai-compatible.js +1 -1
  109. package/dist/providers/openai-options.d.ts +3 -4
  110. package/dist/providers/openai-options.js +0 -1
  111. package/dist/providers/openai.d.ts +103 -103
  112. package/dist/providers/openrouter.d.ts +171 -112
  113. package/dist/providers/openrouter.js +40 -33
  114. package/dist/providers/togetherai.d.ts +24 -24
  115. package/dist/providers/venice.d.ts +195 -20
  116. package/dist/providers/xai.d.ts +12 -12
  117. package/dist/providers/zai-coding-plan.d.ts +152 -72
  118. package/dist/providers/zai.d.ts +84 -19
  119. package/dist/route/auth-options.d.ts +0 -3
  120. package/dist/route/auth.d.ts +0 -2
  121. package/dist/route/auth.js +0 -2
  122. package/dist/route/client.d.ts +0 -218
  123. package/dist/route/client.js +3 -7
  124. package/dist/route/executor-service.js +1 -1
  125. package/dist/route/transport/http.js +5 -8
  126. package/dist/schema/errors.d.ts +1 -1
  127. package/dist/schema/errors.js +1 -1
  128. package/dist/schema/messages.js +4 -7
  129. package/dist/speech-client.d.ts +11 -9
  130. package/dist/speech.d.ts +158 -150
  131. package/dist/speech.js +2 -2
  132. package/dist/transcription-client.d.ts +11 -9
  133. package/dist/transcription.d.ts +158 -150
  134. package/dist/transcription.js +2 -2
  135. package/dist/video-client.d.ts +11 -9
  136. package/dist/video.d.ts +124 -116
  137. package/dist/video.js +2 -2
  138. package/package.json +7 -6
  139. package/dist/protocols/utils/openai-options.d.ts +0 -16
  140. package/dist/protocols/utils/openai-options.js +0 -15
@@ -1,7 +1,7 @@
1
- import { Schema } from "effect";
2
1
  import { AnthropicMessages, OpenAIChat, OpenAIResponses } from "../protocols/index.js";
3
2
  import { Auth } from "../route/auth.js";
4
3
  import { ProviderConfigurationError, ProviderID } from "../schema/index.js";
4
+ import { encodeJson } from "../utils/json.js";
5
5
  export const id = ProviderID.make("cloudflare-ai-gateway");
6
6
  export const authEnvVars = ["CLOUDFLARE_API_TOKEN", "CF_AIG_TOKEN"];
7
7
  export const baseURL = (input) => {
@@ -41,9 +41,7 @@ const credential = (input) => Auth.optional(input.gatewayApiKey ?? ("apiKey" in
41
41
  .orElse(Auth.config(authEnvVars[0]))
42
42
  .orElse(Auth.config(authEnvVars[1]));
43
43
  const headers = (input) => ({
44
- ...(input.metadata === undefined
45
- ? {}
46
- : { "cf-aig-metadata": Schema.encodeSync(Schema.fromJsonString(Schema.Unknown))(input.metadata) }),
44
+ ...(input.metadata === undefined ? {} : { "cf-aig-metadata": encodeJson(input.metadata) }),
47
45
  ...(input.cacheTtl === undefined ? {} : { "cf-aig-cache-ttl": String(input.cacheTtl) }),
48
46
  ...(input.cacheKey === undefined ? {} : { "cf-aig-cache-key": input.cacheKey }),
49
47
  ...(input.skipCache === undefined ? {} : { "cf-aig-skip-cache": String(input.skipCache) }),
@@ -74,8 +72,7 @@ export const configure = (input) => {
74
72
  const chat = route.with(rest);
75
73
  return {
76
74
  id,
77
- model: (input) => {
78
- const value = String(input);
75
+ model: (value) => {
79
76
  if (value.startsWith("openai/"))
80
77
  return responses.model({ id: native ? value.slice("openai/".length) : value });
81
78
  if (value.startsWith("anthropic/"))
@@ -21,13 +21,6 @@ export declare const route: Route<{
21
21
  readonly messages: readonly ({
22
22
  readonly role: "system";
23
23
  readonly content: string | readonly ({
24
- readonly type: "text";
25
- readonly text: string;
26
- readonly cache_control?: {
27
- readonly type: "ephemeral";
28
- readonly ttl?: string | undefined;
29
- } | undefined;
30
- } | {
31
24
  readonly type: "image_url";
32
25
  readonly image_url: {
33
26
  readonly url: string;
@@ -38,17 +31,17 @@ export declare const route: Route<{
38
31
  readonly filename: string;
39
32
  readonly file_data: string;
40
33
  };
41
- })[];
42
- } | {
43
- readonly role: "user";
44
- readonly content: string | readonly ({
34
+ } | {
45
35
  readonly type: "text";
46
36
  readonly text: string;
47
37
  readonly cache_control?: {
48
38
  readonly type: "ephemeral";
49
39
  readonly ttl?: string | undefined;
50
40
  } | undefined;
51
- } | {
41
+ })[];
42
+ } | {
43
+ readonly role: "user";
44
+ readonly content: string | readonly ({
52
45
  readonly type: "image_url";
53
46
  readonly image_url: {
54
47
  readonly url: string;
@@ -59,6 +52,13 @@ export declare const route: Route<{
59
52
  readonly filename: string;
60
53
  readonly file_data: string;
61
54
  };
55
+ } | {
56
+ readonly type: "text";
57
+ readonly text: string;
58
+ readonly cache_control?: {
59
+ readonly type: "ephemeral";
60
+ readonly ttl?: string | undefined;
61
+ } | undefined;
62
62
  })[];
63
63
  } | {
64
64
  readonly role: "tool";
@@ -143,13 +143,6 @@ export declare const routes: Route<{
143
143
  readonly messages: readonly ({
144
144
  readonly role: "system";
145
145
  readonly content: string | readonly ({
146
- readonly type: "text";
147
- readonly text: string;
148
- readonly cache_control?: {
149
- readonly type: "ephemeral";
150
- readonly ttl?: string | undefined;
151
- } | undefined;
152
- } | {
153
146
  readonly type: "image_url";
154
147
  readonly image_url: {
155
148
  readonly url: string;
@@ -160,17 +153,17 @@ export declare const routes: Route<{
160
153
  readonly filename: string;
161
154
  readonly file_data: string;
162
155
  };
163
- })[];
164
- } | {
165
- readonly role: "user";
166
- readonly content: string | readonly ({
156
+ } | {
167
157
  readonly type: "text";
168
158
  readonly text: string;
169
159
  readonly cache_control?: {
170
160
  readonly type: "ephemeral";
171
161
  readonly ttl?: string | undefined;
172
162
  } | undefined;
173
- } | {
163
+ })[];
164
+ } | {
165
+ readonly role: "user";
166
+ readonly content: string | readonly ({
174
167
  readonly type: "image_url";
175
168
  readonly image_url: {
176
169
  readonly url: string;
@@ -181,6 +174,13 @@ export declare const routes: Route<{
181
174
  readonly filename: string;
182
175
  readonly file_data: string;
183
176
  };
177
+ } | {
178
+ readonly type: "text";
179
+ readonly text: string;
180
+ readonly cache_control?: {
181
+ readonly type: "ephemeral";
182
+ readonly ttl?: string | undefined;
183
+ } | undefined;
184
184
  })[];
185
185
  } | {
186
186
  readonly role: "tool";
@@ -49,7 +49,9 @@ export declare const route: Route<{
49
49
  readonly function: {
50
50
  readonly name: string;
51
51
  readonly description?: string | undefined;
52
- readonly parameters: unknown;
52
+ readonly parameters: {
53
+ readonly [x: string]: unknown;
54
+ };
53
55
  };
54
56
  }[] | undefined;
55
57
  readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
@@ -71,13 +73,6 @@ export declare const chatRoute: Route<{
71
73
  readonly messages: readonly ({
72
74
  readonly role: "system";
73
75
  readonly content: string | readonly ({
74
- readonly type: "text";
75
- readonly text: string;
76
- readonly cache_control?: {
77
- readonly type: "ephemeral";
78
- readonly ttl?: string | undefined;
79
- } | undefined;
80
- } | {
81
76
  readonly type: "image_url";
82
77
  readonly image_url: {
83
78
  readonly url: string;
@@ -88,17 +83,17 @@ export declare const chatRoute: Route<{
88
83
  readonly filename: string;
89
84
  readonly file_data: string;
90
85
  };
91
- })[];
92
- } | {
93
- readonly role: "user";
94
- readonly content: string | readonly ({
86
+ } | {
95
87
  readonly type: "text";
96
88
  readonly text: string;
97
89
  readonly cache_control?: {
98
90
  readonly type: "ephemeral";
99
91
  readonly ttl?: string | undefined;
100
92
  } | undefined;
101
- } | {
93
+ })[];
94
+ } | {
95
+ readonly role: "user";
96
+ readonly content: string | readonly ({
102
97
  readonly type: "image_url";
103
98
  readonly image_url: {
104
99
  readonly url: string;
@@ -109,6 +104,13 @@ export declare const chatRoute: Route<{
109
104
  readonly filename: string;
110
105
  readonly file_data: string;
111
106
  };
107
+ } | {
108
+ readonly type: "text";
109
+ readonly text: string;
110
+ readonly cache_control?: {
111
+ readonly type: "ephemeral";
112
+ readonly ttl?: string | undefined;
113
+ } | undefined;
112
114
  })[];
113
115
  } | {
114
116
  readonly role: "tool";
@@ -190,16 +192,60 @@ export declare const chatRoute: Route<{
190
192
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
191
193
  export declare const routes: (Route<{
192
194
  readonly model: string;
193
- readonly messages: readonly ({
194
- readonly role: "system";
195
- readonly content: string | readonly ({
195
+ readonly messages: readonly {
196
+ readonly role: "assistant" | "system" | "tool" | "user";
197
+ readonly content?: string | readonly ({
196
198
  readonly type: "text";
197
199
  readonly text: string;
198
- readonly cache_control?: {
199
- readonly type: "ephemeral";
200
- readonly ttl?: string | undefined;
201
- } | undefined;
202
200
  } | {
201
+ readonly type: "thinking";
202
+ readonly thinking: string;
203
+ } | {
204
+ readonly type: "image_url";
205
+ readonly image_url: {
206
+ readonly url: string;
207
+ };
208
+ })[] | undefined;
209
+ readonly tool_calls?: readonly {
210
+ readonly id: string;
211
+ readonly type: "function";
212
+ readonly function: {
213
+ readonly name: string;
214
+ readonly arguments: string;
215
+ };
216
+ }[] | undefined;
217
+ readonly tool_call_id?: string | undefined;
218
+ readonly tool_plan?: string | undefined;
219
+ }[];
220
+ readonly stream: true;
221
+ readonly tools?: readonly {
222
+ readonly type: "function";
223
+ readonly function: {
224
+ readonly name: string;
225
+ readonly description?: string | undefined;
226
+ readonly parameters: {
227
+ readonly [x: string]: unknown;
228
+ };
229
+ };
230
+ }[] | undefined;
231
+ readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
232
+ readonly thinking?: {
233
+ readonly type: string;
234
+ readonly token_budget?: number | undefined;
235
+ } | undefined;
236
+ readonly max_tokens?: number | undefined;
237
+ readonly temperature?: number | undefined;
238
+ readonly p?: number | undefined;
239
+ readonly k?: number | undefined;
240
+ readonly seed?: number | undefined;
241
+ readonly stop_sequences?: readonly string[] | undefined;
242
+ readonly frequency_penalty?: number | undefined;
243
+ readonly presence_penalty?: number | undefined;
244
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
245
+ readonly model: string;
246
+ readonly messages: readonly ({
247
+ readonly role: "system";
248
+ readonly content: string | readonly ({
203
249
  readonly type: "image_url";
204
250
  readonly image_url: {
205
251
  readonly url: string;
@@ -210,17 +256,17 @@ export declare const routes: (Route<{
210
256
  readonly filename: string;
211
257
  readonly file_data: string;
212
258
  };
213
- })[];
214
- } | {
215
- readonly role: "user";
216
- readonly content: string | readonly ({
259
+ } | {
217
260
  readonly type: "text";
218
261
  readonly text: string;
219
262
  readonly cache_control?: {
220
263
  readonly type: "ephemeral";
221
264
  readonly ttl?: string | undefined;
222
265
  } | undefined;
223
- } | {
266
+ })[];
267
+ } | {
268
+ readonly role: "user";
269
+ readonly content: string | readonly ({
224
270
  readonly type: "image_url";
225
271
  readonly image_url: {
226
272
  readonly url: string;
@@ -231,6 +277,13 @@ export declare const routes: (Route<{
231
277
  readonly filename: string;
232
278
  readonly file_data: string;
233
279
  };
280
+ } | {
281
+ readonly type: "text";
282
+ readonly text: string;
283
+ readonly cache_control?: {
284
+ readonly type: "ephemeral";
285
+ readonly ttl?: string | undefined;
286
+ } | undefined;
234
287
  })[];
235
288
  } | {
236
289
  readonly role: "tool";
@@ -309,55 +362,6 @@ export declare const routes: (Route<{
309
362
  readonly presence_penalty?: number | undefined;
310
363
  readonly seed?: number | undefined;
311
364
  readonly stop?: readonly string[] | undefined;
312
- }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
313
- readonly model: string;
314
- readonly messages: readonly {
315
- readonly role: "assistant" | "system" | "tool" | "user";
316
- readonly content?: string | readonly ({
317
- readonly type: "text";
318
- readonly text: string;
319
- } | {
320
- readonly type: "thinking";
321
- readonly thinking: string;
322
- } | {
323
- readonly type: "image_url";
324
- readonly image_url: {
325
- readonly url: string;
326
- };
327
- })[] | undefined;
328
- readonly tool_calls?: readonly {
329
- readonly id: string;
330
- readonly type: "function";
331
- readonly function: {
332
- readonly name: string;
333
- readonly arguments: string;
334
- };
335
- }[] | undefined;
336
- readonly tool_call_id?: string | undefined;
337
- readonly tool_plan?: string | undefined;
338
- }[];
339
- readonly stream: true;
340
- readonly tools?: readonly {
341
- readonly type: "function";
342
- readonly function: {
343
- readonly name: string;
344
- readonly description?: string | undefined;
345
- readonly parameters: unknown;
346
- };
347
- }[] | undefined;
348
- readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
349
- readonly thinking?: {
350
- readonly type: string;
351
- readonly token_budget?: number | undefined;
352
- } | undefined;
353
- readonly max_tokens?: number | undefined;
354
- readonly temperature?: number | undefined;
355
- readonly p?: number | undefined;
356
- readonly k?: number | undefined;
357
- readonly seed?: number | undefined;
358
- readonly stop_sequences?: readonly string[] | undefined;
359
- readonly frequency_penalty?: number | undefined;
360
- readonly presence_penalty?: number | undefined;
361
365
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
362
366
  export declare const configure: (input?: LanguageModelOptions) => {
363
367
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
@@ -17,13 +17,6 @@ export declare const route: Route<{
17
17
  readonly messages: readonly ({
18
18
  readonly role: "system";
19
19
  readonly content: string | readonly ({
20
- readonly type: "text";
21
- readonly text: string;
22
- readonly cache_control?: {
23
- readonly type: "ephemeral";
24
- readonly ttl?: string | undefined;
25
- } | undefined;
26
- } | {
27
20
  readonly type: "image_url";
28
21
  readonly image_url: {
29
22
  readonly url: string;
@@ -34,17 +27,17 @@ export declare const route: Route<{
34
27
  readonly filename: string;
35
28
  readonly file_data: string;
36
29
  };
37
- })[];
38
- } | {
39
- readonly role: "user";
40
- readonly content: string | readonly ({
30
+ } | {
41
31
  readonly type: "text";
42
32
  readonly text: string;
43
33
  readonly cache_control?: {
44
34
  readonly type: "ephemeral";
45
35
  readonly ttl?: string | undefined;
46
36
  } | undefined;
47
- } | {
37
+ })[];
38
+ } | {
39
+ readonly role: "user";
40
+ readonly content: string | readonly ({
48
41
  readonly type: "image_url";
49
42
  readonly image_url: {
50
43
  readonly url: string;
@@ -55,6 +48,13 @@ export declare const route: Route<{
55
48
  readonly filename: string;
56
49
  readonly file_data: string;
57
50
  };
51
+ } | {
52
+ readonly type: "text";
53
+ readonly text: string;
54
+ readonly cache_control?: {
55
+ readonly type: "ephemeral";
56
+ readonly ttl?: string | undefined;
57
+ } | undefined;
58
58
  })[];
59
59
  } | {
60
60
  readonly role: "tool";
@@ -139,13 +139,6 @@ export declare const routes: Route<{
139
139
  readonly messages: readonly ({
140
140
  readonly role: "system";
141
141
  readonly content: string | readonly ({
142
- readonly type: "text";
143
- readonly text: string;
144
- readonly cache_control?: {
145
- readonly type: "ephemeral";
146
- readonly ttl?: string | undefined;
147
- } | undefined;
148
- } | {
149
142
  readonly type: "image_url";
150
143
  readonly image_url: {
151
144
  readonly url: string;
@@ -156,17 +149,17 @@ export declare const routes: Route<{
156
149
  readonly filename: string;
157
150
  readonly file_data: string;
158
151
  };
159
- })[];
160
- } | {
161
- readonly role: "user";
162
- readonly content: string | readonly ({
152
+ } | {
163
153
  readonly type: "text";
164
154
  readonly text: string;
165
155
  readonly cache_control?: {
166
156
  readonly type: "ephemeral";
167
157
  readonly ttl?: string | undefined;
168
158
  } | undefined;
169
- } | {
159
+ })[];
160
+ } | {
161
+ readonly role: "user";
162
+ readonly content: string | readonly ({
170
163
  readonly type: "image_url";
171
164
  readonly image_url: {
172
165
  readonly url: string;
@@ -177,6 +170,13 @@ export declare const routes: Route<{
177
170
  readonly filename: string;
178
171
  readonly file_data: string;
179
172
  };
173
+ } | {
174
+ readonly type: "text";
175
+ readonly text: string;
176
+ readonly cache_control?: {
177
+ readonly type: "ephemeral";
178
+ readonly ttl?: string | undefined;
179
+ } | undefined;
180
180
  })[];
181
181
  } | {
182
182
  readonly role: "tool";
@@ -17,13 +17,6 @@ export declare const route: Route<{
17
17
  readonly messages: readonly ({
18
18
  readonly role: "system";
19
19
  readonly content: string | readonly ({
20
- readonly type: "text";
21
- readonly text: string;
22
- readonly cache_control?: {
23
- readonly type: "ephemeral";
24
- readonly ttl?: string | undefined;
25
- } | undefined;
26
- } | {
27
20
  readonly type: "image_url";
28
21
  readonly image_url: {
29
22
  readonly url: string;
@@ -34,17 +27,17 @@ export declare const route: Route<{
34
27
  readonly filename: string;
35
28
  readonly file_data: string;
36
29
  };
37
- })[];
38
- } | {
39
- readonly role: "user";
40
- readonly content: string | readonly ({
30
+ } | {
41
31
  readonly type: "text";
42
32
  readonly text: string;
43
33
  readonly cache_control?: {
44
34
  readonly type: "ephemeral";
45
35
  readonly ttl?: string | undefined;
46
36
  } | undefined;
47
- } | {
37
+ })[];
38
+ } | {
39
+ readonly role: "user";
40
+ readonly content: string | readonly ({
48
41
  readonly type: "image_url";
49
42
  readonly image_url: {
50
43
  readonly url: string;
@@ -55,6 +48,13 @@ export declare const route: Route<{
55
48
  readonly filename: string;
56
49
  readonly file_data: string;
57
50
  };
51
+ } | {
52
+ readonly type: "text";
53
+ readonly text: string;
54
+ readonly cache_control?: {
55
+ readonly type: "ephemeral";
56
+ readonly ttl?: string | undefined;
57
+ } | undefined;
58
58
  })[];
59
59
  } | {
60
60
  readonly role: "tool";
@@ -139,13 +139,6 @@ export declare const routes: Route<{
139
139
  readonly messages: readonly ({
140
140
  readonly role: "system";
141
141
  readonly content: string | readonly ({
142
- readonly type: "text";
143
- readonly text: string;
144
- readonly cache_control?: {
145
- readonly type: "ephemeral";
146
- readonly ttl?: string | undefined;
147
- } | undefined;
148
- } | {
149
142
  readonly type: "image_url";
150
143
  readonly image_url: {
151
144
  readonly url: string;
@@ -156,17 +149,17 @@ export declare const routes: Route<{
156
149
  readonly filename: string;
157
150
  readonly file_data: string;
158
151
  };
159
- })[];
160
- } | {
161
- readonly role: "user";
162
- readonly content: string | readonly ({
152
+ } | {
163
153
  readonly type: "text";
164
154
  readonly text: string;
165
155
  readonly cache_control?: {
166
156
  readonly type: "ephemeral";
167
157
  readonly ttl?: string | undefined;
168
158
  } | undefined;
169
- } | {
159
+ })[];
160
+ } | {
161
+ readonly role: "user";
162
+ readonly content: string | readonly ({
170
163
  readonly type: "image_url";
171
164
  readonly image_url: {
172
165
  readonly url: string;
@@ -177,6 +170,13 @@ export declare const routes: Route<{
177
170
  readonly filename: string;
178
171
  readonly file_data: string;
179
172
  };
173
+ } | {
174
+ readonly type: "text";
175
+ readonly text: string;
176
+ readonly cache_control?: {
177
+ readonly type: "ephemeral";
178
+ readonly ttl?: string | undefined;
179
+ } | undefined;
180
180
  })[];
181
181
  } | {
182
182
  readonly role: "tool";