@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
@@ -18,13 +18,6 @@ export declare const protocol: Protocol<{
18
18
  readonly messages: readonly ({
19
19
  readonly role: "system";
20
20
  readonly content: string | readonly ({
21
- readonly type: "text";
22
- readonly text: string;
23
- readonly cache_control?: {
24
- readonly type: "ephemeral";
25
- readonly ttl?: string | undefined;
26
- } | undefined;
27
- } | {
28
21
  readonly type: "image_url";
29
22
  readonly image_url: {
30
23
  readonly url: string;
@@ -35,17 +28,17 @@ export declare const protocol: Protocol<{
35
28
  readonly filename: string;
36
29
  readonly file_data: string;
37
30
  };
38
- })[];
39
- } | {
40
- readonly role: "user";
41
- readonly content: string | readonly ({
31
+ } | {
42
32
  readonly type: "text";
43
33
  readonly text: string;
44
34
  readonly cache_control?: {
45
35
  readonly type: "ephemeral";
46
36
  readonly ttl?: string | undefined;
47
37
  } | undefined;
48
- } | {
38
+ })[];
39
+ } | {
40
+ readonly role: "user";
41
+ readonly content: string | readonly ({
49
42
  readonly type: "image_url";
50
43
  readonly image_url: {
51
44
  readonly url: string;
@@ -56,6 +49,13 @@ export declare const protocol: Protocol<{
56
49
  readonly filename: string;
57
50
  readonly file_data: string;
58
51
  };
52
+ } | {
53
+ readonly type: "text";
54
+ readonly text: string;
55
+ readonly cache_control?: {
56
+ readonly type: "ephemeral";
57
+ readonly ttl?: string | undefined;
58
+ } | undefined;
59
59
  })[];
60
60
  } | {
61
61
  readonly role: "tool";
@@ -212,13 +212,6 @@ export declare const route: Route<{
212
212
  readonly messages: readonly ({
213
213
  readonly role: "system";
214
214
  readonly content: string | readonly ({
215
- readonly type: "text";
216
- readonly text: string;
217
- readonly cache_control?: {
218
- readonly type: "ephemeral";
219
- readonly ttl?: string | undefined;
220
- } | undefined;
221
- } | {
222
215
  readonly type: "image_url";
223
216
  readonly image_url: {
224
217
  readonly url: string;
@@ -229,17 +222,17 @@ export declare const route: Route<{
229
222
  readonly filename: string;
230
223
  readonly file_data: string;
231
224
  };
232
- })[];
233
- } | {
234
- readonly role: "user";
235
- readonly content: string | readonly ({
225
+ } | {
236
226
  readonly type: "text";
237
227
  readonly text: string;
238
228
  readonly cache_control?: {
239
229
  readonly type: "ephemeral";
240
230
  readonly ttl?: string | undefined;
241
231
  } | undefined;
242
- } | {
232
+ })[];
233
+ } | {
234
+ readonly role: "user";
235
+ readonly content: string | readonly ({
243
236
  readonly type: "image_url";
244
237
  readonly image_url: {
245
238
  readonly url: string;
@@ -250,6 +243,13 @@ export declare const route: Route<{
250
243
  readonly filename: string;
251
244
  readonly file_data: string;
252
245
  };
246
+ } | {
247
+ readonly type: "text";
248
+ readonly text: string;
249
+ readonly cache_control?: {
250
+ readonly type: "ephemeral";
251
+ readonly ttl?: string | undefined;
252
+ } | undefined;
253
253
  })[];
254
254
  } | {
255
255
  readonly role: "tool";
@@ -334,13 +334,6 @@ export declare const routes: Route<{
334
334
  readonly messages: readonly ({
335
335
  readonly role: "system";
336
336
  readonly content: string | readonly ({
337
- readonly type: "text";
338
- readonly text: string;
339
- readonly cache_control?: {
340
- readonly type: "ephemeral";
341
- readonly ttl?: string | undefined;
342
- } | undefined;
343
- } | {
344
337
  readonly type: "image_url";
345
338
  readonly image_url: {
346
339
  readonly url: string;
@@ -351,17 +344,17 @@ export declare const routes: Route<{
351
344
  readonly filename: string;
352
345
  readonly file_data: string;
353
346
  };
354
- })[];
355
- } | {
356
- readonly role: "user";
357
- readonly content: string | readonly ({
347
+ } | {
358
348
  readonly type: "text";
359
349
  readonly text: string;
360
350
  readonly cache_control?: {
361
351
  readonly type: "ephemeral";
362
352
  readonly ttl?: string | undefined;
363
353
  } | undefined;
364
- } | {
354
+ })[];
355
+ } | {
356
+ readonly role: "user";
357
+ readonly content: string | readonly ({
365
358
  readonly type: "image_url";
366
359
  readonly image_url: {
367
360
  readonly url: string;
@@ -372,6 +365,13 @@ export declare const routes: Route<{
372
365
  readonly filename: string;
373
366
  readonly file_data: string;
374
367
  };
368
+ } | {
369
+ readonly type: "text";
370
+ readonly text: string;
371
+ readonly cache_control?: {
372
+ readonly type: "ephemeral";
373
+ readonly ttl?: string | undefined;
374
+ } | undefined;
375
375
  })[];
376
376
  } | {
377
377
  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";
@@ -22,13 +22,6 @@ export declare const routes: Route<{
22
22
  readonly messages: readonly ({
23
23
  readonly role: "system";
24
24
  readonly content: string | readonly ({
25
- readonly type: "text";
26
- readonly text: string;
27
- readonly cache_control?: {
28
- readonly type: "ephemeral";
29
- readonly ttl?: string | undefined;
30
- } | undefined;
31
- } | {
32
25
  readonly type: "image_url";
33
26
  readonly image_url: {
34
27
  readonly url: string;
@@ -39,17 +32,17 @@ export declare const routes: Route<{
39
32
  readonly filename: string;
40
33
  readonly file_data: string;
41
34
  };
42
- })[];
43
- } | {
44
- readonly role: "user";
45
- readonly content: string | readonly ({
35
+ } | {
46
36
  readonly type: "text";
47
37
  readonly text: string;
48
38
  readonly cache_control?: {
49
39
  readonly type: "ephemeral";
50
40
  readonly ttl?: string | undefined;
51
41
  } | undefined;
52
- } | {
42
+ })[];
43
+ } | {
44
+ readonly role: "user";
45
+ readonly content: string | readonly ({
53
46
  readonly type: "image_url";
54
47
  readonly image_url: {
55
48
  readonly url: string;
@@ -60,6 +53,13 @@ export declare const routes: Route<{
60
53
  readonly filename: string;
61
54
  readonly file_data: string;
62
55
  };
56
+ } | {
57
+ readonly type: "text";
58
+ readonly text: string;
59
+ readonly cache_control?: {
60
+ readonly type: "ephemeral";
61
+ readonly ttl?: string | undefined;
62
+ } | undefined;
63
63
  })[];
64
64
  } | {
65
65
  readonly role: "tool";
@@ -27,13 +27,13 @@ export declare const routes: Route<{
27
27
  readonly input: readonly ({
28
28
  readonly type: "model_output" | "user_input";
29
29
  readonly content: readonly ({
30
+ readonly type: "text";
31
+ readonly text: string;
32
+ } | {
30
33
  readonly type: "audio" | "document" | "image" | "video";
31
34
  readonly data?: string | undefined;
32
35
  readonly uri?: string | undefined;
33
36
  readonly mime_type: string;
34
- } | {
35
- readonly type: "text";
36
- readonly text: string;
37
37
  })[];
38
38
  } | {
39
39
  readonly type: "thought";
@@ -161,12 +161,30 @@ export declare const routes: Route<{
161
161
  } | {
162
162
  readonly role: "assistant";
163
163
  readonly content: readonly ({
164
+ readonly type: "compaction";
165
+ readonly content: string | null;
166
+ } | {
164
167
  readonly type: "text";
165
168
  readonly text: string;
166
169
  readonly cache_control?: {
167
170
  readonly type: "ephemeral";
168
171
  readonly ttl?: "1h" | "5m" | undefined;
169
172
  } | undefined;
173
+ } | {
174
+ readonly type: "thinking";
175
+ readonly thinking: string;
176
+ readonly signature: string;
177
+ readonly cache_control?: {
178
+ readonly type: "ephemeral";
179
+ readonly ttl?: "1h" | "5m" | undefined;
180
+ } | undefined;
181
+ } | {
182
+ readonly type: "redacted_thinking";
183
+ readonly data: string;
184
+ readonly cache_control?: {
185
+ readonly type: "ephemeral";
186
+ readonly ttl?: "1h" | "5m" | undefined;
187
+ } | undefined;
170
188
  } | {
171
189
  readonly type: "tool_use";
172
190
  readonly id: string;
@@ -193,24 +211,6 @@ export declare const routes: Route<{
193
211
  readonly type: "ephemeral";
194
212
  readonly ttl?: "1h" | "5m" | undefined;
195
213
  } | undefined;
196
- } | {
197
- readonly type: "compaction";
198
- readonly content: string | null;
199
- } | {
200
- readonly type: "thinking";
201
- readonly thinking: string;
202
- readonly signature: string;
203
- readonly cache_control?: {
204
- readonly type: "ephemeral";
205
- readonly ttl?: "1h" | "5m" | undefined;
206
- } | undefined;
207
- } | {
208
- readonly type: "redacted_thinking";
209
- readonly data: string;
210
- readonly cache_control?: {
211
- readonly type: "ephemeral";
212
- readonly ttl?: "1h" | "5m" | undefined;
213
- } | undefined;
214
214
  })[];
215
215
  } | {
216
216
  readonly role: "system";
@@ -252,6 +252,8 @@ export declare const routes: Route<{
252
252
  readonly top_k?: number | undefined;
253
253
  readonly stop_sequences?: readonly string[] | undefined;
254
254
  readonly thinking?: {
255
+ readonly type: "between_tools" | "disabled";
256
+ } | {
255
257
  readonly display?: import("../schema/options.js").OpenString<"omitted" | "summarized"> | undefined;
256
258
  readonly block_binding?: {
257
259
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
@@ -264,8 +266,6 @@ export declare const routes: Route<{
264
266
  readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"drop_block" | "error"> | undefined;
265
267
  } | undefined;
266
268
  readonly type: "adaptive";
267
- } | {
268
- readonly type: "between_tools" | "disabled";
269
269
  } | undefined;
270
270
  readonly output_config?: {
271
271
  readonly effort?: string | undefined;
@@ -38,6 +38,20 @@ export declare const routes: Route<{
38
38
  readonly type: "document_url";
39
39
  readonly document_url: string;
40
40
  })[];
41
+ } | {
42
+ readonly role: "tool";
43
+ readonly tool_call_id: string;
44
+ readonly name: string;
45
+ readonly content: string | readonly ({
46
+ readonly type: "text";
47
+ readonly text: string;
48
+ } | {
49
+ readonly type: "image_url";
50
+ readonly image_url: string;
51
+ } | {
52
+ readonly type: "document_url";
53
+ readonly document_url: string;
54
+ })[];
41
55
  } | {
42
56
  readonly role: "assistant";
43
57
  readonly content: string | readonly ({
@@ -61,20 +75,6 @@ export declare const routes: Route<{
61
75
  };
62
76
  }[] | undefined;
63
77
  readonly prefix?: true | undefined;
64
- } | {
65
- readonly role: "tool";
66
- readonly tool_call_id: string;
67
- readonly name: string;
68
- readonly content: string | readonly ({
69
- readonly type: "text";
70
- readonly text: string;
71
- } | {
72
- readonly type: "image_url";
73
- readonly image_url: string;
74
- } | {
75
- readonly type: "document_url";
76
- readonly document_url: string;
77
- })[];
78
78
  })[];
79
79
  readonly tools?: readonly {
80
80
  readonly type: "function";
@@ -20,10 +20,6 @@ export type Settings = ProviderPackage.Settings & OpenResponsesProviderOptionsIn
20
20
  export declare const routes: Route<{
21
21
  readonly model: string;
22
22
  readonly input: readonly ({
23
- readonly type: "compaction";
24
- readonly id?: string | null | undefined;
25
- readonly encrypted_content: string;
26
- } | {
27
23
  readonly type: "configuration_update";
28
24
  readonly reasoning: {
29
25
  readonly effort: import("../schema/options.js").ReasoningEffort;
@@ -36,10 +32,45 @@ export declare const routes: Route<{
36
32
  readonly type: "message";
37
33
  readonly role: "developer";
38
34
  readonly content: string;
35
+ } | {
36
+ readonly type: "function_call_output";
37
+ readonly call_id: string;
38
+ readonly output: string | readonly ({
39
+ readonly type: "input_text";
40
+ readonly text: string;
41
+ } | {
42
+ readonly type: "input_video";
43
+ readonly video_url: string;
44
+ } | {
45
+ readonly type: "input_image";
46
+ readonly image_url: string;
47
+ readonly detail?: string | undefined;
48
+ } | {
49
+ readonly type: "input_file";
50
+ readonly filename: string;
51
+ readonly detail?: string | undefined;
52
+ readonly file_data?: string | undefined;
53
+ readonly file_url?: string | undefined;
54
+ })[];
55
+ } | {
56
+ readonly type: "reasoning";
57
+ readonly id?: string | undefined;
58
+ readonly summary: readonly {
59
+ readonly type: "summary_text";
60
+ readonly text: string;
61
+ }[];
62
+ readonly encrypted_content?: string | null | undefined;
63
+ } | {
64
+ readonly type: "compaction";
65
+ readonly id?: string | null | undefined;
66
+ readonly encrypted_content: string;
39
67
  } | {
40
68
  readonly type: "message";
41
69
  readonly role: "user";
42
70
  readonly content: readonly ({
71
+ readonly type: "input_text";
72
+ readonly text: string;
73
+ } | {
43
74
  readonly type: "input_image";
44
75
  readonly image_url: string;
45
76
  readonly detail?: string | undefined;
@@ -49,9 +80,6 @@ export declare const routes: Route<{
49
80
  readonly detail?: string | undefined;
50
81
  readonly file_data?: string | undefined;
51
82
  readonly file_url?: string | undefined;
52
- } | {
53
- readonly type: "input_text";
54
- readonly text: string;
55
83
  })[];
56
84
  readonly id?: string | undefined;
57
85
  readonly status?: string | undefined;
@@ -65,14 +93,6 @@ export declare const routes: Route<{
65
93
  }[];
66
94
  readonly phase?: "commentary" | "final_answer" | null | undefined;
67
95
  readonly status?: string | undefined;
68
- } | {
69
- readonly type: "reasoning";
70
- readonly id?: string | undefined;
71
- readonly summary: readonly {
72
- readonly type: "summary_text";
73
- readonly text: string;
74
- }[];
75
- readonly encrypted_content?: string | null | undefined;
76
96
  } | {
77
97
  readonly type: "function_call";
78
98
  readonly id?: string | undefined;
@@ -80,26 +100,6 @@ export declare const routes: Route<{
80
100
  readonly name: string;
81
101
  readonly namespace?: string | undefined;
82
102
  readonly arguments: string;
83
- } | {
84
- readonly type: "function_call_output";
85
- readonly call_id: string;
86
- readonly output: string | readonly ({
87
- readonly type: "input_image";
88
- readonly image_url: string;
89
- readonly detail?: string | undefined;
90
- } | {
91
- readonly type: "input_file";
92
- readonly filename: string;
93
- readonly detail?: string | undefined;
94
- readonly file_data?: string | undefined;
95
- readonly file_url?: string | undefined;
96
- } | {
97
- readonly type: "input_text";
98
- readonly text: string;
99
- } | {
100
- readonly type: "input_video";
101
- readonly video_url: string;
102
- })[];
103
103
  } | {
104
104
  readonly [x: string]: unknown;
105
105
  readonly type: "web_search_call";
@@ -176,15 +176,15 @@ export declare const routes: Route<{
176
176
  } | undefined;
177
177
  readonly top_logprobs?: number | undefined;
178
178
  readonly truncation?: "auto" | "disabled" | undefined;
179
- readonly service_tier?: import("../protocols/utils/open-responses-options.js").ServiceTier | undefined;
179
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
180
180
  readonly prompt_cache_key?: string | undefined;
181
- readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
181
+ readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
182
182
  readonly reasoning?: {
183
183
  readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
184
184
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
185
185
  } | undefined;
186
186
  readonly text?: {
187
- readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
187
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
188
188
  } | undefined;
189
189
  readonly max_output_tokens?: number | undefined;
190
190
  readonly max_tool_calls?: number | undefined;
@@ -30,27 +30,10 @@ export declare const routes: Route<{
30
30
  readonly contents: readonly {
31
31
  readonly role?: "model" | "user" | null | undefined;
32
32
  readonly parts?: readonly ({
33
- readonly text: string;
34
- readonly thought?: boolean | null | undefined;
35
- readonly thoughtSignature?: string | null | undefined;
36
- } | {
37
- readonly inlineData: {
38
- readonly mimeType: string;
39
- readonly data: string;
40
- };
41
- readonly thoughtSignature?: string | null | undefined;
42
- } | {
43
33
  readonly fileData: {
44
34
  readonly mimeType: string;
45
35
  readonly fileUri: string;
46
36
  };
47
- } | {
48
- readonly functionCall: {
49
- readonly id?: string | null | undefined;
50
- readonly name: string;
51
- readonly args?: unknown;
52
- };
53
- readonly thoughtSignature?: string | null | undefined;
54
37
  } | {
55
38
  readonly functionResponse: {
56
39
  readonly id?: string | undefined;
@@ -64,6 +47,23 @@ export declare const routes: Route<{
64
47
  readonly thoughtSignature?: string | null | undefined;
65
48
  }[] | undefined;
66
49
  };
50
+ } | {
51
+ readonly text: string;
52
+ readonly thought?: boolean | null | undefined;
53
+ readonly thoughtSignature?: string | null | undefined;
54
+ } | {
55
+ readonly inlineData: {
56
+ readonly mimeType: string;
57
+ readonly data: string;
58
+ };
59
+ readonly thoughtSignature?: string | null | undefined;
60
+ } | {
61
+ readonly functionCall: {
62
+ readonly id?: string | null | undefined;
63
+ readonly name: string;
64
+ readonly args?: unknown;
65
+ };
66
+ readonly thoughtSignature?: string | null | undefined;
67
67
  })[] | null | undefined;
68
68
  }[];
69
69
  readonly labels?: {
@@ -28,7 +28,7 @@ const route = Route.make({
28
28
  providerMetadataKey: "vertex",
29
29
  protocol,
30
30
  endpoint: Endpoint.path(({ request }) => {
31
- const model = String(request.model.id);
31
+ const model = request.model.id;
32
32
  return `/${model.startsWith("endpoints/") ? model : `models/${model}`}:streamGenerateContent?alt=sse`;
33
33
  }),
34
34
  auth: Auth.none,
@@ -42,7 +42,7 @@ export const routes = [route];
42
42
  const configuredRoute = (input, modelID) => {
43
43
  const { accessToken: _accessToken, apiKey: _apiKey, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
44
44
  const apiKey = GoogleVertexShared.apiKey(input);
45
- const endpointModel = String(modelID).startsWith("endpoints/");
45
+ const endpointModel = modelID.startsWith("endpoints/");
46
46
  if (apiKey !== undefined && endpointModel)
47
47
  throw new ProviderConfigurationError({
48
48
  provider: id,