@opencode/ai 2.1.4 → 2.2.1

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 (354) hide show
  1. package/README.md +339 -166
  2. package/dist/ai-client.d.ts +2 -2
  3. package/dist/ai-client.js +2 -1
  4. package/dist/cache-policy.d.ts +4 -0
  5. package/dist/cache-policy.js +20 -6
  6. package/dist/decision-client.d.ts +21 -0
  7. package/dist/decision-client.js +55 -0
  8. package/dist/decision.d.ts +472 -0
  9. package/dist/decision.js +158 -0
  10. package/dist/effect.d.ts +38 -0
  11. package/dist/effect.js +27 -0
  12. package/dist/effort-updates.d.ts +2 -2
  13. package/dist/experimental/cloudflare-run-extraction.d.ts +13 -0
  14. package/dist/experimental/cloudflare-run-extraction.js +83 -0
  15. package/dist/experimental/extraction.d.ts +183 -0
  16. package/dist/experimental/extraction.js +102 -0
  17. package/dist/experimental/realtime.d.ts +7 -2
  18. package/dist/experimental/realtime.js +5 -5
  19. package/dist/experimental.d.ts +2 -3
  20. package/dist/experimental.js +1 -2
  21. package/dist/image-client.d.ts +50 -14
  22. package/dist/image-client.js +0 -1
  23. package/dist/image.d.ts +6 -176
  24. package/dist/image.js +4 -11
  25. package/dist/index.d.ts +1444 -34
  26. package/dist/index.js +139 -24
  27. package/dist/llm.d.ts +16 -1
  28. package/dist/llm.js +34 -0
  29. package/dist/media-client.d.ts +3 -1
  30. package/dist/media-client.js +1 -0
  31. package/dist/media-model.d.ts +3 -0
  32. package/dist/media-model.js +4 -1
  33. package/dist/media.d.ts +0 -7
  34. package/dist/media.js +0 -6
  35. package/dist/protocols/alibaba-chat.d.ts +59 -4
  36. package/dist/protocols/alibaba-images.d.ts +22 -0
  37. package/dist/protocols/alibaba-images.js +77 -0
  38. package/dist/protocols/alibaba-messages.d.ts +52 -17
  39. package/dist/protocols/alibaba-responses.d.ts +26 -6
  40. package/dist/protocols/anthropic-messages.d.ts +160 -54
  41. package/dist/protocols/anthropic-messages.js +44 -13
  42. package/dist/protocols/bedrock-converse.d.ts +110 -15
  43. package/dist/protocols/bedrock-converse.js +112 -15
  44. package/dist/protocols/bedrock-event-stream.js +1 -0
  45. package/dist/protocols/cartesia-speech.d.ts +0 -18
  46. package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
  47. package/dist/protocols/cloudflare-run-decisions.js +36 -0
  48. package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
  49. package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
  50. package/dist/protocols/deepgram-speech.d.ts +0 -18
  51. package/dist/protocols/elevenlabs-speech.d.ts +0 -18
  52. package/dist/protocols/gemini.d.ts +3 -0
  53. package/dist/protocols/gemini.js +11 -6
  54. package/dist/protocols/google-images.d.ts +2 -2
  55. package/dist/protocols/google-images.js +10 -37
  56. package/dist/protocols/google-interactions.d.ts +4 -0
  57. package/dist/protocols/google-interactions.js +12 -5
  58. package/dist/protocols/google-speech.d.ts +0 -18
  59. package/dist/protocols/google-speech.js +0 -1
  60. package/dist/protocols/google-transcription.d.ts +0 -18
  61. package/dist/protocols/google-transcription.js +0 -1
  62. package/dist/protocols/google-video.d.ts +1 -1
  63. package/dist/protocols/google-video.js +2 -7
  64. package/dist/protocols/index.d.ts +3 -0
  65. package/dist/protocols/index.js +3 -0
  66. package/dist/protocols/meta-images.d.ts +7 -1
  67. package/dist/protocols/meta-images.js +10 -8
  68. package/dist/protocols/meta-messages.d.ts +52 -17
  69. package/dist/protocols/meta-messages.js +14 -1
  70. package/dist/protocols/meta-responses.d.ts +46 -6
  71. package/dist/protocols/meta-responses.js +29 -1
  72. package/dist/protocols/minimax-images.d.ts +25 -0
  73. package/dist/protocols/minimax-images.js +150 -0
  74. package/dist/protocols/open-responses.d.ts +212 -27
  75. package/dist/protocols/open-responses.js +116 -54
  76. package/dist/protocols/openai-chat.d.ts +1135 -31
  77. package/dist/protocols/openai-chat.js +155 -60
  78. package/dist/protocols/openai-compatible-chat.d.ts +57 -5
  79. package/dist/protocols/openai-compatible-responses.d.ts +28 -8
  80. package/dist/protocols/openai-decisions.d.ts +22 -0
  81. package/dist/protocols/openai-decisions.js +128 -0
  82. package/dist/protocols/openai-freeform.d.ts +47 -0
  83. package/dist/protocols/openai-freeform.js +54 -0
  84. package/dist/protocols/openai-images.d.ts +36 -24
  85. package/dist/protocols/openai-images.js +137 -39
  86. package/dist/protocols/openai-responses.d.ts +202 -42
  87. package/dist/protocols/openai-responses.js +49 -10
  88. package/dist/protocols/openai-speech.d.ts +0 -18
  89. package/dist/protocols/openai-speech.js +15 -5
  90. package/dist/protocols/openai-transcription.d.ts +0 -18
  91. package/dist/protocols/openai-transcription.js +3 -4
  92. package/dist/protocols/runway-video.d.ts +1 -1
  93. package/dist/protocols/runway-video.js +1 -1
  94. package/dist/protocols/shared.d.ts +9 -1
  95. package/dist/protocols/shared.js +13 -2
  96. package/dist/protocols/system-one.d.ts +101 -0
  97. package/dist/protocols/system-one.js +230 -0
  98. package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
  99. package/dist/protocols/utils/bedrock-cache.js +7 -6
  100. package/dist/protocols/utils/cache.d.ts +14 -3
  101. package/dist/protocols/utils/cache.js +11 -4
  102. package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
  103. package/dist/protocols/utils/gemini-generate-content.js +10 -16
  104. package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
  105. package/dist/protocols/utils/gemini-json-schema.js +3 -3
  106. package/dist/protocols/utils/image-sizing.d.ts +31 -0
  107. package/dist/protocols/utils/image-sizing.js +73 -0
  108. package/dist/protocols/utils/media-input.d.ts +4 -5
  109. package/dist/protocols/utils/media-input.js +8 -5
  110. package/dist/protocols/utils/speech-stream.d.ts +0 -1
  111. package/dist/protocols/utils/speech-stream.js +0 -1
  112. package/dist/protocols/utils/tool-schema.js +15 -5
  113. package/dist/protocols/utils/tool-stream.d.ts +9 -0
  114. package/dist/protocols/venice-chat.d.ts +58 -4
  115. package/dist/protocols/venice-chat.js +2 -2
  116. package/dist/protocols/xai-images.d.ts +7 -2
  117. package/dist/protocols/xai-images.js +11 -5
  118. package/dist/protocols/xai-responses.d.ts +30 -3
  119. package/dist/protocols/xai-responses.js +30 -3
  120. package/dist/protocols/xai-video.d.ts +1 -1
  121. package/dist/protocols/xai-video.js +11 -8
  122. package/dist/protocols/zai-chat.d.ts +60 -4
  123. package/dist/protocols/zai-images.d.ts +3 -1
  124. package/dist/protocols/zai-images.js +12 -11
  125. package/dist/protocols/zai-messages.d.ts +52 -17
  126. package/dist/provider-error.js +23 -7
  127. package/dist/provider-package.d.ts +2 -0
  128. package/dist/providers/alibaba/images.d.ts +2 -0
  129. package/dist/providers/alibaba/images.js +1 -0
  130. package/dist/providers/alibaba.d.ts +137 -28
  131. package/dist/providers/alibaba.js +16 -8
  132. package/dist/providers/amazon-bedrock-mantle.d.ts +259 -145
  133. package/dist/providers/amazon-bedrock-mantle.js +1 -1
  134. package/dist/providers/amazon-bedrock.d.ts +34 -14
  135. package/dist/providers/amazon-bedrock.js +11 -11
  136. package/dist/providers/anthropic-compatible.d.ts +53 -18
  137. package/dist/providers/anthropic.d.ts +53 -18
  138. package/dist/providers/anthropic.js +1 -1
  139. package/dist/providers/azure/images.d.ts +2 -0
  140. package/dist/providers/azure/images.js +1 -0
  141. package/dist/providers/azure.d.ts +129 -24
  142. package/dist/providers/azure.js +19 -1
  143. package/dist/providers/baseten/decisions.d.ts +2 -0
  144. package/dist/providers/baseten/decisions.js +1 -0
  145. package/dist/providers/baseten.d.ts +124 -12
  146. package/dist/providers/baseten.js +41 -8
  147. package/dist/providers/cerebras.d.ts +115 -11
  148. package/dist/providers/cerebras.js +1 -1
  149. package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
  150. package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
  151. package/dist/providers/cloudflare-ai-gateway.d.ts +290 -60
  152. package/dist/providers/cloudflare-ai-gateway.js +32 -4
  153. package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
  154. package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
  155. package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
  156. package/dist/providers/cloudflare-workers-ai/images.js +1 -0
  157. package/dist/providers/cloudflare-workers-ai.d.ts +128 -12
  158. package/dist/providers/cloudflare-workers-ai.js +45 -9
  159. package/dist/providers/cohere/chat.d.ts +1 -1
  160. package/dist/providers/cohere/chat.js +1 -1
  161. package/dist/providers/cohere.d.ts +115 -11
  162. package/dist/providers/cohere.js +1 -1
  163. package/dist/providers/deepinfra.d.ts +115 -11
  164. package/dist/providers/deepinfra.js +1 -1
  165. package/dist/providers/deepseek.d.ts +115 -11
  166. package/dist/providers/deepseek.js +1 -1
  167. package/dist/providers/digitalocean/decisions.d.ts +2 -0
  168. package/dist/providers/digitalocean/decisions.js +1 -0
  169. package/dist/providers/digitalocean/images.d.ts +2 -0
  170. package/dist/providers/digitalocean/images.js +1 -0
  171. package/dist/providers/digitalocean/responses.d.ts +4 -0
  172. package/dist/providers/digitalocean/responses.js +1 -0
  173. package/dist/providers/digitalocean.d.ts +390 -20
  174. package/dist/providers/digitalocean.js +53 -11
  175. package/dist/providers/fireworks.d.ts +115 -11
  176. package/dist/providers/fireworks.js +1 -1
  177. package/dist/providers/google/images.d.ts +2 -0
  178. package/dist/providers/google/images.js +1 -0
  179. package/dist/providers/google/interactions.d.ts +1 -1
  180. package/dist/providers/google/interactions.js +1 -1
  181. package/dist/providers/google-vertex/images.d.ts +2 -0
  182. package/dist/providers/google-vertex/images.js +1 -0
  183. package/dist/providers/google-vertex-chat.d.ts +57 -5
  184. package/dist/providers/google-vertex-chat.js +1 -1
  185. package/dist/providers/google-vertex-interactions.d.ts +1 -1
  186. package/dist/providers/google-vertex-interactions.js +1 -1
  187. package/dist/providers/google-vertex-messages.d.ts +53 -18
  188. package/dist/providers/google-vertex-messages.js +1 -1
  189. package/dist/providers/google-vertex-mistral.d.ts +1 -1
  190. package/dist/providers/google-vertex-mistral.js +1 -1
  191. package/dist/providers/google-vertex-responses.d.ts +24 -4
  192. package/dist/providers/google-vertex-responses.js +1 -1
  193. package/dist/providers/google-vertex.d.ts +4 -2
  194. package/dist/providers/google-vertex.js +30 -13
  195. package/dist/providers/google.d.ts +6 -5
  196. package/dist/providers/google.js +15 -8
  197. package/dist/providers/groq.d.ts +119 -15
  198. package/dist/providers/groq.js +1 -7
  199. package/dist/providers/index.d.ts +0 -4
  200. package/dist/providers/index.js +0 -4
  201. package/dist/providers/meta/images.d.ts +2 -0
  202. package/dist/providers/meta/images.js +1 -0
  203. package/dist/providers/meta.d.ts +254 -146
  204. package/dist/providers/meta.js +2 -1
  205. package/dist/providers/minimax/chat.d.ts +1 -1
  206. package/dist/providers/minimax/chat.js +1 -1
  207. package/dist/providers/minimax/images.d.ts +3 -0
  208. package/dist/providers/minimax/images.js +1 -0
  209. package/dist/providers/minimax/responses.d.ts +1 -1
  210. package/dist/providers/minimax/responses.js +1 -1
  211. package/dist/providers/minimax.d.ts +139 -26
  212. package/dist/providers/minimax.js +22 -9
  213. package/dist/providers/mistral.d.ts +3 -3
  214. package/dist/providers/mistral.js +1 -1
  215. package/dist/providers/moonshot/messages.d.ts +1 -1
  216. package/dist/providers/moonshot/messages.js +1 -1
  217. package/dist/providers/moonshot/responses.d.ts +1 -1
  218. package/dist/providers/moonshot/responses.js +1 -1
  219. package/dist/providers/moonshot.d.ts +132 -25
  220. package/dist/providers/moonshot.js +1 -1
  221. package/dist/providers/openai/images.d.ts +2 -0
  222. package/dist/providers/openai/images.js +1 -0
  223. package/dist/providers/openai-compatible/images.d.ts +2 -0
  224. package/dist/providers/openai-compatible/images.js +1 -0
  225. package/dist/providers/openai-compatible-responses.d.ts +24 -4
  226. package/dist/providers/openai-compatible.d.ts +62 -8
  227. package/dist/providers/openai-compatible.js +29 -10
  228. package/dist/providers/openai-options.d.ts +3 -1
  229. package/dist/providers/openai.d.ts +103 -18
  230. package/dist/providers/openai.js +23 -5
  231. package/dist/providers/opencode/decisions.d.ts +2 -0
  232. package/dist/providers/opencode/decisions.js +1 -0
  233. package/dist/providers/opencode.d.ts +11 -12
  234. package/dist/providers/opencode.js +10 -8
  235. package/dist/providers/openrouter/decisions.d.ts +2 -0
  236. package/dist/providers/openrouter/decisions.js +1 -0
  237. package/dist/providers/openrouter/images.d.ts +2 -0
  238. package/dist/providers/openrouter/images.js +1 -0
  239. package/dist/providers/openrouter/responses.d.ts +4 -0
  240. package/dist/providers/openrouter/responses.js +1 -0
  241. package/dist/providers/openrouter.d.ts +446 -35
  242. package/dist/providers/openrouter.js +78 -27
  243. package/dist/providers/togetherai.d.ts +115 -11
  244. package/dist/providers/togetherai.js +1 -1
  245. package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
  246. package/dist/providers/typesafe-ai/decisions.js +1 -0
  247. package/dist/providers/typesafe-ai.d.ts +11 -12
  248. package/dist/providers/typesafe-ai.js +10 -8
  249. package/dist/providers/venice/responses.d.ts +4 -0
  250. package/dist/providers/venice/responses.js +1 -0
  251. package/dist/providers/venice.d.ts +261 -9
  252. package/dist/providers/venice.js +33 -17
  253. package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
  254. package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
  255. package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
  256. package/dist/providers/vercel-ai-gateway/images.js +1 -0
  257. package/dist/providers/vercel-ai-gateway.d.ts +16 -22
  258. package/dist/providers/vercel-ai-gateway.js +41 -85
  259. package/dist/providers/xai/images.d.ts +2 -0
  260. package/dist/providers/xai/images.js +1 -0
  261. package/dist/providers/xai.d.ts +66 -12
  262. package/dist/providers/xai.js +15 -8
  263. package/dist/providers/zai/images.d.ts +2 -0
  264. package/dist/providers/zai/images.js +1 -0
  265. package/dist/providers/zai-coding-plan/messages.d.ts +1 -1
  266. package/dist/providers/zai-coding-plan/messages.js +1 -1
  267. package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
  268. package/dist/providers/zai-coding-plan/responses.js +1 -1
  269. package/dist/providers/zai-coding-plan.d.ts +132 -25
  270. package/dist/providers/zai-coding-plan.js +1 -1
  271. package/dist/providers/zai.d.ts +62 -9
  272. package/dist/providers/zai.js +15 -8
  273. package/dist/route/auth.d.ts +1 -1
  274. package/dist/route/client.d.ts +2 -2
  275. package/dist/route/client.js +26 -4
  276. package/dist/route/decision.d.ts +58 -0
  277. package/dist/route/decision.js +75 -0
  278. package/dist/route/executor.d.ts +1 -1
  279. package/dist/route/framing.d.ts +2 -0
  280. package/dist/route/index.d.ts +3 -0
  281. package/dist/route/index.js +3 -0
  282. package/dist/route/media-protocol.d.ts +3 -4
  283. package/dist/route/media-protocol.js +12 -8
  284. package/dist/route/media.d.ts +6 -2
  285. package/dist/route/media.js +8 -6
  286. package/dist/route/transport/http.js +1 -0
  287. package/dist/route/transport/index.d.ts +1 -0
  288. package/dist/schema/events.d.ts +148 -6
  289. package/dist/schema/events.js +20 -0
  290. package/dist/schema/messages.d.ts +41 -3
  291. package/dist/schema/messages.js +23 -0
  292. package/dist/schema/options.d.ts +5 -3
  293. package/dist/schema/options.js +8 -3
  294. package/dist/speech-client.d.ts +53 -14
  295. package/dist/speech-client.js +0 -1
  296. package/dist/speech.d.ts +0 -135
  297. package/dist/speech.js +2 -4
  298. package/dist/testing/decision.d.ts +16 -0
  299. package/dist/testing/decision.js +20 -0
  300. package/dist/testing/image.d.ts +14 -0
  301. package/dist/testing/image.js +12 -0
  302. package/dist/testing/media.d.ts +18 -0
  303. package/dist/testing/media.js +36 -0
  304. package/dist/testing/script.d.ts +28 -0
  305. package/dist/testing/script.js +60 -0
  306. package/dist/testing/speech.d.ts +14 -0
  307. package/dist/testing/speech.js +12 -0
  308. package/dist/testing/transcription.d.ts +14 -0
  309. package/dist/testing/transcription.js +12 -0
  310. package/dist/testing/video.d.ts +14 -0
  311. package/dist/testing/video.js +12 -0
  312. package/dist/testing.d.ts +35 -45
  313. package/dist/testing.js +14 -75
  314. package/dist/tool.d.ts +12 -1
  315. package/dist/tool.js +10 -2
  316. package/dist/transcription-client.d.ts +69 -14
  317. package/dist/transcription.d.ts +0 -135
  318. package/dist/transcription.js +1 -1
  319. package/dist/utils/media-type.js +22 -1
  320. package/dist/video-client.d.ts +46 -14
  321. package/dist/video-client.js +0 -1
  322. package/dist/video.d.ts +1 -136
  323. package/dist/video.js +3 -5
  324. package/package.json +497 -11
  325. package/dist/experimental/evaluation-client.d.ts +0 -21
  326. package/dist/experimental/evaluation-client.js +0 -64
  327. package/dist/experimental/evaluation.d.ts +0 -242
  328. package/dist/experimental/evaluation.js +0 -108
  329. package/dist/experimental/system-one.d.ts +0 -16
  330. package/dist/experimental/system-one.js +0 -135
  331. package/dist/promise.d.ts +0 -1021
  332. package/dist/promise.js +0 -101
  333. package/dist/protocols/bfl-images.d.ts +0 -38
  334. package/dist/protocols/bfl-images.js +0 -153
  335. package/dist/protocols/fal-images.d.ts +0 -25
  336. package/dist/protocols/fal-images.js +0 -104
  337. package/dist/protocols/fal-video.d.ts +0 -29
  338. package/dist/protocols/fal-video.js +0 -73
  339. package/dist/protocols/replicate-images.d.ts +0 -28
  340. package/dist/protocols/replicate-images.js +0 -127
  341. package/dist/protocols/stability-images.d.ts +0 -39
  342. package/dist/protocols/stability-images.js +0 -136
  343. package/dist/protocols/utils/fal-queue.d.ts +0 -26
  344. package/dist/protocols/utils/fal-queue.js +0 -67
  345. package/dist/provider.d.ts +0 -23
  346. package/dist/provider.js +0 -2
  347. package/dist/providers/black-forest-labs.d.ts +0 -21
  348. package/dist/providers/black-forest-labs.js +0 -23
  349. package/dist/providers/fal.d.ts +0 -24
  350. package/dist/providers/fal.js +0 -26
  351. package/dist/providers/replicate.d.ts +0 -21
  352. package/dist/providers/replicate.js +0 -17
  353. package/dist/providers/stability.d.ts +0 -23
  354. package/dist/providers/stability.js +0 -18
@@ -7,6 +7,7 @@ import { AIError, LLMEvent, Usage, type FinishReasonDetails, type CacheHint, typ
7
7
  import { OpenResponsesOptions } from "./utils/open-responses-options.js";
8
8
  import { Lifecycle } from "./utils/lifecycle.js";
9
9
  import { ToolStream } from "./utils/tool-stream.js";
10
+ import { OpenAIFreeform } from "./openai-freeform.js";
10
11
  export declare const DEFAULT_BASE_URL = "https://api.openai.com/v1";
11
12
  export declare const PATH = "/chat/completions";
12
13
  declare const OpenAIChatCacheControl: Schema.Struct<{
@@ -32,6 +33,14 @@ export declare const OpenAIChatAssistantToolCall: Schema.Struct<{
32
33
  }>;
33
34
  }>>;
34
35
  }>;
36
+ export declare const OpenAIChatAssistantCustomToolCall: Schema.Struct<{
37
+ readonly id: Schema.String;
38
+ readonly type: Schema.tag<"custom">;
39
+ readonly custom: Schema.Struct<{
40
+ readonly name: Schema.String;
41
+ readonly input: Schema.String;
42
+ }>;
43
+ }>;
35
44
  declare const ReasoningDetail: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
36
45
  readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
37
46
  readonly format: Schema.optional<Schema.String>;
@@ -77,6 +86,11 @@ export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [S
77
86
  readonly image_url: Schema.Struct<{
78
87
  readonly url: Schema.String;
79
88
  }>;
89
+ }>, Schema.Struct<{
90
+ readonly type: Schema.Literal<"video_url">;
91
+ readonly video_url: Schema.Struct<{
92
+ readonly url: Schema.String;
93
+ }>;
80
94
  }>, Schema.Struct<{
81
95
  readonly type: Schema.Literal<"file">;
82
96
  readonly file: Schema.Struct<{
@@ -98,6 +112,11 @@ export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [S
98
112
  readonly image_url: Schema.Struct<{
99
113
  readonly url: Schema.String;
100
114
  }>;
115
+ }>, Schema.Struct<{
116
+ readonly type: Schema.Literal<"video_url">;
117
+ readonly video_url: Schema.Struct<{
118
+ readonly url: Schema.String;
119
+ }>;
101
120
  }>, Schema.Struct<{
102
121
  readonly type: Schema.Literal<"file">;
103
122
  readonly file: Schema.Struct<{
@@ -115,7 +134,7 @@ export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [S
115
134
  readonly ttl: Schema.optional<Schema.String>;
116
135
  }>>;
117
136
  }>>]>>;
118
- readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
137
+ readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
119
138
  readonly id: Schema.String;
120
139
  readonly type: Schema.tag<"function">;
121
140
  readonly function: Schema.Struct<{
@@ -127,7 +146,14 @@ export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [S
127
146
  readonly thought_signature: Schema.String;
128
147
  }>;
129
148
  }>>;
130
- }>>>;
149
+ }>, Schema.Struct<{
150
+ readonly id: Schema.String;
151
+ readonly type: Schema.tag<"custom">;
152
+ readonly custom: Schema.Struct<{
153
+ readonly name: Schema.String;
154
+ readonly input: Schema.String;
155
+ }>;
156
+ }>]>>>;
131
157
  readonly reasoning_content: Schema.optional<Schema.String>;
132
158
  readonly reasoning: Schema.optional<Schema.String>;
133
159
  readonly reasoning_text: Schema.optional<Schema.String>;
@@ -161,6 +187,11 @@ export declare const bodyFields: {
161
187
  readonly image_url: Schema.Struct<{
162
188
  readonly url: Schema.String;
163
189
  }>;
190
+ }>, Schema.Struct<{
191
+ readonly type: Schema.Literal<"video_url">;
192
+ readonly video_url: Schema.Struct<{
193
+ readonly url: Schema.String;
194
+ }>;
164
195
  }>, Schema.Struct<{
165
196
  readonly type: Schema.Literal<"file">;
166
197
  readonly file: Schema.Struct<{
@@ -182,6 +213,11 @@ export declare const bodyFields: {
182
213
  readonly image_url: Schema.Struct<{
183
214
  readonly url: Schema.String;
184
215
  }>;
216
+ }>, Schema.Struct<{
217
+ readonly type: Schema.Literal<"video_url">;
218
+ readonly video_url: Schema.Struct<{
219
+ readonly url: Schema.String;
220
+ }>;
185
221
  }>, Schema.Struct<{
186
222
  readonly type: Schema.Literal<"file">;
187
223
  readonly file: Schema.Struct<{
@@ -199,7 +235,7 @@ export declare const bodyFields: {
199
235
  readonly ttl: Schema.optional<Schema.String>;
200
236
  }>>;
201
237
  }>>]>>;
202
- readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
238
+ readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
203
239
  readonly id: Schema.String;
204
240
  readonly type: Schema.tag<"function">;
205
241
  readonly function: Schema.Struct<{
@@ -211,7 +247,14 @@ export declare const bodyFields: {
211
247
  readonly thought_signature: Schema.String;
212
248
  }>;
213
249
  }>>;
214
- }>>>;
250
+ }>, Schema.Struct<{
251
+ readonly id: Schema.String;
252
+ readonly type: Schema.tag<"custom">;
253
+ readonly custom: Schema.Struct<{
254
+ readonly name: Schema.String;
255
+ readonly input: Schema.String;
256
+ }>;
257
+ }>]>>>;
215
258
  readonly reasoning_content: Schema.optional<Schema.String>;
216
259
  readonly reasoning: Schema.optional<Schema.String>;
217
260
  readonly reasoning_text: Schema.optional<Schema.String>;
@@ -228,7 +271,7 @@ export declare const bodyFields: {
228
271
  }>>;
229
272
  }>>]>;
230
273
  }>]>>;
231
- tools: Schema.optional<Schema.$Array<Schema.Struct<{
274
+ tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
232
275
  readonly type: Schema.tag<"function">;
233
276
  readonly function: Schema.Struct<{
234
277
  readonly name: Schema.String;
@@ -240,12 +283,36 @@ export declare const bodyFields: {
240
283
  readonly type: Schema.Literal<"ephemeral">;
241
284
  readonly ttl: Schema.optional<Schema.String>;
242
285
  }>>;
243
- }>>>;
286
+ }>, Schema.Struct<{
287
+ readonly type: Schema.tag<"custom">;
288
+ readonly custom: Schema.Struct<{
289
+ readonly name: Schema.String;
290
+ readonly description: Schema.String;
291
+ readonly format: Schema.Union<readonly [Schema.Struct<{
292
+ readonly type: Schema.tag<"text">;
293
+ }>, Schema.Struct<{
294
+ readonly type: Schema.tag<"grammar">;
295
+ readonly grammar: Schema.Struct<{
296
+ readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
297
+ readonly definition: Schema.String;
298
+ }>;
299
+ }>]>;
300
+ }>;
301
+ readonly cache_control: Schema.optional<Schema.Struct<{
302
+ readonly type: Schema.Literal<"ephemeral">;
303
+ readonly ttl: Schema.optional<Schema.String>;
304
+ }>>;
305
+ }>]>>>;
244
306
  tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
245
307
  readonly type: Schema.tag<"function">;
246
308
  readonly function: Schema.Struct<{
247
309
  readonly name: Schema.String;
248
310
  }>;
311
+ }>, Schema.Struct<{
312
+ readonly type: Schema.tag<"custom">;
313
+ readonly custom: Schema.Struct<{
314
+ readonly name: Schema.String;
315
+ }>;
249
316
  }>]>>;
250
317
  stream: Schema.Literal<true>;
251
318
  stream_options: Schema.optional<Schema.Struct<{
@@ -253,7 +320,16 @@ export declare const bodyFields: {
253
320
  }>>;
254
321
  store: Schema.optional<Schema.Boolean>;
255
322
  prompt_cache_key: Schema.optional<Schema.String>;
323
+ prompt_cache_retention: Schema.optional<Schema.String>;
324
+ prompt_cache_options: Schema.optional<Schema.Struct<{
325
+ readonly ttl: Schema.optional<Schema.String>;
326
+ }>>;
256
327
  reasoning_effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
328
+ verbosity: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium">, import("../schema/options.js").OpenString<"high" | "low" | "medium">>>;
329
+ service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>>;
330
+ parallel_tool_calls: Schema.optional<Schema.Boolean>;
331
+ metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
332
+ safety_identifier: Schema.optional<Schema.String>;
257
333
  tool_stream: Schema.optional<Schema.Boolean>;
258
334
  max_completion_tokens: Schema.optional<Schema.Number>;
259
335
  max_tokens: Schema.optional<Schema.Number>;
@@ -280,6 +356,11 @@ declare const OpenAIChatBody: Schema.Struct<{
280
356
  readonly image_url: Schema.Struct<{
281
357
  readonly url: Schema.String;
282
358
  }>;
359
+ }>, Schema.Struct<{
360
+ readonly type: Schema.Literal<"video_url">;
361
+ readonly video_url: Schema.Struct<{
362
+ readonly url: Schema.String;
363
+ }>;
283
364
  }>, Schema.Struct<{
284
365
  readonly type: Schema.Literal<"file">;
285
366
  readonly file: Schema.Struct<{
@@ -301,6 +382,11 @@ declare const OpenAIChatBody: Schema.Struct<{
301
382
  readonly image_url: Schema.Struct<{
302
383
  readonly url: Schema.String;
303
384
  }>;
385
+ }>, Schema.Struct<{
386
+ readonly type: Schema.Literal<"video_url">;
387
+ readonly video_url: Schema.Struct<{
388
+ readonly url: Schema.String;
389
+ }>;
304
390
  }>, Schema.Struct<{
305
391
  readonly type: Schema.Literal<"file">;
306
392
  readonly file: Schema.Struct<{
@@ -318,7 +404,7 @@ declare const OpenAIChatBody: Schema.Struct<{
318
404
  readonly ttl: Schema.optional<Schema.String>;
319
405
  }>>;
320
406
  }>>]>>;
321
- readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
407
+ readonly tool_calls: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
322
408
  readonly id: Schema.String;
323
409
  readonly type: Schema.tag<"function">;
324
410
  readonly function: Schema.Struct<{
@@ -330,7 +416,14 @@ declare const OpenAIChatBody: Schema.Struct<{
330
416
  readonly thought_signature: Schema.String;
331
417
  }>;
332
418
  }>>;
333
- }>>>;
419
+ }>, Schema.Struct<{
420
+ readonly id: Schema.String;
421
+ readonly type: Schema.tag<"custom">;
422
+ readonly custom: Schema.Struct<{
423
+ readonly name: Schema.String;
424
+ readonly input: Schema.String;
425
+ }>;
426
+ }>]>>>;
334
427
  readonly reasoning_content: Schema.optional<Schema.String>;
335
428
  readonly reasoning: Schema.optional<Schema.String>;
336
429
  readonly reasoning_text: Schema.optional<Schema.String>;
@@ -347,7 +440,7 @@ declare const OpenAIChatBody: Schema.Struct<{
347
440
  }>>;
348
441
  }>>]>;
349
442
  }>]>>;
350
- tools: Schema.optional<Schema.$Array<Schema.Struct<{
443
+ tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
351
444
  readonly type: Schema.tag<"function">;
352
445
  readonly function: Schema.Struct<{
353
446
  readonly name: Schema.String;
@@ -359,12 +452,36 @@ declare const OpenAIChatBody: Schema.Struct<{
359
452
  readonly type: Schema.Literal<"ephemeral">;
360
453
  readonly ttl: Schema.optional<Schema.String>;
361
454
  }>>;
362
- }>>>;
455
+ }>, Schema.Struct<{
456
+ readonly type: Schema.tag<"custom">;
457
+ readonly custom: Schema.Struct<{
458
+ readonly name: Schema.String;
459
+ readonly description: Schema.String;
460
+ readonly format: Schema.Union<readonly [Schema.Struct<{
461
+ readonly type: Schema.tag<"text">;
462
+ }>, Schema.Struct<{
463
+ readonly type: Schema.tag<"grammar">;
464
+ readonly grammar: Schema.Struct<{
465
+ readonly syntax: Schema.Literals<readonly ["lark", "regex"]>;
466
+ readonly definition: Schema.String;
467
+ }>;
468
+ }>]>;
469
+ }>;
470
+ readonly cache_control: Schema.optional<Schema.Struct<{
471
+ readonly type: Schema.Literal<"ephemeral">;
472
+ readonly ttl: Schema.optional<Schema.String>;
473
+ }>>;
474
+ }>]>>>;
363
475
  tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
364
476
  readonly type: Schema.tag<"function">;
365
477
  readonly function: Schema.Struct<{
366
478
  readonly name: Schema.String;
367
479
  }>;
480
+ }>, Schema.Struct<{
481
+ readonly type: Schema.tag<"custom">;
482
+ readonly custom: Schema.Struct<{
483
+ readonly name: Schema.String;
484
+ }>;
368
485
  }>]>>;
369
486
  stream: Schema.Literal<true>;
370
487
  stream_options: Schema.optional<Schema.Struct<{
@@ -372,7 +489,16 @@ declare const OpenAIChatBody: Schema.Struct<{
372
489
  }>>;
373
490
  store: Schema.optional<Schema.Boolean>;
374
491
  prompt_cache_key: Schema.optional<Schema.String>;
492
+ prompt_cache_retention: Schema.optional<Schema.String>;
493
+ prompt_cache_options: Schema.optional<Schema.Struct<{
494
+ readonly ttl: Schema.optional<Schema.String>;
495
+ }>>;
375
496
  reasoning_effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
497
+ verbosity: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium">, import("../schema/options.js").OpenString<"high" | "low" | "medium">>>;
498
+ service_tier: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">, import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority">>>;
499
+ parallel_tool_calls: Schema.optional<Schema.Boolean>;
500
+ metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
501
+ safety_identifier: Schema.optional<Schema.String>;
376
502
  tool_stream: Schema.optional<Schema.Boolean>;
377
503
  max_completion_tokens: Schema.optional<Schema.Number>;
378
504
  max_tokens: Schema.optional<Schema.Number>;
@@ -409,6 +535,10 @@ export declare const OpenAIChatToolCallDelta: Schema.Struct<{
409
535
  readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
410
536
  readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
411
537
  }>>>;
538
+ readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
539
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
540
+ readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
541
+ }>>>;
412
542
  readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
413
543
  }>;
414
544
  export declare const OpenAIChatDelta: Schema.StructWithRest<Schema.Struct<{
@@ -425,6 +555,10 @@ export declare const OpenAIChatDelta: Schema.StructWithRest<Schema.Struct<{
425
555
  readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
426
556
  readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
427
557
  }>>>;
558
+ readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
559
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
560
+ readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
561
+ }>>>;
428
562
  readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
429
563
  }>>>>;
430
564
  }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
@@ -443,6 +577,10 @@ export declare const OpenAIChatChoice: Schema.StructWithRest<Schema.Struct<{
443
577
  readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
444
578
  readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
445
579
  }>>>;
580
+ readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
581
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
582
+ readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
583
+ }>>>;
446
584
  readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
447
585
  }>>>>;
448
586
  }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
@@ -483,6 +621,10 @@ export declare const OpenAIChatEvent: Schema.StructWithRest<Schema.Struct<{
483
621
  readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
484
622
  readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
485
623
  }>>>;
624
+ readonly custom: Schema.optional<Schema.NullOr<Schema.Struct<{
625
+ readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
626
+ readonly input: Schema.optional<Schema.NullOr<Schema.String>>;
627
+ }>>>;
486
628
  readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
487
629
  }>>>>;
488
630
  }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
@@ -540,6 +682,9 @@ interface PendingToolDelta {
540
682
  export interface ParserState {
541
683
  readonly providerMetadataKey: string;
542
684
  readonly tools: ToolStream.State<number>;
685
+ readonly custom: ReadonlyMap<string, OpenAIFreeform.Custom>;
686
+ /** Stream indexes of custom tool calls, whose JSON fragment closes when the call finishes. */
687
+ readonly customCalls: ReadonlySet<number>;
543
688
  readonly pendingTools: Partial<Record<number, PendingToolDelta>>;
544
689
  readonly toolCallEvents: ReadonlyArray<LLMEvent>;
545
690
  readonly usage?: Usage;
@@ -564,9 +709,708 @@ interface LoweringOptions {
564
709
  export declare const fromRequest: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
565
710
  readonly [x: string]: unknown;
566
711
  }, import("../route/client.js").CompactionOperations | undefined>>, options?: LoweringOptions | undefined) => Effect.Effect<{
712
+ prompt_cache_retention?: undefined;
713
+ prompt_cache_options?: undefined;
714
+ store?: boolean | undefined;
715
+ prompt_cache_key?: string | undefined;
716
+ reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
717
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
718
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
719
+ parallel_tool_calls?: boolean | undefined;
720
+ metadata?: {
721
+ readonly [x: string]: string;
722
+ } | undefined;
723
+ safety_identifier?: string | undefined;
724
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
725
+ messages: ({
726
+ readonly role: "system";
727
+ readonly content: string | readonly ({
728
+ readonly type: "image_url";
729
+ readonly image_url: {
730
+ readonly url: string;
731
+ };
732
+ } | {
733
+ readonly type: "video_url";
734
+ readonly video_url: {
735
+ readonly url: string;
736
+ };
737
+ } | {
738
+ readonly type: "file";
739
+ readonly file: {
740
+ readonly filename: string;
741
+ readonly file_data: string;
742
+ };
743
+ } | {
744
+ readonly type: "text";
745
+ readonly text: string;
746
+ readonly cache_control?: {
747
+ readonly type: "ephemeral";
748
+ readonly ttl?: string | undefined;
749
+ } | undefined;
750
+ })[];
751
+ } | {
752
+ readonly role: "user";
753
+ readonly content: string | readonly ({
754
+ readonly type: "image_url";
755
+ readonly image_url: {
756
+ readonly url: string;
757
+ };
758
+ } | {
759
+ readonly type: "video_url";
760
+ readonly video_url: {
761
+ readonly url: string;
762
+ };
763
+ } | {
764
+ readonly type: "file";
765
+ readonly file: {
766
+ readonly filename: string;
767
+ readonly file_data: string;
768
+ };
769
+ } | {
770
+ readonly type: "text";
771
+ readonly text: string;
772
+ readonly cache_control?: {
773
+ readonly type: "ephemeral";
774
+ readonly ttl?: string | undefined;
775
+ } | undefined;
776
+ })[];
777
+ } | {
778
+ readonly role: "tool";
779
+ readonly tool_call_id: string;
780
+ readonly content: string | readonly {
781
+ readonly type: "text";
782
+ readonly text: string;
783
+ readonly cache_control?: {
784
+ readonly type: "ephemeral";
785
+ readonly ttl?: string | undefined;
786
+ } | undefined;
787
+ }[];
788
+ } | {
789
+ readonly [x: string]: unknown;
790
+ readonly role: "assistant";
791
+ readonly content: string | readonly {
792
+ readonly type: "text";
793
+ readonly text: string;
794
+ readonly cache_control?: {
795
+ readonly type: "ephemeral";
796
+ readonly ttl?: string | undefined;
797
+ } | undefined;
798
+ }[] | null;
799
+ readonly tool_calls?: readonly ({
800
+ readonly id: string;
801
+ readonly type: "custom";
802
+ readonly custom: {
803
+ readonly name: string;
804
+ readonly input: string;
805
+ };
806
+ } | {
807
+ readonly id: string;
808
+ readonly type: "function";
809
+ readonly function: {
810
+ readonly name: string;
811
+ readonly arguments: string;
812
+ };
813
+ readonly extra_content?: {
814
+ readonly google: {
815
+ readonly thought_signature: string;
816
+ };
817
+ } | undefined;
818
+ })[] | undefined;
819
+ readonly reasoning_content?: string | undefined;
820
+ readonly reasoning?: string | undefined;
821
+ readonly reasoning_text?: string | undefined;
822
+ readonly reasoning_details?: unknown;
823
+ })[];
824
+ tools: ({
825
+ readonly type: "function";
826
+ readonly function: {
827
+ readonly name: string;
828
+ readonly description: string;
829
+ readonly parameters: {
830
+ readonly [x: string]: unknown;
831
+ };
832
+ readonly strict?: boolean | undefined;
833
+ };
834
+ readonly cache_control?: {
835
+ readonly type: "ephemeral";
836
+ readonly ttl?: string | undefined;
837
+ } | undefined;
838
+ } | {
839
+ readonly type: "custom";
840
+ readonly custom: {
841
+ readonly name: string;
842
+ readonly description: string;
843
+ readonly format: {
844
+ readonly type: "text";
845
+ } | {
846
+ readonly type: "grammar";
847
+ readonly grammar: {
848
+ readonly syntax: "lark" | "regex";
849
+ readonly definition: string;
850
+ };
851
+ };
852
+ };
853
+ readonly cache_control?: {
854
+ readonly type: "ephemeral";
855
+ readonly ttl?: string | undefined;
856
+ } | undefined;
857
+ })[] | undefined;
858
+ tool_choice: "auto" | "none" | "required" | {
859
+ type: "custom";
860
+ custom: {
861
+ name: string;
862
+ };
863
+ function?: undefined;
864
+ } | {
865
+ custom?: undefined;
866
+ type: "function";
867
+ function: {
868
+ name: string;
869
+ };
870
+ } | undefined;
871
+ stream: true;
872
+ stream_options?: {
873
+ include_usage: boolean;
874
+ } | undefined;
875
+ tool_stream?: boolean | undefined;
876
+ max_completion_tokens: number | undefined;
877
+ temperature: number | undefined;
878
+ top_p: number | undefined;
879
+ frequency_penalty: number | undefined;
880
+ presence_penalty: number | undefined;
881
+ seed: number | undefined;
882
+ stop: readonly string[] | undefined;
883
+ } | {
884
+ prompt_cache_retention: string;
885
+ prompt_cache_options?: undefined;
886
+ store?: boolean | undefined;
887
+ prompt_cache_key?: string | undefined;
888
+ reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
889
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
890
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
891
+ parallel_tool_calls?: boolean | undefined;
892
+ metadata?: {
893
+ readonly [x: string]: string;
894
+ } | undefined;
895
+ safety_identifier?: string | undefined;
896
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
897
+ messages: ({
898
+ readonly role: "system";
899
+ readonly content: string | readonly ({
900
+ readonly type: "image_url";
901
+ readonly image_url: {
902
+ readonly url: string;
903
+ };
904
+ } | {
905
+ readonly type: "video_url";
906
+ readonly video_url: {
907
+ readonly url: string;
908
+ };
909
+ } | {
910
+ readonly type: "file";
911
+ readonly file: {
912
+ readonly filename: string;
913
+ readonly file_data: string;
914
+ };
915
+ } | {
916
+ readonly type: "text";
917
+ readonly text: string;
918
+ readonly cache_control?: {
919
+ readonly type: "ephemeral";
920
+ readonly ttl?: string | undefined;
921
+ } | undefined;
922
+ })[];
923
+ } | {
924
+ readonly role: "user";
925
+ readonly content: string | readonly ({
926
+ readonly type: "image_url";
927
+ readonly image_url: {
928
+ readonly url: string;
929
+ };
930
+ } | {
931
+ readonly type: "video_url";
932
+ readonly video_url: {
933
+ readonly url: string;
934
+ };
935
+ } | {
936
+ readonly type: "file";
937
+ readonly file: {
938
+ readonly filename: string;
939
+ readonly file_data: string;
940
+ };
941
+ } | {
942
+ readonly type: "text";
943
+ readonly text: string;
944
+ readonly cache_control?: {
945
+ readonly type: "ephemeral";
946
+ readonly ttl?: string | undefined;
947
+ } | undefined;
948
+ })[];
949
+ } | {
950
+ readonly role: "tool";
951
+ readonly tool_call_id: string;
952
+ readonly content: string | readonly {
953
+ readonly type: "text";
954
+ readonly text: string;
955
+ readonly cache_control?: {
956
+ readonly type: "ephemeral";
957
+ readonly ttl?: string | undefined;
958
+ } | undefined;
959
+ }[];
960
+ } | {
961
+ readonly [x: string]: unknown;
962
+ readonly role: "assistant";
963
+ readonly content: string | readonly {
964
+ readonly type: "text";
965
+ readonly text: string;
966
+ readonly cache_control?: {
967
+ readonly type: "ephemeral";
968
+ readonly ttl?: string | undefined;
969
+ } | undefined;
970
+ }[] | null;
971
+ readonly tool_calls?: readonly ({
972
+ readonly id: string;
973
+ readonly type: "custom";
974
+ readonly custom: {
975
+ readonly name: string;
976
+ readonly input: string;
977
+ };
978
+ } | {
979
+ readonly id: string;
980
+ readonly type: "function";
981
+ readonly function: {
982
+ readonly name: string;
983
+ readonly arguments: string;
984
+ };
985
+ readonly extra_content?: {
986
+ readonly google: {
987
+ readonly thought_signature: string;
988
+ };
989
+ } | undefined;
990
+ })[] | undefined;
991
+ readonly reasoning_content?: string | undefined;
992
+ readonly reasoning?: string | undefined;
993
+ readonly reasoning_text?: string | undefined;
994
+ readonly reasoning_details?: unknown;
995
+ })[];
996
+ tools: ({
997
+ readonly type: "function";
998
+ readonly function: {
999
+ readonly name: string;
1000
+ readonly description: string;
1001
+ readonly parameters: {
1002
+ readonly [x: string]: unknown;
1003
+ };
1004
+ readonly strict?: boolean | undefined;
1005
+ };
1006
+ readonly cache_control?: {
1007
+ readonly type: "ephemeral";
1008
+ readonly ttl?: string | undefined;
1009
+ } | undefined;
1010
+ } | {
1011
+ readonly type: "custom";
1012
+ readonly custom: {
1013
+ readonly name: string;
1014
+ readonly description: string;
1015
+ readonly format: {
1016
+ readonly type: "text";
1017
+ } | {
1018
+ readonly type: "grammar";
1019
+ readonly grammar: {
1020
+ readonly syntax: "lark" | "regex";
1021
+ readonly definition: string;
1022
+ };
1023
+ };
1024
+ };
1025
+ readonly cache_control?: {
1026
+ readonly type: "ephemeral";
1027
+ readonly ttl?: string | undefined;
1028
+ } | undefined;
1029
+ })[] | undefined;
1030
+ tool_choice: "auto" | "none" | "required" | {
1031
+ type: "custom";
1032
+ custom: {
1033
+ name: string;
1034
+ };
1035
+ function?: undefined;
1036
+ } | {
1037
+ custom?: undefined;
1038
+ type: "function";
1039
+ function: {
1040
+ name: string;
1041
+ };
1042
+ } | undefined;
1043
+ stream: true;
1044
+ stream_options?: {
1045
+ include_usage: boolean;
1046
+ } | undefined;
1047
+ tool_stream?: boolean | undefined;
1048
+ max_completion_tokens: number | undefined;
1049
+ temperature: number | undefined;
1050
+ top_p: number | undefined;
1051
+ frequency_penalty: number | undefined;
1052
+ presence_penalty: number | undefined;
1053
+ seed: number | undefined;
1054
+ stop: readonly string[] | undefined;
1055
+ } | {
1056
+ prompt_cache_retention?: undefined;
1057
+ prompt_cache_options: {
1058
+ ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s`;
1059
+ };
1060
+ store?: boolean | undefined;
1061
+ prompt_cache_key?: string | undefined;
1062
+ reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1063
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1064
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1065
+ parallel_tool_calls?: boolean | undefined;
1066
+ metadata?: {
1067
+ readonly [x: string]: string;
1068
+ } | undefined;
1069
+ safety_identifier?: string | undefined;
1070
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
1071
+ messages: ({
1072
+ readonly role: "system";
1073
+ readonly content: string | readonly ({
1074
+ readonly type: "image_url";
1075
+ readonly image_url: {
1076
+ readonly url: string;
1077
+ };
1078
+ } | {
1079
+ readonly type: "video_url";
1080
+ readonly video_url: {
1081
+ readonly url: string;
1082
+ };
1083
+ } | {
1084
+ readonly type: "file";
1085
+ readonly file: {
1086
+ readonly filename: string;
1087
+ readonly file_data: string;
1088
+ };
1089
+ } | {
1090
+ readonly type: "text";
1091
+ readonly text: string;
1092
+ readonly cache_control?: {
1093
+ readonly type: "ephemeral";
1094
+ readonly ttl?: string | undefined;
1095
+ } | undefined;
1096
+ })[];
1097
+ } | {
1098
+ readonly role: "user";
1099
+ readonly content: string | readonly ({
1100
+ readonly type: "image_url";
1101
+ readonly image_url: {
1102
+ readonly url: string;
1103
+ };
1104
+ } | {
1105
+ readonly type: "video_url";
1106
+ readonly video_url: {
1107
+ readonly url: string;
1108
+ };
1109
+ } | {
1110
+ readonly type: "file";
1111
+ readonly file: {
1112
+ readonly filename: string;
1113
+ readonly file_data: string;
1114
+ };
1115
+ } | {
1116
+ readonly type: "text";
1117
+ readonly text: string;
1118
+ readonly cache_control?: {
1119
+ readonly type: "ephemeral";
1120
+ readonly ttl?: string | undefined;
1121
+ } | undefined;
1122
+ })[];
1123
+ } | {
1124
+ readonly role: "tool";
1125
+ readonly tool_call_id: string;
1126
+ readonly content: string | readonly {
1127
+ readonly type: "text";
1128
+ readonly text: string;
1129
+ readonly cache_control?: {
1130
+ readonly type: "ephemeral";
1131
+ readonly ttl?: string | undefined;
1132
+ } | undefined;
1133
+ }[];
1134
+ } | {
1135
+ readonly [x: string]: unknown;
1136
+ readonly role: "assistant";
1137
+ readonly content: string | readonly {
1138
+ readonly type: "text";
1139
+ readonly text: string;
1140
+ readonly cache_control?: {
1141
+ readonly type: "ephemeral";
1142
+ readonly ttl?: string | undefined;
1143
+ } | undefined;
1144
+ }[] | null;
1145
+ readonly tool_calls?: readonly ({
1146
+ readonly id: string;
1147
+ readonly type: "custom";
1148
+ readonly custom: {
1149
+ readonly name: string;
1150
+ readonly input: string;
1151
+ };
1152
+ } | {
1153
+ readonly id: string;
1154
+ readonly type: "function";
1155
+ readonly function: {
1156
+ readonly name: string;
1157
+ readonly arguments: string;
1158
+ };
1159
+ readonly extra_content?: {
1160
+ readonly google: {
1161
+ readonly thought_signature: string;
1162
+ };
1163
+ } | undefined;
1164
+ })[] | undefined;
1165
+ readonly reasoning_content?: string | undefined;
1166
+ readonly reasoning?: string | undefined;
1167
+ readonly reasoning_text?: string | undefined;
1168
+ readonly reasoning_details?: unknown;
1169
+ })[];
1170
+ tools: ({
1171
+ readonly type: "function";
1172
+ readonly function: {
1173
+ readonly name: string;
1174
+ readonly description: string;
1175
+ readonly parameters: {
1176
+ readonly [x: string]: unknown;
1177
+ };
1178
+ readonly strict?: boolean | undefined;
1179
+ };
1180
+ readonly cache_control?: {
1181
+ readonly type: "ephemeral";
1182
+ readonly ttl?: string | undefined;
1183
+ } | undefined;
1184
+ } | {
1185
+ readonly type: "custom";
1186
+ readonly custom: {
1187
+ readonly name: string;
1188
+ readonly description: string;
1189
+ readonly format: {
1190
+ readonly type: "text";
1191
+ } | {
1192
+ readonly type: "grammar";
1193
+ readonly grammar: {
1194
+ readonly syntax: "lark" | "regex";
1195
+ readonly definition: string;
1196
+ };
1197
+ };
1198
+ };
1199
+ readonly cache_control?: {
1200
+ readonly type: "ephemeral";
1201
+ readonly ttl?: string | undefined;
1202
+ } | undefined;
1203
+ })[] | undefined;
1204
+ tool_choice: "auto" | "none" | "required" | {
1205
+ type: "custom";
1206
+ custom: {
1207
+ name: string;
1208
+ };
1209
+ function?: undefined;
1210
+ } | {
1211
+ custom?: undefined;
1212
+ type: "function";
1213
+ function: {
1214
+ name: string;
1215
+ };
1216
+ } | undefined;
1217
+ stream: true;
1218
+ stream_options?: {
1219
+ include_usage: boolean;
1220
+ } | undefined;
1221
+ tool_stream?: boolean | undefined;
1222
+ max_completion_tokens: number | undefined;
1223
+ temperature: number | undefined;
1224
+ top_p: number | undefined;
1225
+ frequency_penalty: number | undefined;
1226
+ presence_penalty: number | undefined;
1227
+ seed: number | undefined;
1228
+ stop: readonly string[] | undefined;
1229
+ } | {
1230
+ prompt_cache_retention?: undefined;
1231
+ prompt_cache_options?: undefined;
1232
+ store?: boolean | undefined;
1233
+ prompt_cache_key?: string | undefined;
1234
+ reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1235
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1236
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1237
+ parallel_tool_calls?: boolean | undefined;
1238
+ metadata?: {
1239
+ readonly [x: string]: string;
1240
+ } | undefined;
1241
+ safety_identifier?: string | undefined;
1242
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
1243
+ messages: ({
1244
+ readonly role: "system";
1245
+ readonly content: string | readonly ({
1246
+ readonly type: "image_url";
1247
+ readonly image_url: {
1248
+ readonly url: string;
1249
+ };
1250
+ } | {
1251
+ readonly type: "video_url";
1252
+ readonly video_url: {
1253
+ readonly url: string;
1254
+ };
1255
+ } | {
1256
+ readonly type: "file";
1257
+ readonly file: {
1258
+ readonly filename: string;
1259
+ readonly file_data: string;
1260
+ };
1261
+ } | {
1262
+ readonly type: "text";
1263
+ readonly text: string;
1264
+ readonly cache_control?: {
1265
+ readonly type: "ephemeral";
1266
+ readonly ttl?: string | undefined;
1267
+ } | undefined;
1268
+ })[];
1269
+ } | {
1270
+ readonly role: "user";
1271
+ readonly content: string | readonly ({
1272
+ readonly type: "image_url";
1273
+ readonly image_url: {
1274
+ readonly url: string;
1275
+ };
1276
+ } | {
1277
+ readonly type: "video_url";
1278
+ readonly video_url: {
1279
+ readonly url: string;
1280
+ };
1281
+ } | {
1282
+ readonly type: "file";
1283
+ readonly file: {
1284
+ readonly filename: string;
1285
+ readonly file_data: string;
1286
+ };
1287
+ } | {
1288
+ readonly type: "text";
1289
+ readonly text: string;
1290
+ readonly cache_control?: {
1291
+ readonly type: "ephemeral";
1292
+ readonly ttl?: string | undefined;
1293
+ } | undefined;
1294
+ })[];
1295
+ } | {
1296
+ readonly role: "tool";
1297
+ readonly tool_call_id: string;
1298
+ readonly content: string | readonly {
1299
+ readonly type: "text";
1300
+ readonly text: string;
1301
+ readonly cache_control?: {
1302
+ readonly type: "ephemeral";
1303
+ readonly ttl?: string | undefined;
1304
+ } | undefined;
1305
+ }[];
1306
+ } | {
1307
+ readonly [x: string]: unknown;
1308
+ readonly role: "assistant";
1309
+ readonly content: string | readonly {
1310
+ readonly type: "text";
1311
+ readonly text: string;
1312
+ readonly cache_control?: {
1313
+ readonly type: "ephemeral";
1314
+ readonly ttl?: string | undefined;
1315
+ } | undefined;
1316
+ }[] | null;
1317
+ readonly tool_calls?: readonly ({
1318
+ readonly id: string;
1319
+ readonly type: "custom";
1320
+ readonly custom: {
1321
+ readonly name: string;
1322
+ readonly input: string;
1323
+ };
1324
+ } | {
1325
+ readonly id: string;
1326
+ readonly type: "function";
1327
+ readonly function: {
1328
+ readonly name: string;
1329
+ readonly arguments: string;
1330
+ };
1331
+ readonly extra_content?: {
1332
+ readonly google: {
1333
+ readonly thought_signature: string;
1334
+ };
1335
+ } | undefined;
1336
+ })[] | undefined;
1337
+ readonly reasoning_content?: string | undefined;
1338
+ readonly reasoning?: string | undefined;
1339
+ readonly reasoning_text?: string | undefined;
1340
+ readonly reasoning_details?: unknown;
1341
+ })[];
1342
+ tools: ({
1343
+ readonly type: "function";
1344
+ readonly function: {
1345
+ readonly name: string;
1346
+ readonly description: string;
1347
+ readonly parameters: {
1348
+ readonly [x: string]: unknown;
1349
+ };
1350
+ readonly strict?: boolean | undefined;
1351
+ };
1352
+ readonly cache_control?: {
1353
+ readonly type: "ephemeral";
1354
+ readonly ttl?: string | undefined;
1355
+ } | undefined;
1356
+ } | {
1357
+ readonly type: "custom";
1358
+ readonly custom: {
1359
+ readonly name: string;
1360
+ readonly description: string;
1361
+ readonly format: {
1362
+ readonly type: "text";
1363
+ } | {
1364
+ readonly type: "grammar";
1365
+ readonly grammar: {
1366
+ readonly syntax: "lark" | "regex";
1367
+ readonly definition: string;
1368
+ };
1369
+ };
1370
+ };
1371
+ readonly cache_control?: {
1372
+ readonly type: "ephemeral";
1373
+ readonly ttl?: string | undefined;
1374
+ } | undefined;
1375
+ })[] | undefined;
1376
+ tool_choice: "auto" | "none" | "required" | {
1377
+ type: "custom";
1378
+ custom: {
1379
+ name: string;
1380
+ };
1381
+ function?: undefined;
1382
+ } | {
1383
+ custom?: undefined;
1384
+ type: "function";
1385
+ function: {
1386
+ name: string;
1387
+ };
1388
+ } | undefined;
1389
+ stream: true;
1390
+ stream_options?: {
1391
+ include_usage: boolean;
1392
+ } | undefined;
1393
+ tool_stream?: boolean | undefined;
1394
+ max_tokens: number | undefined;
1395
+ temperature: number | undefined;
1396
+ top_p: number | undefined;
1397
+ frequency_penalty: number | undefined;
1398
+ presence_penalty: number | undefined;
1399
+ seed: number | undefined;
1400
+ stop: readonly string[] | undefined;
1401
+ } | {
1402
+ prompt_cache_retention: string;
1403
+ prompt_cache_options?: undefined;
567
1404
  store?: boolean | undefined;
568
1405
  prompt_cache_key?: string | undefined;
569
1406
  reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1407
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1408
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1409
+ parallel_tool_calls?: boolean | undefined;
1410
+ metadata?: {
1411
+ readonly [x: string]: string;
1412
+ } | undefined;
1413
+ safety_identifier?: string | undefined;
570
1414
  model: string & import("effect/Brand").Brand<"AI.ModelID">;
571
1415
  messages: ({
572
1416
  readonly role: "system";
@@ -575,6 +1419,11 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
575
1419
  readonly image_url: {
576
1420
  readonly url: string;
577
1421
  };
1422
+ } | {
1423
+ readonly type: "video_url";
1424
+ readonly video_url: {
1425
+ readonly url: string;
1426
+ };
578
1427
  } | {
579
1428
  readonly type: "file";
580
1429
  readonly file: {
@@ -596,6 +1445,11 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
596
1445
  readonly image_url: {
597
1446
  readonly url: string;
598
1447
  };
1448
+ } | {
1449
+ readonly type: "video_url";
1450
+ readonly video_url: {
1451
+ readonly url: string;
1452
+ };
599
1453
  } | {
600
1454
  readonly type: "file";
601
1455
  readonly file: {
@@ -632,7 +1486,14 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
632
1486
  readonly ttl?: string | undefined;
633
1487
  } | undefined;
634
1488
  }[] | null;
635
- readonly tool_calls?: readonly {
1489
+ readonly tool_calls?: readonly ({
1490
+ readonly id: string;
1491
+ readonly type: "custom";
1492
+ readonly custom: {
1493
+ readonly name: string;
1494
+ readonly input: string;
1495
+ };
1496
+ } | {
636
1497
  readonly id: string;
637
1498
  readonly type: "function";
638
1499
  readonly function: {
@@ -644,13 +1505,13 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
644
1505
  readonly thought_signature: string;
645
1506
  };
646
1507
  } | undefined;
647
- }[] | undefined;
1508
+ })[] | undefined;
648
1509
  readonly reasoning_content?: string | undefined;
649
1510
  readonly reasoning?: string | undefined;
650
1511
  readonly reasoning_text?: string | undefined;
651
1512
  readonly reasoning_details?: unknown;
652
1513
  })[];
653
- tools: {
1514
+ tools: ({
654
1515
  readonly type: "function";
655
1516
  readonly function: {
656
1517
  readonly name: string;
@@ -664,8 +1525,34 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
664
1525
  readonly type: "ephemeral";
665
1526
  readonly ttl?: string | undefined;
666
1527
  } | undefined;
667
- }[] | undefined;
1528
+ } | {
1529
+ readonly type: "custom";
1530
+ readonly custom: {
1531
+ readonly name: string;
1532
+ readonly description: string;
1533
+ readonly format: {
1534
+ readonly type: "text";
1535
+ } | {
1536
+ readonly type: "grammar";
1537
+ readonly grammar: {
1538
+ readonly syntax: "lark" | "regex";
1539
+ readonly definition: string;
1540
+ };
1541
+ };
1542
+ };
1543
+ readonly cache_control?: {
1544
+ readonly type: "ephemeral";
1545
+ readonly ttl?: string | undefined;
1546
+ } | undefined;
1547
+ })[] | undefined;
668
1548
  tool_choice: "auto" | "none" | "required" | {
1549
+ type: "custom";
1550
+ custom: {
1551
+ name: string;
1552
+ };
1553
+ function?: undefined;
1554
+ } | {
1555
+ custom?: undefined;
669
1556
  type: "function";
670
1557
  function: {
671
1558
  name: string;
@@ -676,7 +1563,7 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
676
1563
  include_usage: boolean;
677
1564
  } | undefined;
678
1565
  tool_stream?: boolean | undefined;
679
- max_completion_tokens: number | undefined;
1566
+ max_tokens: number | undefined;
680
1567
  temperature: number | undefined;
681
1568
  top_p: number | undefined;
682
1569
  frequency_penalty: number | undefined;
@@ -684,9 +1571,20 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
684
1571
  seed: number | undefined;
685
1572
  stop: readonly string[] | undefined;
686
1573
  } | {
1574
+ prompt_cache_retention?: undefined;
1575
+ prompt_cache_options: {
1576
+ ttl: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s`;
1577
+ };
687
1578
  store?: boolean | undefined;
688
1579
  prompt_cache_key?: string | undefined;
689
1580
  reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1581
+ verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
1582
+ service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
1583
+ parallel_tool_calls?: boolean | undefined;
1584
+ metadata?: {
1585
+ readonly [x: string]: string;
1586
+ } | undefined;
1587
+ safety_identifier?: string | undefined;
690
1588
  model: string & import("effect/Brand").Brand<"AI.ModelID">;
691
1589
  messages: ({
692
1590
  readonly role: "system";
@@ -695,6 +1593,11 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
695
1593
  readonly image_url: {
696
1594
  readonly url: string;
697
1595
  };
1596
+ } | {
1597
+ readonly type: "video_url";
1598
+ readonly video_url: {
1599
+ readonly url: string;
1600
+ };
698
1601
  } | {
699
1602
  readonly type: "file";
700
1603
  readonly file: {
@@ -716,6 +1619,11 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
716
1619
  readonly image_url: {
717
1620
  readonly url: string;
718
1621
  };
1622
+ } | {
1623
+ readonly type: "video_url";
1624
+ readonly video_url: {
1625
+ readonly url: string;
1626
+ };
719
1627
  } | {
720
1628
  readonly type: "file";
721
1629
  readonly file: {
@@ -752,7 +1660,14 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
752
1660
  readonly ttl?: string | undefined;
753
1661
  } | undefined;
754
1662
  }[] | null;
755
- readonly tool_calls?: readonly {
1663
+ readonly tool_calls?: readonly ({
1664
+ readonly id: string;
1665
+ readonly type: "custom";
1666
+ readonly custom: {
1667
+ readonly name: string;
1668
+ readonly input: string;
1669
+ };
1670
+ } | {
756
1671
  readonly id: string;
757
1672
  readonly type: "function";
758
1673
  readonly function: {
@@ -764,13 +1679,13 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
764
1679
  readonly thought_signature: string;
765
1680
  };
766
1681
  } | undefined;
767
- }[] | undefined;
1682
+ })[] | undefined;
768
1683
  readonly reasoning_content?: string | undefined;
769
1684
  readonly reasoning?: string | undefined;
770
1685
  readonly reasoning_text?: string | undefined;
771
1686
  readonly reasoning_details?: unknown;
772
1687
  })[];
773
- tools: {
1688
+ tools: ({
774
1689
  readonly type: "function";
775
1690
  readonly function: {
776
1691
  readonly name: string;
@@ -784,8 +1699,34 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
784
1699
  readonly type: "ephemeral";
785
1700
  readonly ttl?: string | undefined;
786
1701
  } | undefined;
787
- }[] | undefined;
1702
+ } | {
1703
+ readonly type: "custom";
1704
+ readonly custom: {
1705
+ readonly name: string;
1706
+ readonly description: string;
1707
+ readonly format: {
1708
+ readonly type: "text";
1709
+ } | {
1710
+ readonly type: "grammar";
1711
+ readonly grammar: {
1712
+ readonly syntax: "lark" | "regex";
1713
+ readonly definition: string;
1714
+ };
1715
+ };
1716
+ };
1717
+ readonly cache_control?: {
1718
+ readonly type: "ephemeral";
1719
+ readonly ttl?: string | undefined;
1720
+ } | undefined;
1721
+ })[] | undefined;
788
1722
  tool_choice: "auto" | "none" | "required" | {
1723
+ type: "custom";
1724
+ custom: {
1725
+ name: string;
1726
+ };
1727
+ function?: undefined;
1728
+ } | {
1729
+ custom?: undefined;
789
1730
  type: "function";
790
1731
  function: {
791
1732
  name: string;
@@ -807,6 +1748,9 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
807
1748
  export declare const finishEvents: (state: ParserState) => Effect.Effect<({
808
1749
  readonly type: "step-start";
809
1750
  readonly index: number;
1751
+ } | {
1752
+ readonly type: "raw";
1753
+ readonly data: unknown;
810
1754
  } | {
811
1755
  readonly type: "text-start";
812
1756
  readonly id: string;
@@ -1035,6 +1979,11 @@ export declare const protocol: Protocol<{
1035
1979
  readonly image_url: {
1036
1980
  readonly url: string;
1037
1981
  };
1982
+ } | {
1983
+ readonly type: "video_url";
1984
+ readonly video_url: {
1985
+ readonly url: string;
1986
+ };
1038
1987
  } | {
1039
1988
  readonly type: "file";
1040
1989
  readonly file: {
@@ -1056,6 +2005,11 @@ export declare const protocol: Protocol<{
1056
2005
  readonly image_url: {
1057
2006
  readonly url: string;
1058
2007
  };
2008
+ } | {
2009
+ readonly type: "video_url";
2010
+ readonly video_url: {
2011
+ readonly url: string;
2012
+ };
1059
2013
  } | {
1060
2014
  readonly type: "file";
1061
2015
  readonly file: {
@@ -1092,7 +2046,14 @@ export declare const protocol: Protocol<{
1092
2046
  readonly ttl?: string | undefined;
1093
2047
  } | undefined;
1094
2048
  }[] | null;
1095
- readonly tool_calls?: readonly {
2049
+ readonly tool_calls?: readonly ({
2050
+ readonly id: string;
2051
+ readonly type: "custom";
2052
+ readonly custom: {
2053
+ readonly name: string;
2054
+ readonly input: string;
2055
+ };
2056
+ } | {
1096
2057
  readonly id: string;
1097
2058
  readonly type: "function";
1098
2059
  readonly function: {
@@ -1104,13 +2065,13 @@ export declare const protocol: Protocol<{
1104
2065
  readonly thought_signature: string;
1105
2066
  };
1106
2067
  } | undefined;
1107
- }[] | undefined;
2068
+ })[] | undefined;
1108
2069
  readonly reasoning_content?: string | undefined;
1109
2070
  readonly reasoning?: string | undefined;
1110
2071
  readonly reasoning_text?: string | undefined;
1111
2072
  readonly reasoning_details?: unknown;
1112
2073
  })[];
1113
- readonly tools?: readonly {
2074
+ readonly tools?: readonly ({
1114
2075
  readonly type: "function";
1115
2076
  readonly function: {
1116
2077
  readonly name: string;
@@ -1124,12 +2085,36 @@ export declare const protocol: Protocol<{
1124
2085
  readonly type: "ephemeral";
1125
2086
  readonly ttl?: string | undefined;
1126
2087
  } | undefined;
1127
- }[] | undefined;
2088
+ } | {
2089
+ readonly type: "custom";
2090
+ readonly custom: {
2091
+ readonly name: string;
2092
+ readonly description: string;
2093
+ readonly format: {
2094
+ readonly type: "text";
2095
+ } | {
2096
+ readonly type: "grammar";
2097
+ readonly grammar: {
2098
+ readonly syntax: "lark" | "regex";
2099
+ readonly definition: string;
2100
+ };
2101
+ };
2102
+ };
2103
+ readonly cache_control?: {
2104
+ readonly type: "ephemeral";
2105
+ readonly ttl?: string | undefined;
2106
+ } | undefined;
2107
+ })[] | undefined;
1128
2108
  readonly tool_choice?: "auto" | "none" | "required" | {
1129
2109
  readonly type: "function";
1130
2110
  readonly function: {
1131
2111
  readonly name: string;
1132
2112
  };
2113
+ } | {
2114
+ readonly type: "custom";
2115
+ readonly custom: {
2116
+ readonly name: string;
2117
+ };
1133
2118
  } | undefined;
1134
2119
  readonly stream: true;
1135
2120
  readonly stream_options?: {
@@ -1137,7 +2122,18 @@ export declare const protocol: Protocol<{
1137
2122
  } | undefined;
1138
2123
  readonly store?: boolean | undefined;
1139
2124
  readonly prompt_cache_key?: string | undefined;
2125
+ readonly prompt_cache_retention?: string | undefined;
2126
+ readonly prompt_cache_options?: {
2127
+ readonly ttl?: string | undefined;
2128
+ } | undefined;
1140
2129
  readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
2130
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
2131
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
2132
+ readonly parallel_tool_calls?: boolean | undefined;
2133
+ readonly metadata?: {
2134
+ readonly [x: string]: string;
2135
+ } | undefined;
2136
+ readonly safety_identifier?: string | undefined;
1141
2137
  readonly tool_stream?: boolean | undefined;
1142
2138
  readonly max_completion_tokens?: number | undefined;
1143
2139
  readonly max_tokens?: number | undefined;
@@ -1166,6 +2162,10 @@ export declare const protocol: Protocol<{
1166
2162
  readonly name?: string | null | undefined;
1167
2163
  readonly arguments?: string | null | undefined;
1168
2164
  } | null | undefined;
2165
+ readonly custom?: {
2166
+ readonly name?: string | null | undefined;
2167
+ readonly input?: string | null | undefined;
2168
+ } | null | undefined;
1169
2169
  readonly extra_content?: unknown;
1170
2170
  }[] | null | undefined;
1171
2171
  } | null | undefined;
@@ -1230,6 +2230,11 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1230
2230
  readonly image_url: {
1231
2231
  readonly url: string;
1232
2232
  };
2233
+ } | {
2234
+ readonly type: "video_url";
2235
+ readonly video_url: {
2236
+ readonly url: string;
2237
+ };
1233
2238
  } | {
1234
2239
  readonly type: "file";
1235
2240
  readonly file: {
@@ -1251,6 +2256,11 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1251
2256
  readonly image_url: {
1252
2257
  readonly url: string;
1253
2258
  };
2259
+ } | {
2260
+ readonly type: "video_url";
2261
+ readonly video_url: {
2262
+ readonly url: string;
2263
+ };
1254
2264
  } | {
1255
2265
  readonly type: "file";
1256
2266
  readonly file: {
@@ -1287,7 +2297,14 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1287
2297
  readonly ttl?: string | undefined;
1288
2298
  } | undefined;
1289
2299
  }[] | null;
1290
- readonly tool_calls?: readonly {
2300
+ readonly tool_calls?: readonly ({
2301
+ readonly id: string;
2302
+ readonly type: "custom";
2303
+ readonly custom: {
2304
+ readonly name: string;
2305
+ readonly input: string;
2306
+ };
2307
+ } | {
1291
2308
  readonly id: string;
1292
2309
  readonly type: "function";
1293
2310
  readonly function: {
@@ -1299,13 +2316,13 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1299
2316
  readonly thought_signature: string;
1300
2317
  };
1301
2318
  } | undefined;
1302
- }[] | undefined;
2319
+ })[] | undefined;
1303
2320
  readonly reasoning_content?: string | undefined;
1304
2321
  readonly reasoning?: string | undefined;
1305
2322
  readonly reasoning_text?: string | undefined;
1306
2323
  readonly reasoning_details?: unknown;
1307
2324
  })[];
1308
- readonly tools?: readonly {
2325
+ readonly tools?: readonly ({
1309
2326
  readonly type: "function";
1310
2327
  readonly function: {
1311
2328
  readonly name: string;
@@ -1319,12 +2336,36 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1319
2336
  readonly type: "ephemeral";
1320
2337
  readonly ttl?: string | undefined;
1321
2338
  } | undefined;
1322
- }[] | undefined;
2339
+ } | {
2340
+ readonly type: "custom";
2341
+ readonly custom: {
2342
+ readonly name: string;
2343
+ readonly description: string;
2344
+ readonly format: {
2345
+ readonly type: "text";
2346
+ } | {
2347
+ readonly type: "grammar";
2348
+ readonly grammar: {
2349
+ readonly syntax: "lark" | "regex";
2350
+ readonly definition: string;
2351
+ };
2352
+ };
2353
+ };
2354
+ readonly cache_control?: {
2355
+ readonly type: "ephemeral";
2356
+ readonly ttl?: string | undefined;
2357
+ } | undefined;
2358
+ })[] | undefined;
1323
2359
  readonly tool_choice?: "auto" | "none" | "required" | {
1324
2360
  readonly type: "function";
1325
2361
  readonly function: {
1326
2362
  readonly name: string;
1327
2363
  };
2364
+ } | {
2365
+ readonly type: "custom";
2366
+ readonly custom: {
2367
+ readonly name: string;
2368
+ };
1328
2369
  } | undefined;
1329
2370
  readonly stream: true;
1330
2371
  readonly stream_options?: {
@@ -1332,7 +2373,18 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1332
2373
  } | undefined;
1333
2374
  readonly store?: boolean | undefined;
1334
2375
  readonly prompt_cache_key?: string | undefined;
2376
+ readonly prompt_cache_retention?: string | undefined;
2377
+ readonly prompt_cache_options?: {
2378
+ readonly ttl?: string | undefined;
2379
+ } | undefined;
1335
2380
  readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
2381
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
2382
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
2383
+ readonly parallel_tool_calls?: boolean | undefined;
2384
+ readonly metadata?: {
2385
+ readonly [x: string]: string;
2386
+ } | undefined;
2387
+ readonly safety_identifier?: string | undefined;
1336
2388
  readonly tool_stream?: boolean | undefined;
1337
2389
  readonly max_completion_tokens?: number | undefined;
1338
2390
  readonly max_tokens?: number | undefined;
@@ -1352,6 +2404,11 @@ export declare const route: Route<{
1352
2404
  readonly image_url: {
1353
2405
  readonly url: string;
1354
2406
  };
2407
+ } | {
2408
+ readonly type: "video_url";
2409
+ readonly video_url: {
2410
+ readonly url: string;
2411
+ };
1355
2412
  } | {
1356
2413
  readonly type: "file";
1357
2414
  readonly file: {
@@ -1373,6 +2430,11 @@ export declare const route: Route<{
1373
2430
  readonly image_url: {
1374
2431
  readonly url: string;
1375
2432
  };
2433
+ } | {
2434
+ readonly type: "video_url";
2435
+ readonly video_url: {
2436
+ readonly url: string;
2437
+ };
1376
2438
  } | {
1377
2439
  readonly type: "file";
1378
2440
  readonly file: {
@@ -1409,7 +2471,14 @@ export declare const route: Route<{
1409
2471
  readonly ttl?: string | undefined;
1410
2472
  } | undefined;
1411
2473
  }[] | null;
1412
- readonly tool_calls?: readonly {
2474
+ readonly tool_calls?: readonly ({
2475
+ readonly id: string;
2476
+ readonly type: "custom";
2477
+ readonly custom: {
2478
+ readonly name: string;
2479
+ readonly input: string;
2480
+ };
2481
+ } | {
1413
2482
  readonly id: string;
1414
2483
  readonly type: "function";
1415
2484
  readonly function: {
@@ -1421,13 +2490,13 @@ export declare const route: Route<{
1421
2490
  readonly thought_signature: string;
1422
2491
  };
1423
2492
  } | undefined;
1424
- }[] | undefined;
2493
+ })[] | undefined;
1425
2494
  readonly reasoning_content?: string | undefined;
1426
2495
  readonly reasoning?: string | undefined;
1427
2496
  readonly reasoning_text?: string | undefined;
1428
2497
  readonly reasoning_details?: unknown;
1429
2498
  })[];
1430
- readonly tools?: readonly {
2499
+ readonly tools?: readonly ({
1431
2500
  readonly type: "function";
1432
2501
  readonly function: {
1433
2502
  readonly name: string;
@@ -1441,12 +2510,36 @@ export declare const route: Route<{
1441
2510
  readonly type: "ephemeral";
1442
2511
  readonly ttl?: string | undefined;
1443
2512
  } | undefined;
1444
- }[] | undefined;
2513
+ } | {
2514
+ readonly type: "custom";
2515
+ readonly custom: {
2516
+ readonly name: string;
2517
+ readonly description: string;
2518
+ readonly format: {
2519
+ readonly type: "text";
2520
+ } | {
2521
+ readonly type: "grammar";
2522
+ readonly grammar: {
2523
+ readonly syntax: "lark" | "regex";
2524
+ readonly definition: string;
2525
+ };
2526
+ };
2527
+ };
2528
+ readonly cache_control?: {
2529
+ readonly type: "ephemeral";
2530
+ readonly ttl?: string | undefined;
2531
+ } | undefined;
2532
+ })[] | undefined;
1445
2533
  readonly tool_choice?: "auto" | "none" | "required" | {
1446
2534
  readonly type: "function";
1447
2535
  readonly function: {
1448
2536
  readonly name: string;
1449
2537
  };
2538
+ } | {
2539
+ readonly type: "custom";
2540
+ readonly custom: {
2541
+ readonly name: string;
2542
+ };
1450
2543
  } | undefined;
1451
2544
  readonly stream: true;
1452
2545
  readonly stream_options?: {
@@ -1454,7 +2547,18 @@ export declare const route: Route<{
1454
2547
  } | undefined;
1455
2548
  readonly store?: boolean | undefined;
1456
2549
  readonly prompt_cache_key?: string | undefined;
2550
+ readonly prompt_cache_retention?: string | undefined;
2551
+ readonly prompt_cache_options?: {
2552
+ readonly ttl?: string | undefined;
2553
+ } | undefined;
1457
2554
  readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
2555
+ readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
2556
+ readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
2557
+ readonly parallel_tool_calls?: boolean | undefined;
2558
+ readonly metadata?: {
2559
+ readonly [x: string]: string;
2560
+ } | undefined;
2561
+ readonly safety_identifier?: string | undefined;
1458
2562
  readonly tool_stream?: boolean | undefined;
1459
2563
  readonly max_completion_tokens?: number | undefined;
1460
2564
  readonly max_tokens?: number | undefined;