@opencode/ai 0.0.0-dev-21106 → 0.0.0-dev-21108

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 (126) hide show
  1. package/dist/ai-client.d.ts +2 -2
  2. package/dist/experimental/evaluation-client.d.ts +1 -1
  3. package/dist/experimental/evaluation.d.ts +20 -20
  4. package/dist/experimental/realtime.d.ts +1 -13
  5. package/dist/experimental/system-one.d.ts +1 -1
  6. package/dist/image-client.d.ts +8 -8
  7. package/dist/image.d.ts +593 -437
  8. package/dist/llm.d.ts +51 -51
  9. package/dist/media-client.d.ts +1 -1
  10. package/dist/media.d.ts +4 -4
  11. package/dist/promise.d.ts +199 -198
  12. package/dist/protocols/alibaba-chat.d.ts +81 -81
  13. package/dist/protocols/alibaba-messages.d.ts +99 -99
  14. package/dist/protocols/alibaba-responses.d.ts +119 -119
  15. package/dist/protocols/anthropic-messages.d.ts +187 -187
  16. package/dist/protocols/assemblyai-transcription.d.ts +1 -1
  17. package/dist/protocols/bedrock-converse.d.ts +75 -79
  18. package/dist/protocols/bfl-images.d.ts +1 -1
  19. package/dist/protocols/cartesia-speech.d.ts +17 -17
  20. package/dist/protocols/cohere-chat.d.ts +26 -25
  21. package/dist/protocols/deepgram-speech.d.ts +17 -17
  22. package/dist/protocols/deepgram-transcription.d.ts +1 -1
  23. package/dist/protocols/elevenlabs-speech.d.ts +17 -17
  24. package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
  25. package/dist/protocols/fal-images.d.ts +1 -1
  26. package/dist/protocols/fal-video.d.ts +1 -1
  27. package/dist/protocols/gemini.d.ts +55 -55
  28. package/dist/protocols/google-images.d.ts +1 -1
  29. package/dist/protocols/google-interactions.d.ts +64 -64
  30. package/dist/protocols/google-speech.d.ts +17 -17
  31. package/dist/protocols/google-transcription.d.ts +47 -47
  32. package/dist/protocols/google-video.d.ts +1 -1
  33. package/dist/protocols/meta-messages.d.ts +121 -121
  34. package/dist/protocols/meta-responses.d.ts +200 -200
  35. package/dist/protocols/mistral-chat.d.ts +45 -45
  36. package/dist/protocols/open-responses-channel.d.ts +1 -1
  37. package/dist/protocols/open-responses.d.ts +394 -394
  38. package/dist/protocols/openai-chat.d.ts +248 -248
  39. package/dist/protocols/openai-compatible-chat.d.ts +32 -32
  40. package/dist/protocols/openai-compatible-responses.d.ts +88 -88
  41. package/dist/protocols/openai-images.d.ts +17 -17
  42. package/dist/protocols/openai-responses.d.ts +566 -566
  43. package/dist/protocols/openai-responses.js +1 -1
  44. package/dist/protocols/openai-speech.d.ts +17 -17
  45. package/dist/protocols/openai-transcription.d.ts +47 -47
  46. package/dist/protocols/replicate-images.d.ts +1 -1
  47. package/dist/protocols/runway-video.d.ts +1 -1
  48. package/dist/protocols/shared.d.ts +1 -1
  49. package/dist/protocols/stability-images.d.ts +2 -2
  50. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  51. package/dist/protocols/utils/bedrock-media.d.ts +4 -4
  52. package/dist/protocols/utils/openai-options.d.ts +1 -1
  53. package/dist/protocols/utils/speech-stream.d.ts +1 -1
  54. package/dist/protocols/utils/tool-schema.d.ts +10 -5
  55. package/dist/protocols/utils/tool-stream.d.ts +152 -152
  56. package/dist/protocols/venice-chat.d.ts +109 -109
  57. package/dist/protocols/xai-images.d.ts +1 -1
  58. package/dist/protocols/xai-responses.d.ts +78 -78
  59. package/dist/protocols/xai-video.d.ts +1 -1
  60. package/dist/protocols/zai-chat.d.ts +77 -77
  61. package/dist/protocols/zai-images.d.ts +1 -1
  62. package/dist/protocols/zai-messages.d.ts +97 -97
  63. package/dist/providers/alibaba.d.ts +222 -283
  64. package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
  65. package/dist/providers/amazon-bedrock.d.ts +22 -28
  66. package/dist/providers/anthropic-compatible.d.ts +86 -90
  67. package/dist/providers/anthropic.d.ts +86 -90
  68. package/dist/providers/assemblyai.d.ts +2 -6
  69. package/dist/providers/azure.d.ts +228 -238
  70. package/dist/providers/baseten.d.ts +66 -70
  71. package/dist/providers/black-forest-labs.d.ts +2 -6
  72. package/dist/providers/cartesia.d.ts +2 -6
  73. package/dist/providers/cerebras.d.ts +66 -70
  74. package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
  75. package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
  76. package/dist/providers/cohere.d.ts +122 -132
  77. package/dist/providers/deepgram.d.ts +2 -7
  78. package/dist/providers/deepinfra.d.ts +66 -70
  79. package/dist/providers/deepseek.d.ts +66 -70
  80. package/dist/providers/digitalocean.d.ts +137 -141
  81. package/dist/providers/elevenlabs.d.ts +2 -7
  82. package/dist/providers/fal.d.ts +2 -7
  83. package/dist/providers/fireworks.d.ts +66 -70
  84. package/dist/providers/google-vertex-chat.d.ts +34 -38
  85. package/dist/providers/google-vertex-interactions.d.ts +31 -41
  86. package/dist/providers/google-vertex-messages.d.ts +81 -85
  87. package/dist/providers/google-vertex-mistral.d.ts +23 -27
  88. package/dist/providers/google-vertex-responses.d.ts +90 -94
  89. package/dist/providers/google-vertex.d.ts +26 -30
  90. package/dist/providers/google.d.ts +94 -109
  91. package/dist/providers/groq.d.ts +111 -115
  92. package/dist/providers/meta.d.ts +309 -317
  93. package/dist/providers/minimax.d.ts +296 -303
  94. package/dist/providers/mistral.d.ts +22 -26
  95. package/dist/providers/moonshot.d.ts +296 -303
  96. package/dist/providers/openai-compatible-responses.d.ts +90 -94
  97. package/dist/providers/openai-compatible.d.ts +34 -38
  98. package/dist/providers/openai.d.ts +93 -108
  99. package/dist/providers/opencode.d.ts +2 -8
  100. package/dist/providers/openrouter.d.ts +137 -144
  101. package/dist/providers/replicate.d.ts +2 -6
  102. package/dist/providers/runway.d.ts +2 -6
  103. package/dist/providers/stability.d.ts +2 -7
  104. package/dist/providers/togetherai.d.ts +66 -70
  105. package/dist/providers/typesafe-ai.d.ts +2 -8
  106. package/dist/providers/venice.d.ts +58 -63
  107. package/dist/providers/vercel-ai-gateway.d.ts +2 -12
  108. package/dist/providers/xai.d.ts +38 -50
  109. package/dist/providers/zai-coding-plan.d.ts +206 -213
  110. package/dist/providers/zai.d.ts +40 -46
  111. package/dist/route/client.d.ts +51 -51
  112. package/dist/route/media-protocol.d.ts +1 -1
  113. package/dist/route/transport/http.d.ts +1 -1
  114. package/dist/route/transport/websocket.d.ts +8 -8
  115. package/dist/schema/errors.d.ts +19 -19
  116. package/dist/schema/events.d.ts +3090 -3288
  117. package/dist/schema/messages.d.ts +8 -7
  118. package/dist/speech-client.d.ts +8 -8
  119. package/dist/speech.d.ts +434 -398
  120. package/dist/testing.d.ts +338 -338
  121. package/dist/tool-runtime.d.ts +1 -1
  122. package/dist/transcription-client.d.ts +23 -23
  123. package/dist/transcription.d.ts +562 -646
  124. package/dist/video-client.d.ts +8 -8
  125. package/dist/video.d.ts +416 -372
  126. package/package.json +6 -6
@@ -37,5 +37,5 @@ export declare const AssemblyAITranscription: {
37
37
  readonly protocol: MediaProtocol.Queued<Request, TranscriptionResponse, {
38
38
  readonly transcriptID: string;
39
39
  }>;
40
- readonly model: (input: MediaRoute.ModelInput) => TranscriptionModel<AssemblyAITranscriptionOptions>;
40
+ readonly model: typeof model;
41
41
  };
@@ -133,21 +133,12 @@ declare const Options: Schema.Struct<{
133
133
  }>>;
134
134
  }>;
135
135
  export type OptionsInput = typeof Options.Type;
136
- interface ParserState {
137
- readonly providerMetadataKey: string;
138
- readonly tools: ToolStream.State<number>;
139
- readonly finishReason: FinishReasonDetails | undefined;
140
- readonly usage: Usage | undefined;
141
- readonly hasToolCalls: boolean;
142
- readonly lifecycle: Lifecycle.State;
143
- readonly reasoningSignatures: Readonly<Record<number, string>>;
144
- readonly reasoningRedactedContent: Readonly<Record<number, Uint8Array[]>>;
145
- }
146
136
  /**
147
137
  * The Bedrock Converse protocol — request body construction, body schema, and
148
138
  * the streaming-event state machine.
149
139
  */
150
140
  export declare const protocol: Protocol<{
141
+ readonly modelId: string;
151
142
  readonly messages: readonly ({
152
143
  readonly role: "user";
153
144
  readonly content: readonly ({
@@ -155,35 +146,21 @@ export declare const protocol: Protocol<{
155
146
  readonly type: "default";
156
147
  readonly ttl?: "1h" | "5m" | undefined;
157
148
  };
158
- } | {
159
- readonly image: {
160
- readonly format: "png" | "jpeg" | "gif" | "webp";
161
- readonly source: {
162
- readonly bytes: string;
163
- };
164
- };
165
- } | {
166
- readonly document: {
167
- readonly format: "pdf" | "txt" | "md" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html";
168
- readonly name: string;
169
- readonly source: {
170
- readonly bytes: string;
171
- };
172
- };
173
149
  } | {
174
150
  readonly text: string;
175
151
  } | {
176
152
  readonly toolResult: {
153
+ readonly toolUseId: string;
177
154
  readonly content: readonly ({
178
155
  readonly image: {
179
- readonly format: "png" | "jpeg" | "gif" | "webp";
156
+ readonly format: "gif" | "jpeg" | "png" | "webp";
180
157
  readonly source: {
181
158
  readonly bytes: string;
182
159
  };
183
160
  };
184
161
  } | {
185
162
  readonly document: {
186
- readonly format: "pdf" | "txt" | "md" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html";
163
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
187
164
  readonly name: string;
188
165
  readonly source: {
189
166
  readonly bytes: string;
@@ -194,9 +171,23 @@ export declare const protocol: Protocol<{
194
171
  } | {
195
172
  readonly json: unknown;
196
173
  })[];
197
- readonly toolUseId: string;
198
174
  readonly status?: "error" | "success" | undefined;
199
175
  };
176
+ } | {
177
+ readonly image: {
178
+ readonly format: "gif" | "jpeg" | "png" | "webp";
179
+ readonly source: {
180
+ readonly bytes: string;
181
+ };
182
+ };
183
+ } | {
184
+ readonly document: {
185
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
186
+ readonly name: string;
187
+ readonly source: {
188
+ readonly bytes: string;
189
+ };
190
+ };
200
191
  })[];
201
192
  } | {
202
193
  readonly role: "assistant";
@@ -224,7 +215,6 @@ export declare const protocol: Protocol<{
224
215
  };
225
216
  })[];
226
217
  })[];
227
- readonly modelId: string;
228
218
  readonly system?: readonly ({
229
219
  readonly cachePoint: {
230
220
  readonly type: "default";
@@ -234,8 +224,8 @@ export declare const protocol: Protocol<{
234
224
  readonly text: string;
235
225
  })[] | undefined;
236
226
  readonly inferenceConfig?: {
237
- readonly temperature?: number | undefined;
238
227
  readonly maxTokens?: number | undefined;
228
+ readonly temperature?: number | undefined;
239
229
  readonly topP?: number | undefined;
240
230
  readonly stopSequences?: readonly string[] | undefined;
241
231
  } | undefined;
@@ -248,12 +238,12 @@ export declare const protocol: Protocol<{
248
238
  } | {
249
239
  readonly toolSpec: {
250
240
  readonly name: string;
241
+ readonly description?: string | undefined;
251
242
  readonly inputSchema: {
252
243
  readonly json: {
253
244
  readonly [x: string]: unknown;
254
245
  };
255
246
  };
256
- readonly description?: string | undefined;
257
247
  };
258
248
  })[];
259
249
  readonly toolChoice?: {
@@ -270,24 +260,6 @@ export declare const protocol: Protocol<{
270
260
  readonly [x: string]: unknown;
271
261
  } | undefined;
272
262
  }, {
273
- readonly metadata?: {
274
- readonly usage?: {
275
- readonly inputTokens?: number | undefined;
276
- readonly outputTokens?: number | undefined;
277
- readonly cacheReadInputTokens?: number | undefined;
278
- readonly cacheWriteInputTokens?: number | undefined;
279
- readonly totalTokens?: number | undefined;
280
- } | undefined;
281
- readonly metrics?: unknown;
282
- } | undefined;
283
- readonly exception?: {
284
- readonly type: string;
285
- readonly details: {
286
- readonly message?: string | undefined;
287
- readonly originalMessage?: string | undefined;
288
- readonly originalStatusCode?: number | undefined;
289
- };
290
- } | undefined;
291
263
  readonly messageStart?: {
292
264
  readonly role: string;
293
265
  } | undefined;
@@ -308,10 +280,10 @@ export declare const protocol: Protocol<{
308
280
  readonly input: string;
309
281
  } | undefined;
310
282
  readonly reasoningContent?: {
311
- readonly data?: string | undefined;
312
283
  readonly text?: string | undefined;
313
284
  readonly signature?: string | undefined;
314
285
  readonly redactedContent?: string | undefined;
286
+ readonly data?: string | undefined;
315
287
  } | undefined;
316
288
  } | undefined;
317
289
  } | undefined;
@@ -322,14 +294,13 @@ export declare const protocol: Protocol<{
322
294
  readonly stopReason: string;
323
295
  readonly additionalModelResponseFields?: unknown;
324
296
  } | undefined;
325
- }, {
326
297
  readonly metadata?: {
327
298
  readonly usage?: {
328
299
  readonly inputTokens?: number | undefined;
329
300
  readonly outputTokens?: number | undefined;
301
+ readonly totalTokens?: number | undefined;
330
302
  readonly cacheReadInputTokens?: number | undefined;
331
303
  readonly cacheWriteInputTokens?: number | undefined;
332
- readonly totalTokens?: number | undefined;
333
304
  } | undefined;
334
305
  readonly metrics?: unknown;
335
306
  } | undefined;
@@ -341,6 +312,7 @@ export declare const protocol: Protocol<{
341
312
  readonly originalStatusCode?: number | undefined;
342
313
  };
343
314
  } | undefined;
315
+ }, {
344
316
  readonly messageStart?: {
345
317
  readonly role: string;
346
318
  } | undefined;
@@ -361,10 +333,10 @@ export declare const protocol: Protocol<{
361
333
  readonly input: string;
362
334
  } | undefined;
363
335
  readonly reasoningContent?: {
364
- readonly data?: string | undefined;
365
336
  readonly text?: string | undefined;
366
337
  readonly signature?: string | undefined;
367
338
  readonly redactedContent?: string | undefined;
339
+ readonly data?: string | undefined;
368
340
  } | undefined;
369
341
  } | undefined;
370
342
  } | undefined;
@@ -375,8 +347,36 @@ export declare const protocol: Protocol<{
375
347
  readonly stopReason: string;
376
348
  readonly additionalModelResponseFields?: unknown;
377
349
  } | undefined;
378
- }, ParserState>;
350
+ readonly metadata?: {
351
+ readonly usage?: {
352
+ readonly inputTokens?: number | undefined;
353
+ readonly outputTokens?: number | undefined;
354
+ readonly totalTokens?: number | undefined;
355
+ readonly cacheReadInputTokens?: number | undefined;
356
+ readonly cacheWriteInputTokens?: number | undefined;
357
+ } | undefined;
358
+ readonly metrics?: unknown;
359
+ } | undefined;
360
+ readonly exception?: {
361
+ readonly type: string;
362
+ readonly details: {
363
+ readonly message?: string | undefined;
364
+ readonly originalMessage?: string | undefined;
365
+ readonly originalStatusCode?: number | undefined;
366
+ };
367
+ } | undefined;
368
+ }, {
369
+ readonly providerMetadataKey: string;
370
+ readonly tools: ToolStream.State<number>;
371
+ readonly finishReason: FinishReasonDetails | undefined;
372
+ readonly usage: Usage | undefined;
373
+ readonly hasToolCalls: boolean;
374
+ readonly reasoningSignatures: Readonly<Record<number, string>>;
375
+ readonly reasoningRedactedContent: Readonly<Record<number, Uint8Array[]>>;
376
+ readonly lifecycle: Lifecycle.State;
377
+ }>;
379
378
  export declare const route: Route<{
379
+ readonly modelId: string;
380
380
  readonly messages: readonly ({
381
381
  readonly role: "user";
382
382
  readonly content: readonly ({
@@ -384,35 +384,21 @@ export declare const route: Route<{
384
384
  readonly type: "default";
385
385
  readonly ttl?: "1h" | "5m" | undefined;
386
386
  };
387
- } | {
388
- readonly image: {
389
- readonly format: "png" | "jpeg" | "gif" | "webp";
390
- readonly source: {
391
- readonly bytes: string;
392
- };
393
- };
394
- } | {
395
- readonly document: {
396
- readonly format: "pdf" | "txt" | "md" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html";
397
- readonly name: string;
398
- readonly source: {
399
- readonly bytes: string;
400
- };
401
- };
402
387
  } | {
403
388
  readonly text: string;
404
389
  } | {
405
390
  readonly toolResult: {
391
+ readonly toolUseId: string;
406
392
  readonly content: readonly ({
407
393
  readonly image: {
408
- readonly format: "png" | "jpeg" | "gif" | "webp";
394
+ readonly format: "gif" | "jpeg" | "png" | "webp";
409
395
  readonly source: {
410
396
  readonly bytes: string;
411
397
  };
412
398
  };
413
399
  } | {
414
400
  readonly document: {
415
- readonly format: "pdf" | "txt" | "md" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html";
401
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
416
402
  readonly name: string;
417
403
  readonly source: {
418
404
  readonly bytes: string;
@@ -423,9 +409,23 @@ export declare const route: Route<{
423
409
  } | {
424
410
  readonly json: unknown;
425
411
  })[];
426
- readonly toolUseId: string;
427
412
  readonly status?: "error" | "success" | undefined;
428
413
  };
414
+ } | {
415
+ readonly image: {
416
+ readonly format: "gif" | "jpeg" | "png" | "webp";
417
+ readonly source: {
418
+ readonly bytes: string;
419
+ };
420
+ };
421
+ } | {
422
+ readonly document: {
423
+ readonly format: "csv" | "doc" | "docx" | "html" | "md" | "pdf" | "txt" | "xls" | "xlsx";
424
+ readonly name: string;
425
+ readonly source: {
426
+ readonly bytes: string;
427
+ };
428
+ };
429
429
  })[];
430
430
  } | {
431
431
  readonly role: "assistant";
@@ -453,7 +453,6 @@ export declare const route: Route<{
453
453
  };
454
454
  })[];
455
455
  })[];
456
- readonly modelId: string;
457
456
  readonly system?: readonly ({
458
457
  readonly cachePoint: {
459
458
  readonly type: "default";
@@ -463,8 +462,8 @@ export declare const route: Route<{
463
462
  readonly text: string;
464
463
  })[] | undefined;
465
464
  readonly inferenceConfig?: {
466
- readonly temperature?: number | undefined;
467
465
  readonly maxTokens?: number | undefined;
466
+ readonly temperature?: number | undefined;
468
467
  readonly topP?: number | undefined;
469
468
  readonly stopSequences?: readonly string[] | undefined;
470
469
  } | undefined;
@@ -477,12 +476,12 @@ export declare const route: Route<{
477
476
  } | {
478
477
  readonly toolSpec: {
479
478
  readonly name: string;
479
+ readonly description?: string | undefined;
480
480
  readonly inputSchema: {
481
481
  readonly json: {
482
482
  readonly [x: string]: unknown;
483
483
  };
484
484
  };
485
- readonly description?: string | undefined;
486
485
  };
487
486
  })[];
488
487
  readonly toolChoice?: {
@@ -499,8 +498,5 @@ export declare const route: Route<{
499
498
  readonly [x: string]: unknown;
500
499
  } | undefined;
501
500
  }, import("../route/transport/http.js").HttpPrepared<object>, import("../route/client.js").CompactionOperations | undefined>;
502
- export declare const sigV4Auth: (source: BedrockAuth.CredentialSource | undefined, options?: {
503
- readonly service?: string;
504
- readonly name?: string;
505
- }) => import("../route.js").AuthShape;
501
+ export declare const sigV4Auth: typeof BedrockAuth.sigV4;
506
502
  export * as BedrockConverse from "./bedrock-converse.js";
@@ -34,5 +34,5 @@ export declare const BlackForestLabsImages: {
34
34
  readonly pollingURL: string;
35
35
  readonly cost?: number | undefined;
36
36
  }>;
37
- readonly model: (input: MediaRoute.ModelInput) => ImageModel<BlackForestLabsImageOptions>;
37
+ readonly model: typeof model;
38
38
  };
@@ -23,12 +23,12 @@ interface State extends SpeechStream.Audio {
23
23
  readonly done: boolean;
24
24
  }
25
25
  export declare const protocol: MediaProtocol.Streamed<Request, {
26
- readonly id: string;
27
26
  readonly type: "generation-queued";
27
+ readonly id: string;
28
28
  readonly position?: number | undefined;
29
29
  } | {
30
- readonly id: string;
31
30
  readonly type: "generation-progress";
31
+ readonly id: string;
32
32
  readonly progress?: number | undefined;
33
33
  } | {
34
34
  readonly type: "audio-delta";
@@ -43,11 +43,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
43
43
  } | {
44
44
  readonly type: "finish";
45
45
  readonly audio: import("../media.js").Asset;
46
- readonly providerMetadata?: {
47
- readonly [x: string]: {
48
- readonly [x: string]: unknown;
49
- };
50
- } | undefined;
51
46
  readonly usage?: {
52
47
  readonly type: "tokens";
53
48
  readonly input?: number | undefined;
@@ -70,7 +65,7 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
70
65
  readonly seconds: number;
71
66
  } | undefined;
72
67
  readonly notices?: readonly {
73
- readonly type: "other" | "moderated" | "filtered";
68
+ readonly type: "filtered" | "moderated" | "other";
74
69
  readonly message: string;
75
70
  readonly providerMetadata?: {
76
71
  readonly [x: string]: {
@@ -78,16 +73,21 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
78
73
  };
79
74
  } | undefined;
80
75
  }[] | undefined;
76
+ readonly providerMetadata?: {
77
+ readonly [x: string]: {
78
+ readonly [x: string]: unknown;
79
+ };
80
+ } | undefined;
81
81
  }, string | Uint8Array<ArrayBufferLike>, State>;
82
82
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<CartesiaSpeechOptions>;
83
83
  export declare const CartesiaSpeech: {
84
84
  readonly protocol: MediaProtocol.Streamed<Request, {
85
- readonly id: string;
86
85
  readonly type: "generation-queued";
86
+ readonly id: string;
87
87
  readonly position?: number | undefined;
88
88
  } | {
89
- readonly id: string;
90
89
  readonly type: "generation-progress";
90
+ readonly id: string;
91
91
  readonly progress?: number | undefined;
92
92
  } | {
93
93
  readonly type: "audio-delta";
@@ -102,11 +102,6 @@ export declare const CartesiaSpeech: {
102
102
  } | {
103
103
  readonly type: "finish";
104
104
  readonly audio: import("../media.js").Asset;
105
- readonly providerMetadata?: {
106
- readonly [x: string]: {
107
- readonly [x: string]: unknown;
108
- };
109
- } | undefined;
110
105
  readonly usage?: {
111
106
  readonly type: "tokens";
112
107
  readonly input?: number | undefined;
@@ -129,7 +124,7 @@ export declare const CartesiaSpeech: {
129
124
  readonly seconds: number;
130
125
  } | undefined;
131
126
  readonly notices?: readonly {
132
- readonly type: "other" | "moderated" | "filtered";
127
+ readonly type: "filtered" | "moderated" | "other";
133
128
  readonly message: string;
134
129
  readonly providerMetadata?: {
135
130
  readonly [x: string]: {
@@ -137,7 +132,12 @@ export declare const CartesiaSpeech: {
137
132
  };
138
133
  } | undefined;
139
134
  }[] | undefined;
135
+ readonly providerMetadata?: {
136
+ readonly [x: string]: {
137
+ readonly [x: string]: unknown;
138
+ };
139
+ } | undefined;
140
140
  }, string | Uint8Array<ArrayBufferLike>, State>;
141
- readonly model: (input: MediaRoute.ModelInput) => SpeechModel<CartesiaSpeechOptions>;
141
+ readonly model: typeof model;
142
142
  };
143
143
  export {};
@@ -11,10 +11,15 @@ declare const Options: Schema.Struct<{
11
11
  }>>;
12
12
  }>;
13
13
  export type ProviderOptionsInput = Schema.Schema.Type<typeof Options>;
14
+ type State = {
15
+ readonly lifecycle: Lifecycle.State;
16
+ readonly tools: ToolStream.State<number>;
17
+ readonly finished: boolean;
18
+ };
14
19
  export declare const protocol: Protocol<{
15
20
  readonly model: string;
16
21
  readonly messages: readonly {
17
- readonly role: "tool" | "system" | "user" | "assistant";
22
+ readonly role: "assistant" | "system" | "tool" | "user";
18
23
  readonly content?: string | readonly ({
19
24
  readonly type: "text";
20
25
  readonly text: string;
@@ -39,33 +44,31 @@ export declare const protocol: Protocol<{
39
44
  readonly tool_plan?: string | undefined;
40
45
  }[];
41
46
  readonly stream: true;
42
- readonly max_tokens?: number | undefined;
43
- readonly temperature?: number | undefined;
44
47
  readonly tools?: readonly {
45
48
  readonly type: "function";
46
49
  readonly function: {
47
50
  readonly name: string;
48
- readonly parameters: unknown;
49
51
  readonly description?: string | undefined;
52
+ readonly parameters: unknown;
50
53
  };
51
54
  }[] | undefined;
52
- readonly seed?: number | undefined;
55
+ readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
53
56
  readonly thinking?: {
54
57
  readonly type: string;
55
58
  readonly token_budget?: number | undefined;
56
59
  } | undefined;
57
- readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
58
- readonly stop_sequences?: readonly string[] | undefined;
60
+ readonly max_tokens?: number | undefined;
61
+ readonly temperature?: number | undefined;
59
62
  readonly p?: number | undefined;
60
63
  readonly k?: number | undefined;
64
+ readonly seed?: number | undefined;
65
+ readonly stop_sequences?: readonly string[] | undefined;
61
66
  readonly frequency_penalty?: number | undefined;
62
67
  readonly presence_penalty?: number | undefined;
63
68
  }, string, {
64
- readonly type: "unknown";
65
- } | {
66
69
  readonly type: "message-start";
67
70
  } | {
68
- readonly type: "content-start" | "content-delta";
71
+ readonly type: "content-delta" | "content-start";
69
72
  readonly index: number;
70
73
  readonly delta: {
71
74
  readonly message: {
@@ -86,16 +89,16 @@ export declare const protocol: Protocol<{
86
89
  };
87
90
  };
88
91
  } | {
89
- readonly type: "tool-call-start" | "tool-call-delta";
92
+ readonly type: "tool-call-delta" | "tool-call-start";
90
93
  readonly index: number;
91
94
  readonly delta: {
92
95
  readonly message: {
93
96
  readonly tool_calls: {
97
+ readonly id?: string | undefined;
94
98
  readonly function: {
95
99
  readonly name?: string | undefined;
96
100
  readonly arguments?: string | undefined;
97
101
  };
98
- readonly id?: string | undefined;
99
102
  };
100
103
  };
101
104
  };
@@ -121,16 +124,14 @@ export declare const protocol: Protocol<{
121
124
  } | undefined;
122
125
  };
123
126
  } | {
124
- readonly type: "citation-start" | "citation-end";
125
- }, {
126
- readonly tools: Partial<Record<number, ToolStream.PendingTool>>;
127
- readonly lifecycle: Lifecycle.State;
128
- readonly finished: boolean;
129
- }>;
127
+ readonly type: "citation-end" | "citation-start";
128
+ } | {
129
+ readonly type: "unknown";
130
+ }, State>;
130
131
  export declare const route: Route<{
131
132
  readonly model: string;
132
133
  readonly messages: readonly {
133
- readonly role: "tool" | "system" | "user" | "assistant";
134
+ readonly role: "assistant" | "system" | "tool" | "user";
134
135
  readonly content?: string | readonly ({
135
136
  readonly type: "text";
136
137
  readonly text: string;
@@ -155,25 +156,25 @@ export declare const route: Route<{
155
156
  readonly tool_plan?: string | undefined;
156
157
  }[];
157
158
  readonly stream: true;
158
- readonly max_tokens?: number | undefined;
159
- readonly temperature?: number | undefined;
160
159
  readonly tools?: readonly {
161
160
  readonly type: "function";
162
161
  readonly function: {
163
162
  readonly name: string;
164
- readonly parameters: unknown;
165
163
  readonly description?: string | undefined;
164
+ readonly parameters: unknown;
166
165
  };
167
166
  }[] | undefined;
168
- readonly seed?: number | undefined;
167
+ readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
169
168
  readonly thinking?: {
170
169
  readonly type: string;
171
170
  readonly token_budget?: number | undefined;
172
171
  } | undefined;
173
- readonly tool_choice?: "NONE" | "REQUIRED" | undefined;
174
- readonly stop_sequences?: readonly string[] | undefined;
172
+ readonly max_tokens?: number | undefined;
173
+ readonly temperature?: number | undefined;
175
174
  readonly p?: number | undefined;
176
175
  readonly k?: number | undefined;
176
+ readonly seed?: number | undefined;
177
+ readonly stop_sequences?: readonly string[] | undefined;
177
178
  readonly frequency_penalty?: number | undefined;
178
179
  readonly presence_penalty?: number | undefined;
179
180
  }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
@@ -16,12 +16,12 @@ export type DeepgramSpeechOptions = {
16
16
  } & Record<string, unknown>;
17
17
  export type Request = SpeechRequestFor<DeepgramSpeechOptions>;
18
18
  export declare const protocol: MediaProtocol.Streamed<Request, {
19
- readonly id: string;
20
19
  readonly type: "generation-queued";
20
+ readonly id: string;
21
21
  readonly position?: number | undefined;
22
22
  } | {
23
- readonly id: string;
24
23
  readonly type: "generation-progress";
24
+ readonly id: string;
25
25
  readonly progress?: number | undefined;
26
26
  } | {
27
27
  readonly type: "audio-delta";
@@ -36,11 +36,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
36
36
  } | {
37
37
  readonly type: "finish";
38
38
  readonly audio: import("../media.js").Asset;
39
- readonly providerMetadata?: {
40
- readonly [x: string]: {
41
- readonly [x: string]: unknown;
42
- };
43
- } | undefined;
44
39
  readonly usage?: {
45
40
  readonly type: "tokens";
46
41
  readonly input?: number | undefined;
@@ -63,7 +58,7 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
63
58
  readonly seconds: number;
64
59
  } | undefined;
65
60
  readonly notices?: readonly {
66
- readonly type: "other" | "moderated" | "filtered";
61
+ readonly type: "filtered" | "moderated" | "other";
67
62
  readonly message: string;
68
63
  readonly providerMetadata?: {
69
64
  readonly [x: string]: {
@@ -71,16 +66,21 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
71
66
  };
72
67
  } | undefined;
73
68
  }[] | undefined;
69
+ readonly providerMetadata?: {
70
+ readonly [x: string]: {
71
+ readonly [x: string]: unknown;
72
+ };
73
+ } | undefined;
74
74
  }, Uint8Array<ArrayBufferLike>, SpeechStream.Audio>;
75
75
  export declare const model: (input: MediaRoute.ModelInput) => SpeechModel<DeepgramSpeechOptions>;
76
76
  export declare const DeepgramSpeech: {
77
77
  readonly protocol: MediaProtocol.Streamed<Request, {
78
- readonly id: string;
79
78
  readonly type: "generation-queued";
79
+ readonly id: string;
80
80
  readonly position?: number | undefined;
81
81
  } | {
82
- readonly id: string;
83
82
  readonly type: "generation-progress";
83
+ readonly id: string;
84
84
  readonly progress?: number | undefined;
85
85
  } | {
86
86
  readonly type: "audio-delta";
@@ -95,11 +95,6 @@ export declare const DeepgramSpeech: {
95
95
  } | {
96
96
  readonly type: "finish";
97
97
  readonly audio: import("../media.js").Asset;
98
- readonly providerMetadata?: {
99
- readonly [x: string]: {
100
- readonly [x: string]: unknown;
101
- };
102
- } | undefined;
103
98
  readonly usage?: {
104
99
  readonly type: "tokens";
105
100
  readonly input?: number | undefined;
@@ -122,7 +117,7 @@ export declare const DeepgramSpeech: {
122
117
  readonly seconds: number;
123
118
  } | undefined;
124
119
  readonly notices?: readonly {
125
- readonly type: "other" | "moderated" | "filtered";
120
+ readonly type: "filtered" | "moderated" | "other";
126
121
  readonly message: string;
127
122
  readonly providerMetadata?: {
128
123
  readonly [x: string]: {
@@ -130,6 +125,11 @@ export declare const DeepgramSpeech: {
130
125
  };
131
126
  } | undefined;
132
127
  }[] | undefined;
128
+ readonly providerMetadata?: {
129
+ readonly [x: string]: {
130
+ readonly [x: string]: unknown;
131
+ };
132
+ } | undefined;
133
133
  }, Uint8Array<ArrayBufferLike>, SpeechStream.Audio>;
134
- readonly model: (input: MediaRoute.ModelInput) => SpeechModel<DeepgramSpeechOptions>;
134
+ readonly model: typeof model;
135
135
  };
@@ -22,5 +22,5 @@ export declare const protocol: MediaProtocol.Inline<Request, TranscriptionRespon
22
22
  export declare const model: (input: MediaRoute.ModelInput) => TranscriptionModel<DeepgramTranscriptionOptions>;
23
23
  export declare const DeepgramTranscription: {
24
24
  readonly protocol: MediaProtocol.Inline<Request, TranscriptionResponse>;
25
- readonly model: (input: MediaRoute.ModelInput) => TranscriptionModel<DeepgramTranscriptionOptions>;
25
+ readonly model: typeof model;
26
26
  };