@opencode/ai 2.0.15 → 2.0.17

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 (224) hide show
  1. package/README.md +441 -99
  2. package/dist/ai-client.d.ts +8 -0
  3. package/dist/ai-client.js +12 -0
  4. package/dist/experimental/evaluation-client.d.ts +3 -3
  5. package/dist/experimental/evaluation-client.js +1 -1
  6. package/dist/experimental/evaluation.js +1 -1
  7. package/dist/generation.d.ts +39 -29
  8. package/dist/generation.js +62 -36
  9. package/dist/image-client.d.ts +59 -17
  10. package/dist/image-client.js +16 -24
  11. package/dist/image.d.ts +394 -55
  12. package/dist/image.js +48 -57
  13. package/dist/index.d.ts +15 -2
  14. package/dist/index.js +10 -0
  15. package/dist/llm.d.ts +7 -5
  16. package/dist/llm.js +10 -4
  17. package/dist/media-client.d.ts +30 -0
  18. package/dist/media-client.js +51 -0
  19. package/dist/media-model.d.ts +43 -0
  20. package/dist/media-model.js +47 -0
  21. package/dist/media.d.ts +10 -9
  22. package/dist/media.js +11 -12
  23. package/dist/promise.d.ts +473 -15
  24. package/dist/promise.js +71 -13
  25. package/dist/protocols/alibaba-chat.d.ts +12 -0
  26. package/dist/protocols/alibaba-chat.js +4 -1
  27. package/dist/protocols/alibaba-messages.d.ts +1 -1
  28. package/dist/protocols/alibaba-messages.js +6 -4
  29. package/dist/protocols/alibaba-responses.d.ts +2 -2
  30. package/dist/protocols/anthropic-messages.d.ts +34 -34
  31. package/dist/protocols/anthropic-messages.js +14 -9
  32. package/dist/protocols/assemblyai-transcription.d.ts +41 -0
  33. package/dist/protocols/assemblyai-transcription.js +136 -0
  34. package/dist/protocols/bedrock-converse.d.ts +7 -0
  35. package/dist/protocols/bedrock-converse.js +39 -19
  36. package/dist/protocols/bfl-images.d.ts +38 -0
  37. package/dist/protocols/bfl-images.js +153 -0
  38. package/dist/protocols/cartesia-speech.d.ts +143 -0
  39. package/dist/protocols/cartesia-speech.js +120 -0
  40. package/dist/protocols/deepgram-speech.d.ts +135 -0
  41. package/dist/protocols/deepgram-speech.js +91 -0
  42. package/dist/protocols/deepgram-transcription.d.ts +26 -0
  43. package/dist/protocols/deepgram-transcription.js +125 -0
  44. package/dist/protocols/elevenlabs-speech.d.ts +138 -0
  45. package/dist/protocols/elevenlabs-speech.js +111 -0
  46. package/dist/protocols/fal-images.d.ts +25 -0
  47. package/dist/protocols/fal-images.js +104 -0
  48. package/dist/protocols/fal-video.d.ts +29 -0
  49. package/dist/protocols/fal-video.js +73 -0
  50. package/dist/protocols/gemini.d.ts +22 -22
  51. package/dist/protocols/gemini.js +19 -36
  52. package/dist/protocols/google-images.d.ts +3 -3
  53. package/dist/protocols/google-images.js +12 -34
  54. package/dist/protocols/google-speech.d.ts +146 -0
  55. package/dist/protocols/google-speech.js +88 -0
  56. package/dist/protocols/google-transcription.d.ts +174 -0
  57. package/dist/protocols/google-transcription.js +126 -0
  58. package/dist/protocols/google-video.d.ts +26 -0
  59. package/dist/protocols/google-video.js +142 -0
  60. package/dist/protocols/meta-images.d.ts +3 -4
  61. package/dist/protocols/meta-images.js +13 -29
  62. package/dist/protocols/meta-messages.d.ts +5 -5
  63. package/dist/protocols/meta-responses.d.ts +4 -4
  64. package/dist/protocols/meta-responses.js +6 -4
  65. package/dist/protocols/open-responses.d.ts +10 -9
  66. package/dist/protocols/open-responses.js +4 -9
  67. package/dist/protocols/openai-chat.d.ts +84 -0
  68. package/dist/protocols/openai-chat.js +28 -17
  69. package/dist/protocols/openai-compatible-chat.d.ts +12 -0
  70. package/dist/protocols/openai-compatible-responses.d.ts +2 -2
  71. package/dist/protocols/openai-images.d.ts +130 -7
  72. package/dist/protocols/openai-images.js +143 -91
  73. package/dist/protocols/openai-responses.d.ts +20 -20
  74. package/dist/protocols/openai-responses.js +31 -31
  75. package/dist/protocols/openai-speech.d.ts +136 -0
  76. package/dist/protocols/openai-speech.js +97 -0
  77. package/dist/protocols/openai-transcription.d.ts +211 -0
  78. package/dist/protocols/openai-transcription.js +202 -0
  79. package/dist/protocols/replicate-images.d.ts +28 -0
  80. package/dist/protocols/replicate-images.js +127 -0
  81. package/dist/protocols/runway-video.d.ts +38 -0
  82. package/dist/protocols/runway-video.js +140 -0
  83. package/dist/protocols/shared.d.ts +21 -17
  84. package/dist/protocols/shared.js +27 -36
  85. package/dist/protocols/stability-images.d.ts +39 -0
  86. package/dist/protocols/stability-images.js +136 -0
  87. package/dist/protocols/utils/fal-queue.d.ts +26 -0
  88. package/dist/protocols/utils/fal-queue.js +67 -0
  89. package/dist/protocols/utils/gemini-generate-content.d.ts +65 -0
  90. package/dist/protocols/utils/gemini-generate-content.js +65 -0
  91. package/dist/protocols/utils/gemini-json-schema.d.ts +3 -0
  92. package/dist/protocols/utils/gemini-json-schema.js +76 -0
  93. package/dist/protocols/utils/media-input.d.ts +23 -1
  94. package/dist/protocols/utils/media-input.js +40 -0
  95. package/dist/protocols/utils/responses-checkpoint.js +3 -7
  96. package/dist/protocols/utils/responses-compaction.d.ts +3 -1
  97. package/dist/protocols/utils/responses-compaction.js +16 -3
  98. package/dist/protocols/utils/speech-stream.d.ts +49 -0
  99. package/dist/protocols/utils/speech-stream.js +64 -0
  100. package/dist/protocols/utils/tool-schema.d.ts +2 -2
  101. package/dist/protocols/utils/tool-schema.js +62 -19
  102. package/dist/protocols/xai-images.d.ts +4 -4
  103. package/dist/protocols/xai-images.js +14 -40
  104. package/dist/protocols/xai-responses.d.ts +2 -2
  105. package/dist/protocols/xai-responses.js +1 -1
  106. package/dist/protocols/xai-video.d.ts +34 -0
  107. package/dist/protocols/xai-video.js +141 -0
  108. package/dist/protocols/zai-chat.d.ts +13 -1
  109. package/dist/protocols/zai-images.d.ts +2 -2
  110. package/dist/protocols/zai-images.js +11 -14
  111. package/dist/protocols/zai-messages.d.ts +1 -1
  112. package/dist/provider-error.js +10 -1
  113. package/dist/providers/alibaba.d.ts +15 -3
  114. package/dist/providers/amazon-bedrock-mantle.d.ts +14 -2
  115. package/dist/providers/amazon-bedrock.d.ts +2 -0
  116. package/dist/providers/amazon-bedrock.js +1 -0
  117. package/dist/providers/anthropic-compatible.d.ts +5 -5
  118. package/dist/providers/anthropic.d.ts +5 -5
  119. package/dist/providers/assemblyai.d.ts +25 -0
  120. package/dist/providers/assemblyai.js +24 -0
  121. package/dist/providers/azure.d.ts +20 -8
  122. package/dist/providers/azure.js +2 -2
  123. package/dist/providers/baseten.d.ts +24 -0
  124. package/dist/providers/black-forest-labs.d.ts +25 -0
  125. package/dist/providers/black-forest-labs.js +23 -0
  126. package/dist/providers/cartesia.d.ts +24 -0
  127. package/dist/providers/cartesia.js +17 -0
  128. package/dist/providers/cerebras.d.ts +24 -0
  129. package/dist/providers/cloudflare-ai-gateway.d.ts +42 -18
  130. package/dist/providers/cloudflare-workers-ai.d.ts +24 -0
  131. package/dist/providers/deepgram.d.ts +29 -0
  132. package/dist/providers/deepgram.js +25 -0
  133. package/dist/providers/deepinfra.d.ts +24 -0
  134. package/dist/providers/deepseek.d.ts +24 -0
  135. package/dist/providers/elevenlabs.d.ts +24 -0
  136. package/dist/providers/elevenlabs.js +23 -0
  137. package/dist/providers/fal.d.ts +29 -0
  138. package/dist/providers/fal.js +26 -0
  139. package/dist/providers/fireworks.d.ts +24 -0
  140. package/dist/providers/google-vertex-chat.d.ts +12 -0
  141. package/dist/providers/google-vertex-messages.d.ts +5 -5
  142. package/dist/providers/google-vertex-responses.d.ts +2 -2
  143. package/dist/providers/google-vertex.d.ts +6 -6
  144. package/dist/providers/google.d.ts +21 -6
  145. package/dist/providers/google.js +13 -9
  146. package/dist/providers/groq.d.ts +24 -0
  147. package/dist/providers/index.d.ts +9 -0
  148. package/dist/providers/index.js +9 -0
  149. package/dist/providers/meta.d.ts +22 -10
  150. package/dist/providers/meta.js +4 -8
  151. package/dist/providers/minimax.d.ts +19 -7
  152. package/dist/providers/moonshot.d.ts +19 -7
  153. package/dist/providers/moonshot.js +3 -3
  154. package/dist/providers/openai-compatible-responses.d.ts +2 -2
  155. package/dist/providers/openai-compatible.d.ts +12 -0
  156. package/dist/providers/openai-options.d.ts +3 -9
  157. package/dist/providers/openai-options.js +4 -7
  158. package/dist/providers/openai.d.ts +33 -12
  159. package/dist/providers/openai.js +17 -9
  160. package/dist/providers/opencode-zen.js +1 -1
  161. package/dist/providers/openrouter.d.ts +54 -7
  162. package/dist/providers/openrouter.js +10 -5
  163. package/dist/providers/replicate.d.ts +25 -0
  164. package/dist/providers/replicate.js +17 -0
  165. package/dist/providers/runway.d.ts +24 -0
  166. package/dist/providers/runway.js +17 -0
  167. package/dist/providers/stability.d.ts +28 -0
  168. package/dist/providers/stability.js +18 -0
  169. package/dist/providers/togetherai.d.ts +24 -0
  170. package/dist/providers/typesafe-ai.js +1 -1
  171. package/dist/providers/vercel-ai-gateway.js +1 -1
  172. package/dist/providers/xai.d.ts +17 -0
  173. package/dist/providers/xai.js +7 -9
  174. package/dist/providers/zai-coding-plan.d.ts +16 -4
  175. package/dist/providers/zai.d.ts +13 -1
  176. package/dist/providers/zai.js +4 -8
  177. package/dist/route/auth.d.ts +5 -2
  178. package/dist/route/auth.js +20 -13
  179. package/dist/route/client.d.ts +9 -7
  180. package/dist/route/client.js +6 -8
  181. package/dist/route/endpoint.d.ts +1 -0
  182. package/dist/route/endpoint.js +2 -2
  183. package/dist/route/executor-service.d.ts +4 -2
  184. package/dist/route/executor-service.js +2 -1
  185. package/dist/route/executor.d.ts +3 -1
  186. package/dist/route/executor.js +7 -0
  187. package/dist/route/framing.d.ts +15 -2
  188. package/dist/route/framing.js +53 -4
  189. package/dist/route/index.d.ts +1 -1
  190. package/dist/route/media-protocol.d.ts +145 -18
  191. package/dist/route/media-protocol.js +96 -28
  192. package/dist/route/media.d.ts +54 -9
  193. package/dist/route/media.js +194 -38
  194. package/dist/route/protocol.d.ts +3 -1
  195. package/dist/schema/events.d.ts +0 -6
  196. package/dist/schema/messages.d.ts +0 -3
  197. package/dist/schema/options.d.ts +10 -6
  198. package/dist/schema/options.js +10 -5
  199. package/dist/speech-client.d.ts +66 -0
  200. package/dist/speech-client.js +21 -0
  201. package/dist/speech.d.ts +1307 -0
  202. package/dist/speech.js +124 -0
  203. package/dist/testing.d.ts +2 -2
  204. package/dist/transcription-client.d.ts +82 -0
  205. package/dist/transcription-client.js +13 -0
  206. package/dist/transcription.d.ts +1492 -0
  207. package/dist/transcription.js +127 -0
  208. package/dist/utils/bytes.d.ts +1 -0
  209. package/dist/utils/bytes.js +10 -0
  210. package/dist/utils/json.d.ts +4 -0
  211. package/dist/utils/json.js +4 -0
  212. package/dist/utils/media-type.d.ts +3 -1
  213. package/dist/utils/media-type.js +25 -2
  214. package/dist/video-client.d.ts +59 -0
  215. package/dist/video-client.js +20 -0
  216. package/dist/video.d.ts +1351 -0
  217. package/dist/video.js +118 -0
  218. package/package.json +3 -3
  219. package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -2
  220. package/dist/protocols/utils/gemini-tool-schema.js +0 -103
  221. package/dist/protocols/utils/meta-image.d.ts +0 -2
  222. package/dist/protocols/utils/meta-image.js +0 -13
  223. package/dist/protocols/utils/openai-image.d.ts +0 -5
  224. package/dist/protocols/utils/openai-image.js +0 -18
@@ -0,0 +1,25 @@
1
+ import type { ProviderAuthOption } from "../route/auth-options.js";
2
+ import { type HttpOptions, type ModelID } from "../schema/index.js";
3
+ export type { AssemblyAITranscriptionOptions } from "../protocols/assemblyai-transcription.js";
4
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
5
+ export type Config = ProviderAuthOption<"optional"> & {
6
+ /** `https://api.eu.assemblyai.com` for the EU region. */
7
+ readonly baseURL?: string;
8
+ readonly headers?: Record<string, string>;
9
+ readonly http?: HttpOptions.Input;
10
+ };
11
+ export declare const configure: (input?: Config) => {
12
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
13
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
14
+ configure: (input?: Config) => /*elided*/ any;
15
+ };
16
+ export declare const provider: {
17
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
18
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
19
+ configure: (input?: Config) => {
20
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
21
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
22
+ configure: /*elided*/ any;
23
+ };
24
+ };
25
+ export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/assemblyai-transcription.js").AssemblyAITranscriptionOptions>;
@@ -0,0 +1,24 @@
1
+ import { Auth } from "../route/auth.js";
2
+ import { MediaRoute } from "../route/media.js";
3
+ import { ProviderID } from "../schema/index.js";
4
+ import { AssemblyAITranscription } from "../protocols/assemblyai-transcription.js";
5
+ export const id = ProviderID.make("assemblyai");
6
+ // The key is the whole `authorization` value, without a scheme.
7
+ const auth = (options) => {
8
+ if ("auth" in options && options.auth)
9
+ return options.auth;
10
+ return Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey")
11
+ .orElse(Auth.config("ASSEMBLYAI_API_KEY"))
12
+ .pipe(Auth.header("authorization"));
13
+ };
14
+ export const configure = (input = {}) => {
15
+ const media = MediaRoute.deployment(input, auth(input));
16
+ const transcription = (modelID) => AssemblyAITranscription.model({ ...media, id: modelID });
17
+ return {
18
+ id,
19
+ transcription,
20
+ configure,
21
+ };
22
+ };
23
+ export const provider = configure();
24
+ export const transcription = provider.transcription;
@@ -93,8 +93,8 @@ declare const responsesRoute: Route<{
93
93
  } | {
94
94
  readonly type: "input_file";
95
95
  readonly filename: string;
96
- readonly detail?: string | undefined;
97
96
  readonly file_data?: string | undefined;
97
+ readonly detail?: string | undefined;
98
98
  readonly file_url?: string | undefined;
99
99
  } | {
100
100
  readonly type: "input_text";
@@ -130,8 +130,8 @@ declare const responsesRoute: Route<{
130
130
  } | {
131
131
  readonly type: "input_file";
132
132
  readonly filename: string;
133
- readonly detail?: string | undefined;
134
133
  readonly file_data?: string | undefined;
134
+ readonly detail?: string | undefined;
135
135
  readonly file_url?: string | undefined;
136
136
  } | {
137
137
  readonly type: "input_text";
@@ -166,8 +166,8 @@ declare const responsesRoute: Route<{
166
166
  readonly type: "image_generation_call";
167
167
  readonly status?: string | undefined;
168
168
  readonly result?: string | null | undefined;
169
- readonly revised_prompt?: string | null | undefined;
170
169
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
170
+ readonly revised_prompt?: string | null | undefined;
171
171
  })[];
172
172
  readonly model: string;
173
173
  readonly stream: true;
@@ -194,9 +194,9 @@ declare const responsesRoute: Route<{
194
194
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
195
195
  readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
196
196
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
197
+ readonly partial_images?: number | undefined;
197
198
  readonly output_compression?: number | undefined;
198
199
  readonly input_fidelity?: "low" | "high" | undefined;
199
- readonly partial_images?: number | undefined;
200
200
  } | {
201
201
  readonly type: "namespace";
202
202
  readonly name: string;
@@ -267,6 +267,12 @@ export declare const routes: (Route<{
267
267
  readonly image_url: {
268
268
  readonly url: string;
269
269
  };
270
+ } | {
271
+ readonly type: "file";
272
+ readonly file: {
273
+ readonly filename: string;
274
+ readonly file_data: string;
275
+ };
270
276
  })[];
271
277
  } | {
272
278
  readonly role: "user";
@@ -282,6 +288,12 @@ export declare const routes: (Route<{
282
288
  readonly image_url: {
283
289
  readonly url: string;
284
290
  };
291
+ } | {
292
+ readonly type: "file";
293
+ readonly file: {
294
+ readonly filename: string;
295
+ readonly file_data: string;
296
+ };
285
297
  })[];
286
298
  } | {
287
299
  readonly [x: string]: unknown;
@@ -421,8 +433,8 @@ export declare const routes: (Route<{
421
433
  } | {
422
434
  readonly type: "input_file";
423
435
  readonly filename: string;
424
- readonly detail?: string | undefined;
425
436
  readonly file_data?: string | undefined;
437
+ readonly detail?: string | undefined;
426
438
  readonly file_url?: string | undefined;
427
439
  } | {
428
440
  readonly type: "input_text";
@@ -458,8 +470,8 @@ export declare const routes: (Route<{
458
470
  } | {
459
471
  readonly type: "input_file";
460
472
  readonly filename: string;
461
- readonly detail?: string | undefined;
462
473
  readonly file_data?: string | undefined;
474
+ readonly detail?: string | undefined;
463
475
  readonly file_url?: string | undefined;
464
476
  } | {
465
477
  readonly type: "input_text";
@@ -494,8 +506,8 @@ export declare const routes: (Route<{
494
506
  readonly type: "image_generation_call";
495
507
  readonly status?: string | undefined;
496
508
  readonly result?: string | null | undefined;
497
- readonly revised_prompt?: string | null | undefined;
498
509
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
510
+ readonly revised_prompt?: string | null | undefined;
499
511
  })[];
500
512
  readonly model: string;
501
513
  readonly stream: true;
@@ -522,9 +534,9 @@ export declare const routes: (Route<{
522
534
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
523
535
  readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
524
536
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
537
+ readonly partial_images?: number | undefined;
525
538
  readonly output_compression?: number | undefined;
526
539
  readonly input_fidelity?: "low" | "high" | undefined;
527
- readonly partial_images?: number | undefined;
528
540
  } | {
529
541
  readonly type: "namespace";
530
542
  readonly name: string;
@@ -1,9 +1,9 @@
1
1
  import { Auth } from "../route/auth.js";
2
2
  import {} from "../route/auth-options.js";
3
+ import { Endpoint } from "../route/endpoint.js";
3
4
  import { ProviderConfigurationError, ProviderID } from "../schema/index.js";
4
5
  import * as OpenAIChat from "../protocols/openai-chat.js";
5
6
  import * as OpenAIResponses from "../protocols/openai-responses.js";
6
- import { ProviderShared } from "../protocols/shared.js";
7
7
  import { withOpenAIOptions } from "./openai-options.js";
8
8
  export const id = ProviderID.make("azure");
9
9
  const routeAuth = Auth.remove("authorization");
@@ -58,7 +58,7 @@ const configuredRoute = (route, input, modelID) => route.with({
58
58
  endpoint: endpoint(input, modelID),
59
59
  });
60
60
  function endpoint(input, modelID) {
61
- const baseURL = ProviderShared.trimBaseUrl(input.baseURL ?? resourceBaseURL(input.resourceName));
61
+ const baseURL = Endpoint.trimBaseUrl(input.baseURL ?? resourceBaseURL(input.resourceName));
62
62
  const query = { "api-version": input.apiVersion ?? "v1", ...input.queryParams };
63
63
  if (input.useDeploymentBasedUrls)
64
64
  return { baseURL: `${baseURL}/deployments/${modelID}`, query };
@@ -28,6 +28,12 @@ export declare const route: Route<{
28
28
  readonly image_url: {
29
29
  readonly url: string;
30
30
  };
31
+ } | {
32
+ readonly type: "file";
33
+ readonly file: {
34
+ readonly filename: string;
35
+ readonly file_data: string;
36
+ };
31
37
  })[];
32
38
  } | {
33
39
  readonly role: "user";
@@ -43,6 +49,12 @@ export declare const route: Route<{
43
49
  readonly image_url: {
44
50
  readonly url: string;
45
51
  };
52
+ } | {
53
+ readonly type: "file";
54
+ readonly file: {
55
+ readonly filename: string;
56
+ readonly file_data: string;
57
+ };
46
58
  })[];
47
59
  } | {
48
60
  readonly [x: string]: unknown;
@@ -127,6 +139,12 @@ export declare const routes: Route<{
127
139
  readonly image_url: {
128
140
  readonly url: string;
129
141
  };
142
+ } | {
143
+ readonly type: "file";
144
+ readonly file: {
145
+ readonly filename: string;
146
+ readonly file_data: string;
147
+ };
130
148
  })[];
131
149
  } | {
132
150
  readonly role: "user";
@@ -142,6 +160,12 @@ export declare const routes: Route<{
142
160
  readonly image_url: {
143
161
  readonly url: string;
144
162
  };
163
+ } | {
164
+ readonly type: "file";
165
+ readonly file: {
166
+ readonly filename: string;
167
+ readonly file_data: string;
168
+ };
145
169
  })[];
146
170
  } | {
147
171
  readonly [x: string]: unknown;
@@ -0,0 +1,25 @@
1
+ import type { ProviderAuthOption } from "../route/auth-options.js";
2
+ import { type HttpOptions, type ModelID } from "../schema/index.js";
3
+ export type { BlackForestLabsImageOptions } from "../protocols/bfl-images.js";
4
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
5
+ export type Config = ProviderAuthOption<"optional"> & {
6
+ /** `https://api.eu.bfl.ai` or `https://api.us.bfl.ai` pin inference to one region. */
7
+ readonly baseURL?: string;
8
+ readonly headers?: Record<string, string>;
9
+ readonly http?: HttpOptions.Input;
10
+ };
11
+ export declare const configure: (input?: Config) => {
12
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
13
+ image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/bfl-images.js").BlackForestLabsImageOptions>;
14
+ configure: (input?: Config) => /*elided*/ any;
15
+ };
16
+ export declare const provider: {
17
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
18
+ image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/bfl-images.js").BlackForestLabsImageOptions>;
19
+ configure: (input?: Config) => {
20
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
21
+ image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/bfl-images.js").BlackForestLabsImageOptions>;
22
+ configure: /*elided*/ any;
23
+ };
24
+ };
25
+ export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/bfl-images.js").BlackForestLabsImageOptions>;
@@ -0,0 +1,23 @@
1
+ import { Auth } from "../route/auth.js";
2
+ import { MediaRoute } from "../route/media.js";
3
+ import { ProviderID } from "../schema/index.js";
4
+ import { BlackForestLabsImages } from "../protocols/bfl-images.js";
5
+ export const id = ProviderID.make("black-forest-labs");
6
+ const auth = (options) => {
7
+ if ("auth" in options && options.auth)
8
+ return options.auth;
9
+ return Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey")
10
+ .orElse(Auth.config("BFL_API_KEY"))
11
+ .pipe(Auth.header("x-key"));
12
+ };
13
+ export const configure = (input = {}) => {
14
+ const media = MediaRoute.deployment(input, auth(input));
15
+ const image = (modelID) => BlackForestLabsImages.model({ ...media, id: modelID });
16
+ return {
17
+ id,
18
+ image,
19
+ configure,
20
+ };
21
+ };
22
+ export const provider = configure();
23
+ export const image = provider.image;
@@ -0,0 +1,24 @@
1
+ import { type ProviderAuthOption } from "../route/auth-options.js";
2
+ import { type HttpOptions, type ModelID } from "../schema/index.js";
3
+ export type { CartesiaEncoding, CartesiaSpeechOptions } from "../protocols/cartesia-speech.js";
4
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
5
+ export type Config = ProviderAuthOption<"optional"> & {
6
+ readonly baseURL?: string;
7
+ readonly headers?: Record<string, string>;
8
+ readonly http?: HttpOptions.Input;
9
+ };
10
+ export declare const configure: (input?: Config) => {
11
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
12
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/cartesia-speech.js").CartesiaSpeechOptions>;
13
+ configure: (input?: Config) => /*elided*/ any;
14
+ };
15
+ export declare const provider: {
16
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
17
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/cartesia-speech.js").CartesiaSpeechOptions>;
18
+ configure: (input?: Config) => {
19
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
20
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/cartesia-speech.js").CartesiaSpeechOptions>;
21
+ configure: /*elided*/ any;
22
+ };
23
+ };
24
+ export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/cartesia-speech.js").CartesiaSpeechOptions>;
@@ -0,0 +1,17 @@
1
+ import { AuthOptions } from "../route/auth-options.js";
2
+ import { MediaRoute } from "../route/media.js";
3
+ import { ProviderID } from "../schema/index.js";
4
+ import { CartesiaSpeech } from "../protocols/cartesia-speech.js";
5
+ export const id = ProviderID.make("cartesia");
6
+ const auth = (options) => AuthOptions.bearer(options, "CARTESIA_API_KEY");
7
+ export const configure = (input = {}) => {
8
+ const media = MediaRoute.deployment(input, auth(input));
9
+ const speech = (modelID) => CartesiaSpeech.model({ ...media, id: modelID });
10
+ return {
11
+ id,
12
+ speech,
13
+ configure,
14
+ };
15
+ };
16
+ export const provider = configure();
17
+ export const speech = provider.speech;
@@ -28,6 +28,12 @@ export declare const route: Route<{
28
28
  readonly image_url: {
29
29
  readonly url: string;
30
30
  };
31
+ } | {
32
+ readonly type: "file";
33
+ readonly file: {
34
+ readonly filename: string;
35
+ readonly file_data: string;
36
+ };
31
37
  })[];
32
38
  } | {
33
39
  readonly role: "user";
@@ -43,6 +49,12 @@ export declare const route: Route<{
43
49
  readonly image_url: {
44
50
  readonly url: string;
45
51
  };
52
+ } | {
53
+ readonly type: "file";
54
+ readonly file: {
55
+ readonly filename: string;
56
+ readonly file_data: string;
57
+ };
46
58
  })[];
47
59
  } | {
48
60
  readonly [x: string]: unknown;
@@ -127,6 +139,12 @@ export declare const routes: Route<{
127
139
  readonly image_url: {
128
140
  readonly url: string;
129
141
  };
142
+ } | {
143
+ readonly type: "file";
144
+ readonly file: {
145
+ readonly filename: string;
146
+ readonly file_data: string;
147
+ };
130
148
  })[];
131
149
  } | {
132
150
  readonly role: "user";
@@ -142,6 +160,12 @@ export declare const routes: Route<{
142
160
  readonly image_url: {
143
161
  readonly url: string;
144
162
  };
163
+ } | {
164
+ readonly type: "file";
165
+ readonly file: {
166
+ readonly filename: string;
167
+ readonly file_data: string;
168
+ };
145
169
  })[];
146
170
  } | {
147
171
  readonly [x: string]: unknown;
@@ -99,8 +99,8 @@ export declare const responsesRoute: import("../route/client.js").Route<{
99
99
  } | {
100
100
  readonly type: "input_file";
101
101
  readonly filename: string;
102
- readonly detail?: string | undefined;
103
102
  readonly file_data?: string | undefined;
103
+ readonly detail?: string | undefined;
104
104
  readonly file_url?: string | undefined;
105
105
  } | {
106
106
  readonly type: "input_text";
@@ -136,8 +136,8 @@ export declare const responsesRoute: import("../route/client.js").Route<{
136
136
  } | {
137
137
  readonly type: "input_file";
138
138
  readonly filename: string;
139
- readonly detail?: string | undefined;
140
139
  readonly file_data?: string | undefined;
140
+ readonly detail?: string | undefined;
141
141
  readonly file_url?: string | undefined;
142
142
  } | {
143
143
  readonly type: "input_text";
@@ -172,8 +172,8 @@ export declare const responsesRoute: import("../route/client.js").Route<{
172
172
  readonly type: "image_generation_call";
173
173
  readonly status?: string | undefined;
174
174
  readonly result?: string | null | undefined;
175
- readonly revised_prompt?: string | null | undefined;
176
175
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
176
+ readonly revised_prompt?: string | null | undefined;
177
177
  })[];
178
178
  readonly model: string;
179
179
  readonly stream: true;
@@ -200,9 +200,9 @@ export declare const responsesRoute: import("../route/client.js").Route<{
200
200
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
201
201
  readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
202
202
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
203
+ readonly partial_images?: number | undefined;
203
204
  readonly output_compression?: number | undefined;
204
205
  readonly input_fidelity?: "low" | "high" | undefined;
205
- readonly partial_images?: number | undefined;
206
206
  } | {
207
207
  readonly type: "namespace";
208
208
  readonly name: string;
@@ -474,20 +474,20 @@ export declare const messagesRoute: import("../route/client.js").Route<{
474
474
  readonly thinking?: {
475
475
  readonly type: "enabled";
476
476
  readonly budget_tokens: number;
477
- readonly display?: (string & {}) | "summarized" | "omitted" | undefined;
477
+ readonly display?: import("../schema/options.js").OpenString<"summarized" | "omitted"> | undefined;
478
478
  readonly block_binding?: {
479
- readonly prefix_mismatch_behavior?: (string & {}) | "error" | "drop_block" | undefined;
479
+ readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
480
480
  } | undefined;
481
481
  } | {
482
482
  readonly type: "adaptive";
483
- readonly display?: (string & {}) | "summarized" | "omitted" | undefined;
483
+ readonly display?: import("../schema/options.js").OpenString<"summarized" | "omitted"> | undefined;
484
484
  readonly block_binding?: {
485
- readonly prefix_mismatch_behavior?: (string & {}) | "error" | "drop_block" | undefined;
485
+ readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
486
486
  } | undefined;
487
487
  } | {
488
488
  readonly type: "disabled";
489
489
  } | undefined;
490
- readonly service_tier?: "auto" | (string & {}) | "standard_only" | undefined;
490
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
491
491
  readonly container?: string | {
492
492
  readonly id?: string | null | undefined;
493
493
  readonly skills?: readonly {
@@ -547,6 +547,12 @@ export declare const route: import("../route/client.js").Route<{
547
547
  readonly image_url: {
548
548
  readonly url: string;
549
549
  };
550
+ } | {
551
+ readonly type: "file";
552
+ readonly file: {
553
+ readonly filename: string;
554
+ readonly file_data: string;
555
+ };
550
556
  })[];
551
557
  } | {
552
558
  readonly role: "user";
@@ -562,6 +568,12 @@ export declare const route: import("../route/client.js").Route<{
562
568
  readonly image_url: {
563
569
  readonly url: string;
564
570
  };
571
+ } | {
572
+ readonly type: "file";
573
+ readonly file: {
574
+ readonly filename: string;
575
+ readonly file_data: string;
576
+ };
565
577
  })[];
566
578
  } | {
567
579
  readonly [x: string]: unknown;
@@ -846,20 +858,20 @@ export declare const routes: (import("../route/client.js").Route<{
846
858
  readonly thinking?: {
847
859
  readonly type: "enabled";
848
860
  readonly budget_tokens: number;
849
- readonly display?: (string & {}) | "summarized" | "omitted" | undefined;
861
+ readonly display?: import("../schema/options.js").OpenString<"summarized" | "omitted"> | undefined;
850
862
  readonly block_binding?: {
851
- readonly prefix_mismatch_behavior?: (string & {}) | "error" | "drop_block" | undefined;
863
+ readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
852
864
  } | undefined;
853
865
  } | {
854
866
  readonly type: "adaptive";
855
- readonly display?: (string & {}) | "summarized" | "omitted" | undefined;
867
+ readonly display?: import("../schema/options.js").OpenString<"summarized" | "omitted"> | undefined;
856
868
  readonly block_binding?: {
857
- readonly prefix_mismatch_behavior?: (string & {}) | "error" | "drop_block" | undefined;
869
+ readonly prefix_mismatch_behavior?: import("../schema/options.js").OpenString<"error" | "drop_block"> | undefined;
858
870
  } | undefined;
859
871
  } | {
860
872
  readonly type: "disabled";
861
873
  } | undefined;
862
- readonly service_tier?: "auto" | (string & {}) | "standard_only" | undefined;
874
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
863
875
  readonly container?: string | {
864
876
  readonly id?: string | null | undefined;
865
877
  readonly skills?: readonly {
@@ -918,6 +930,12 @@ export declare const routes: (import("../route/client.js").Route<{
918
930
  readonly image_url: {
919
931
  readonly url: string;
920
932
  };
933
+ } | {
934
+ readonly type: "file";
935
+ readonly file: {
936
+ readonly filename: string;
937
+ readonly file_data: string;
938
+ };
921
939
  })[];
922
940
  } | {
923
941
  readonly role: "user";
@@ -933,6 +951,12 @@ export declare const routes: (import("../route/client.js").Route<{
933
951
  readonly image_url: {
934
952
  readonly url: string;
935
953
  };
954
+ } | {
955
+ readonly type: "file";
956
+ readonly file: {
957
+ readonly filename: string;
958
+ readonly file_data: string;
959
+ };
936
960
  })[];
937
961
  } | {
938
962
  readonly [x: string]: unknown;
@@ -1072,8 +1096,8 @@ export declare const routes: (import("../route/client.js").Route<{
1072
1096
  } | {
1073
1097
  readonly type: "input_file";
1074
1098
  readonly filename: string;
1075
- readonly detail?: string | undefined;
1076
1099
  readonly file_data?: string | undefined;
1100
+ readonly detail?: string | undefined;
1077
1101
  readonly file_url?: string | undefined;
1078
1102
  } | {
1079
1103
  readonly type: "input_text";
@@ -1109,8 +1133,8 @@ export declare const routes: (import("../route/client.js").Route<{
1109
1133
  } | {
1110
1134
  readonly type: "input_file";
1111
1135
  readonly filename: string;
1112
- readonly detail?: string | undefined;
1113
1136
  readonly file_data?: string | undefined;
1137
+ readonly detail?: string | undefined;
1114
1138
  readonly file_url?: string | undefined;
1115
1139
  } | {
1116
1140
  readonly type: "input_text";
@@ -1145,8 +1169,8 @@ export declare const routes: (import("../route/client.js").Route<{
1145
1169
  readonly type: "image_generation_call";
1146
1170
  readonly status?: string | undefined;
1147
1171
  readonly result?: string | null | undefined;
1148
- readonly revised_prompt?: string | null | undefined;
1149
1172
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
1173
+ readonly revised_prompt?: string | null | undefined;
1150
1174
  })[];
1151
1175
  readonly model: string;
1152
1176
  readonly stream: true;
@@ -1173,9 +1197,9 @@ export declare const routes: (import("../route/client.js").Route<{
1173
1197
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
1174
1198
  readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
1175
1199
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
1200
+ readonly partial_images?: number | undefined;
1176
1201
  readonly output_compression?: number | undefined;
1177
1202
  readonly input_fidelity?: "low" | "high" | undefined;
1178
- readonly partial_images?: number | undefined;
1179
1203
  } | {
1180
1204
  readonly type: "namespace";
1181
1205
  readonly name: string;
@@ -32,6 +32,12 @@ export declare const route: Route<{
32
32
  readonly image_url: {
33
33
  readonly url: string;
34
34
  };
35
+ } | {
36
+ readonly type: "file";
37
+ readonly file: {
38
+ readonly filename: string;
39
+ readonly file_data: string;
40
+ };
35
41
  })[];
36
42
  } | {
37
43
  readonly role: "user";
@@ -47,6 +53,12 @@ export declare const route: Route<{
47
53
  readonly image_url: {
48
54
  readonly url: string;
49
55
  };
56
+ } | {
57
+ readonly type: "file";
58
+ readonly file: {
59
+ readonly filename: string;
60
+ readonly file_data: string;
61
+ };
50
62
  })[];
51
63
  } | {
52
64
  readonly [x: string]: unknown;
@@ -131,6 +143,12 @@ export declare const routes: Route<{
131
143
  readonly image_url: {
132
144
  readonly url: string;
133
145
  };
146
+ } | {
147
+ readonly type: "file";
148
+ readonly file: {
149
+ readonly filename: string;
150
+ readonly file_data: string;
151
+ };
134
152
  })[];
135
153
  } | {
136
154
  readonly role: "user";
@@ -146,6 +164,12 @@ export declare const routes: Route<{
146
164
  readonly image_url: {
147
165
  readonly url: string;
148
166
  };
167
+ } | {
168
+ readonly type: "file";
169
+ readonly file: {
170
+ readonly filename: string;
171
+ readonly file_data: string;
172
+ };
149
173
  })[];
150
174
  } | {
151
175
  readonly [x: string]: unknown;
@@ -0,0 +1,29 @@
1
+ import type { ProviderAuthOption } from "../route/auth-options.js";
2
+ import { type HttpOptions, type ModelID } from "../schema/index.js";
3
+ export type { DeepgramEncoding, DeepgramSpeechOptions } from "../protocols/deepgram-speech.js";
4
+ export type { DeepgramTranscriptionOptions } from "../protocols/deepgram-transcription.js";
5
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
6
+ export type Config = ProviderAuthOption<"optional"> & {
7
+ readonly baseURL?: string;
8
+ readonly headers?: Record<string, string>;
9
+ readonly http?: HttpOptions.Input;
10
+ };
11
+ export declare const configure: (input?: Config) => {
12
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
13
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/deepgram-speech.js").DeepgramSpeechOptions>;
14
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/deepgram-transcription.js").DeepgramTranscriptionOptions>;
15
+ configure: (input?: Config) => /*elided*/ any;
16
+ };
17
+ export declare const provider: {
18
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
19
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/deepgram-speech.js").DeepgramSpeechOptions>;
20
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/deepgram-transcription.js").DeepgramTranscriptionOptions>;
21
+ configure: (input?: Config) => {
22
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
23
+ speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/deepgram-speech.js").DeepgramSpeechOptions>;
24
+ transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/deepgram-transcription.js").DeepgramTranscriptionOptions>;
25
+ configure: /*elided*/ any;
26
+ };
27
+ };
28
+ export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/deepgram-speech.js").DeepgramSpeechOptions>;
29
+ export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/deepgram-transcription.js").DeepgramTranscriptionOptions>;