@zyro-sec/ai 1.0.0 → 1.0.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 (827) hide show
  1. package/AGENTS.md +23 -0
  2. package/example/tutorial.ts +284 -0
  3. package/package.json +11 -166
  4. package/script/pack.ts +5 -0
  5. package/script/recording-cost-report.ts +250 -0
  6. package/script/setup-recording-env.ts +602 -0
  7. package/src/ai-client.ts +28 -0
  8. package/src/cache-policy.ts +249 -0
  9. package/src/decision-client.ts +88 -0
  10. package/src/decision.ts +335 -0
  11. package/src/effect.ts +44 -0
  12. package/src/effort-updates.ts +25 -0
  13. package/src/embedding-client.ts +46 -0
  14. package/src/embedding.ts +167 -0
  15. package/src/experimental/cloudflare-run-extraction.ts +112 -0
  16. package/src/experimental/extraction.ts +190 -0
  17. package/src/experimental/realtime.ts +211 -0
  18. package/src/experimental.ts +51 -0
  19. package/src/generation.ts +210 -0
  20. package/src/image-client.ts +89 -0
  21. package/src/image.ts +236 -0
  22. package/src/index.ts +363 -0
  23. package/src/llm.ts +364 -0
  24. package/src/loop.ts +214 -0
  25. package/src/media-client.ts +94 -0
  26. package/src/media-model.ts +129 -0
  27. package/src/media.ts +408 -0
  28. package/src/protocols/alibaba-chat.ts +95 -0
  29. package/src/protocols/alibaba-images.ts +126 -0
  30. package/src/protocols/alibaba-messages.ts +49 -0
  31. package/src/protocols/alibaba-responses.ts +86 -0
  32. package/src/protocols/anthropic-messages.ts +1664 -0
  33. package/src/protocols/assemblyai-transcription.ts +209 -0
  34. package/src/protocols/bedrock-converse.ts +984 -0
  35. package/src/protocols/bedrock-event-stream.ts +147 -0
  36. package/src/protocols/cartesia-speech.ts +182 -0
  37. package/src/protocols/cloudflare-run-decisions.ts +55 -0
  38. package/src/protocols/cloudflare-workers-ai-images.ts +124 -0
  39. package/src/protocols/cohere-chat.ts +353 -0
  40. package/src/protocols/deepgram-speech.ts +148 -0
  41. package/src/protocols/deepgram-transcription.ts +179 -0
  42. package/src/protocols/elevenlabs-speech.ts +207 -0
  43. package/src/protocols/elevenlabs-transcription.ts +211 -0
  44. package/src/protocols/gemini.ts +908 -0
  45. package/src/protocols/google-decisions.ts +179 -0
  46. package/src/protocols/google-embed-content.ts +165 -0
  47. package/src/protocols/google-images.ts +255 -0
  48. package/src/protocols/google-interactions-video.ts +264 -0
  49. package/src/protocols/google-interactions.ts +904 -0
  50. package/src/protocols/google-speech.ts +157 -0
  51. package/src/protocols/google-transcription.ts +206 -0
  52. package/src/protocols/google-vertex-predict-embeddings.ts +104 -0
  53. package/src/protocols/index.ts +21 -0
  54. package/src/protocols/meta-images.ts +162 -0
  55. package/src/protocols/meta-messages.ts +67 -0
  56. package/src/protocols/meta-responses.ts +249 -0
  57. package/src/protocols/minimax-images.ts +215 -0
  58. package/src/protocols/minimax-video.ts +406 -0
  59. package/src/protocols/mistral-chat.ts +768 -0
  60. package/src/protocols/open-responses-channel.ts +198 -0
  61. package/src/protocols/open-responses-continuation.ts +218 -0
  62. package/src/protocols/open-responses.ts +1636 -0
  63. package/src/protocols/openai-chat.ts +1431 -0
  64. package/src/protocols/openai-compatible-chat.ts +22 -0
  65. package/src/protocols/openai-compatible-responses.ts +21 -0
  66. package/src/protocols/openai-decisions.ts +174 -0
  67. package/src/protocols/openai-embeddings.ts +105 -0
  68. package/src/protocols/openai-freeform.ts +287 -0
  69. package/src/protocols/openai-images.ts +442 -0
  70. package/src/protocols/openai-responses.ts +442 -0
  71. package/src/protocols/openai-speech.ts +164 -0
  72. package/src/protocols/openai-transcription.ts +295 -0
  73. package/src/protocols/openrouter-video.ts +215 -0
  74. package/src/protocols/seedance-video.ts +301 -0
  75. package/src/protocols/shared.ts +552 -0
  76. package/src/protocols/system-one.ts +335 -0
  77. package/src/protocols/utils/bedrock-auth.ts +147 -0
  78. package/src/protocols/utils/bedrock-cache.ts +56 -0
  79. package/src/protocols/utils/bedrock-media.ts +121 -0
  80. package/src/protocols/utils/cache.ts +44 -0
  81. package/src/protocols/utils/claude-model.ts +19 -0
  82. package/src/protocols/utils/gateway-protocol.ts +92 -0
  83. package/src/protocols/utils/gemini-generate-content.ts +172 -0
  84. package/src/protocols/utils/gemini-json-schema.ts +77 -0
  85. package/src/protocols/utils/image-sizing.ts +117 -0
  86. package/src/protocols/utils/lifecycle.ts +120 -0
  87. package/src/protocols/utils/media-input.ts +98 -0
  88. package/src/protocols/utils/mistral-tool-id.ts +34 -0
  89. package/src/protocols/utils/open-responses-options.ts +82 -0
  90. package/src/protocols/utils/partial-json-options.ts +62 -0
  91. package/src/protocols/utils/partial-json.ts +283 -0
  92. package/src/protocols/utils/responses-checkpoint.ts +115 -0
  93. package/src/protocols/utils/responses-compaction.ts +210 -0
  94. package/src/protocols/utils/responses-hosted-tools.ts +104 -0
  95. package/src/protocols/utils/speaker-turns.ts +10 -0
  96. package/src/protocols/utils/speech-stream.ts +111 -0
  97. package/src/protocols/utils/tool-schema.ts +115 -0
  98. package/src/protocols/utils/tool-stream.ts +240 -0
  99. package/src/protocols/venice-chat.ts +356 -0
  100. package/src/protocols/xai-images.ts +137 -0
  101. package/src/protocols/xai-responses.ts +106 -0
  102. package/src/protocols/xai-video.ts +232 -0
  103. package/src/protocols/zai-chat.ts +71 -0
  104. package/src/protocols/zai-images.ts +120 -0
  105. package/src/protocols/zai-messages.ts +34 -0
  106. package/src/protocols.ts +1 -0
  107. package/src/provider-error.ts +291 -0
  108. package/src/provider-package.ts +32 -0
  109. package/src/providers/alibaba/chat.ts +1 -0
  110. package/src/providers/alibaba/embeddings.ts +2 -0
  111. package/src/providers/alibaba/images.ts +2 -0
  112. package/src/providers/alibaba/messages.ts +3 -0
  113. package/src/providers/alibaba/responses.ts +3 -0
  114. package/src/providers/alibaba.ts +177 -0
  115. package/src/providers/amazon-bedrock/mantle/chat.ts +2 -0
  116. package/src/providers/amazon-bedrock/mantle/messages.ts +2 -0
  117. package/src/providers/amazon-bedrock/mantle/responses.ts +2 -0
  118. package/src/providers/amazon-bedrock/mantle.ts +2 -0
  119. package/src/providers/amazon-bedrock-mantle.ts +192 -0
  120. package/src/providers/amazon-bedrock.ts +81 -0
  121. package/src/providers/anthropic-compatible.ts +80 -0
  122. package/src/providers/anthropic.ts +66 -0
  123. package/src/providers/assemblyai.ts +32 -0
  124. package/src/providers/azure/chat.ts +2 -0
  125. package/src/providers/azure/embeddings.ts +2 -0
  126. package/src/providers/azure/images.ts +2 -0
  127. package/src/providers/azure/messages.ts +2 -0
  128. package/src/providers/azure/responses.ts +2 -0
  129. package/src/providers/azure.ts +240 -0
  130. package/src/providers/baseten/decisions.ts +2 -0
  131. package/src/providers/baseten.ts +88 -0
  132. package/src/providers/byteplus/videos.ts +2 -0
  133. package/src/providers/byteplus.ts +39 -0
  134. package/src/providers/cartesia.ts +28 -0
  135. package/src/providers/cerebras.ts +56 -0
  136. package/src/providers/cloudflare-ai-gateway/decisions.ts +2 -0
  137. package/src/providers/cloudflare-ai-gateway.ts +199 -0
  138. package/src/providers/cloudflare-shared.ts +29 -0
  139. package/src/providers/cloudflare-workers-ai/decisions.ts +2 -0
  140. package/src/providers/cloudflare-workers-ai/images.ts +2 -0
  141. package/src/providers/cloudflare-workers-ai.ts +104 -0
  142. package/src/providers/cohere/chat.ts +8 -0
  143. package/src/providers/cohere/embeddings.ts +2 -0
  144. package/src/providers/cohere.ts +72 -0
  145. package/src/providers/deepgram.ts +33 -0
  146. package/src/providers/deepinfra/embeddings.ts +2 -0
  147. package/src/providers/deepinfra.ts +76 -0
  148. package/src/providers/deepseek.ts +54 -0
  149. package/src/providers/digitalocean/decisions.ts +2 -0
  150. package/src/providers/digitalocean/embeddings.ts +2 -0
  151. package/src/providers/digitalocean/images.ts +2 -0
  152. package/src/providers/digitalocean/responses.ts +4 -0
  153. package/src/providers/digitalocean.ts +144 -0
  154. package/src/providers/elevenlabs.ts +35 -0
  155. package/src/providers/fireworks/embeddings.ts +2 -0
  156. package/src/providers/fireworks.ts +66 -0
  157. package/src/providers/google/decisions.ts +2 -0
  158. package/src/providers/google/embeddings.ts +2 -0
  159. package/src/providers/google/images.ts +2 -0
  160. package/src/providers/google/interactions.ts +13 -0
  161. package/src/providers/google/videos.ts +2 -0
  162. package/src/providers/google-vertex/chat.ts +2 -0
  163. package/src/providers/google-vertex/embeddings.ts +2 -0
  164. package/src/providers/google-vertex/gemini.ts +2 -0
  165. package/src/providers/google-vertex/images.ts +2 -0
  166. package/src/providers/google-vertex/interactions.ts +2 -0
  167. package/src/providers/google-vertex/messages.ts +2 -0
  168. package/src/providers/google-vertex/mistral.ts +2 -0
  169. package/src/providers/google-vertex/responses.ts +2 -0
  170. package/src/providers/google-vertex-chat.ts +63 -0
  171. package/src/providers/google-vertex-interactions.ts +104 -0
  172. package/src/providers/google-vertex-messages.ts +99 -0
  173. package/src/providers/google-vertex-mistral.ts +79 -0
  174. package/src/providers/google-vertex-responses.ts +64 -0
  175. package/src/providers/google-vertex-shared.ts +176 -0
  176. package/src/providers/google-vertex.ts +228 -0
  177. package/src/providers/google.ts +121 -0
  178. package/src/providers/groq.ts +98 -0
  179. package/src/providers/index.ts +45 -0
  180. package/src/providers/meta/chat.ts +2 -0
  181. package/src/providers/meta/images.ts +2 -0
  182. package/src/providers/meta/messages.ts +2 -0
  183. package/src/providers/meta/responses.ts +2 -0
  184. package/src/providers/meta.ts +161 -0
  185. package/src/providers/minimax/chat.ts +8 -0
  186. package/src/providers/minimax/images.ts +4 -0
  187. package/src/providers/minimax/messages.ts +1 -0
  188. package/src/providers/minimax/responses.ts +8 -0
  189. package/src/providers/minimax/videos.ts +4 -0
  190. package/src/providers/minimax.ts +162 -0
  191. package/src/providers/mistral.ts +40 -0
  192. package/src/providers/moonshot/chat.ts +1 -0
  193. package/src/providers/moonshot/messages.ts +8 -0
  194. package/src/providers/moonshot/responses.ts +8 -0
  195. package/src/providers/moonshot.ts +134 -0
  196. package/src/providers/open-responses-options.ts +4 -0
  197. package/src/providers/openai/chat.ts +2 -0
  198. package/src/providers/openai/embeddings.ts +2 -0
  199. package/src/providers/openai/images.ts +2 -0
  200. package/src/providers/openai/responses.ts +2 -0
  201. package/src/providers/openai-compatible/decisions.ts +2 -0
  202. package/src/providers/openai-compatible/embeddings.ts +2 -0
  203. package/src/providers/openai-compatible/images.ts +2 -0
  204. package/src/providers/openai-compatible/responses.ts +1 -0
  205. package/src/providers/openai-compatible-responses.ts +52 -0
  206. package/src/providers/openai-compatible.ts +108 -0
  207. package/src/providers/openai-options.ts +66 -0
  208. package/src/providers/openai.ts +207 -0
  209. package/src/providers/opencode/decisions.ts +2 -0
  210. package/src/providers/opencode.ts +45 -0
  211. package/src/providers/openrouter/decisions.ts +2 -0
  212. package/src/providers/openrouter/embeddings.ts +2 -0
  213. package/src/providers/openrouter/images.ts +2 -0
  214. package/src/providers/openrouter/responses.ts +3 -0
  215. package/src/providers/openrouter/videos.ts +2 -0
  216. package/src/providers/openrouter.ts +347 -0
  217. package/src/providers/settings.ts +54 -0
  218. package/src/providers/togetherai.ts +53 -0
  219. package/src/providers/typesafe-ai/decisions.ts +2 -0
  220. package/src/providers/typesafe-ai.ts +45 -0
  221. package/src/providers/venice/responses.ts +4 -0
  222. package/src/providers/venice.ts +93 -0
  223. package/src/providers/vercel-ai-gateway/chat.ts +2 -0
  224. package/src/providers/vercel-ai-gateway/decisions.ts +2 -0
  225. package/src/providers/vercel-ai-gateway/embeddings.ts +2 -0
  226. package/src/providers/vercel-ai-gateway/images.ts +2 -0
  227. package/src/providers/vercel-ai-gateway/messages.ts +2 -0
  228. package/src/providers/vercel-ai-gateway/responses.ts +2 -0
  229. package/src/providers/vercel-ai-gateway.ts +300 -0
  230. package/src/providers/volcengine/videos.ts +2 -0
  231. package/src/providers/volcengine.ts +39 -0
  232. package/src/providers/xai/images.ts +2 -0
  233. package/src/providers/xai/videos.ts +2 -0
  234. package/src/providers/xai.ts +125 -0
  235. package/src/providers/zai/chat.ts +1 -0
  236. package/src/providers/zai/images.ts +2 -0
  237. package/src/providers/zai-coding-plan/chat.ts +1 -0
  238. package/src/providers/zai-coding-plan/messages.ts +8 -0
  239. package/src/providers/zai-coding-plan/responses.ts +8 -0
  240. package/src/providers/zai-coding-plan.ts +86 -0
  241. package/src/providers/zai.ts +73 -0
  242. package/src/providers.ts +1 -0
  243. package/src/public.ts +204 -0
  244. package/src/route/auth-options.ts +62 -0
  245. package/src/route/auth.ts +164 -0
  246. package/src/route/client.ts +700 -0
  247. package/src/route/decision.ts +150 -0
  248. package/src/route/embedding.ts +175 -0
  249. package/src/route/endpoint.ts +63 -0
  250. package/src/route/executor-service.ts +191 -0
  251. package/src/route/executor.ts +361 -0
  252. package/src/route/framing.ts +112 -0
  253. package/src/route/index.ts +47 -0
  254. package/src/route/media-protocol.ts +321 -0
  255. package/src/route/media.ts +507 -0
  256. package/src/route/protocol.ts +97 -0
  257. package/src/route/transport/http.ts +103 -0
  258. package/src/route/transport/index.ts +59 -0
  259. package/src/route/transport/websocket-channel.ts +51 -0
  260. package/src/route/transport/websocket.ts +443 -0
  261. package/src/route.ts +1 -0
  262. package/src/schema/errors.ts +246 -0
  263. package/src/schema/events.ts +744 -0
  264. package/src/schema/ids.ts +24 -0
  265. package/src/schema/index.ts +5 -0
  266. package/src/schema/messages.ts +529 -0
  267. package/src/schema/options.ts +445 -0
  268. package/src/speech-client.ts +25 -0
  269. package/src/speech.ts +211 -0
  270. package/src/testing.ts +218 -0
  271. package/src/tool-history.ts +91 -0
  272. package/src/tool-runtime.ts +107 -0
  273. package/src/tool-updates.ts +139 -0
  274. package/src/tool.ts +281 -0
  275. package/src/transcription-client.ts +19 -0
  276. package/src/transcription.ts +234 -0
  277. package/src/utils/bytes.ts +9 -0
  278. package/src/utils/json.ts +5 -0
  279. package/src/utils/media-type.ts +93 -0
  280. package/src/utils/provider-codes.ts +43 -0
  281. package/src/utils/record.ts +3 -0
  282. package/src/utils/sanitize.ts +33 -0
  283. package/src/video-client.ts +66 -0
  284. package/src/video.ts +181 -0
  285. package/test/adapter.test.ts +180 -0
  286. package/test/auth-options.types.ts +283 -0
  287. package/test/auth.test.ts +112 -0
  288. package/test/cache-policy.test.ts +578 -0
  289. package/test/compaction-http.test.ts +96 -0
  290. package/test/compaction.test.ts +107 -0
  291. package/test/compile.test.ts +600 -0
  292. package/test/continuation-scenarios.ts +115 -0
  293. package/test/decision.test.ts +983 -0
  294. package/test/decision.types.ts +117 -0
  295. package/test/effort-updates.test.ts +574 -0
  296. package/test/embedding.test.ts +455 -0
  297. package/test/endpoint.test.ts +58 -0
  298. package/test/error-partial.test.ts +140 -0
  299. package/test/executor.test.ts +1095 -0
  300. package/test/exports.test.ts +222 -0
  301. package/test/extraction.test.ts +227 -0
  302. package/test/fixtures/audio/dialog.mp3 +0 -0
  303. package/test/fixtures/audio/hello.mp3 +0 -0
  304. package/test/fixtures/images/edit-source.jpg +0 -0
  305. package/test/fixtures/media/restroom.png +0 -0
  306. package/test/fixtures/recordings/alibaba-chat/qwen-3-7-plus-streams-thinking-disabled.json +35 -0
  307. package/test/fixtures/recordings/alibaba-chat/qwen-3-7-plus-streams-thinking-enabled.json +35 -0
  308. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-flash-reads-image-bytes.json +34 -0
  309. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-obeys-named-tool-choice.json +35 -0
  310. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-replays-reasoning-through-a-tool-loop-and-follow-up.json +73 -0
  311. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-returns-a-json-object.json +34 -0
  312. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-default-effort.json +36 -0
  313. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-high-effort.json +36 -0
  314. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-low-effort.json +36 -0
  315. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-max-effort.json +36 -0
  316. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-medium-effort.json +36 -0
  317. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-minimal-effort.json +36 -0
  318. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-none-effort.json +36 -0
  319. package/test/fixtures/recordings/alibaba-chat/qwen-3-8-max-streams-xhigh-effort.json +36 -0
  320. package/test/fixtures/recordings/alibaba-images/edits-an-image.json +33 -0
  321. package/test/fixtures/recordings/alibaba-images/generates-qwen-image-images.json +33 -0
  322. package/test/fixtures/recordings/alibaba-images/generates-wan-images.json +33 -0
  323. package/test/fixtures/recordings/alibaba-messages/qwen-3-7-plus-streams-thinking-disabled.json +35 -0
  324. package/test/fixtures/recordings/alibaba-messages/qwen-3-7-plus-streams-thinking-enabled.json +35 -0
  325. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-flash-reads-image-bytes.json +34 -0
  326. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-follows-a-json-schema.json +34 -0
  327. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-obeys-named-tool-choice.json +35 -0
  328. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-replays-reasoning-through-a-tool-loop-and-follow-up.json +73 -0
  329. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-default-effort.json +36 -0
  330. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-high-effort.json +36 -0
  331. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-low-effort.json +36 -0
  332. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-max-effort.json +36 -0
  333. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-medium-effort.json +36 -0
  334. package/test/fixtures/recordings/alibaba-messages/qwen-3-8-max-streams-xhigh-effort.json +36 -0
  335. package/test/fixtures/recordings/alibaba-responses/qwen-3-7-plus-streams-thinking-disabled.json +35 -0
  336. package/test/fixtures/recordings/alibaba-responses/qwen-3-7-plus-streams-thinking-enabled.json +35 -0
  337. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-flash-reads-image-bytes.json +34 -0
  338. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-continues-a-stored-response.json +53 -0
  339. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-obeys-named-tool-choice.json +35 -0
  340. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-replays-reasoning-through-a-tool-loop-and-follow-up.json +73 -0
  341. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-default-effort.json +36 -0
  342. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-high-effort.json +36 -0
  343. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-low-effort.json +36 -0
  344. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-max-effort.json +36 -0
  345. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-medium-effort.json +36 -0
  346. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-minimal-effort.json +36 -0
  347. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-none-effort.json +36 -0
  348. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-streams-xhigh-effort.json +36 -0
  349. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-uses-hosted-code-interpreter.json +35 -0
  350. package/test/fixtures/recordings/alibaba-responses/qwen-3-8-max-uses-hosted-web-search-and-extraction.json +36 -0
  351. package/test/fixtures/recordings/anthropic-compatible-messages/minimax-m3-anthropic-compatible-text.json +40 -0
  352. package/test/fixtures/recordings/anthropic-compatible-messages/minimax-m3-anthropic-compatible-tool-call.json +41 -0
  353. package/test/fixtures/recordings/anthropic-compatible-messages/minimax-m3-anthropic-compatible-tool-loop.json +60 -0
  354. package/test/fixtures/recordings/anthropic-messages/anthropic-opus-4-7-image-tool-result.json +43 -0
  355. package/test/fixtures/recordings/anthropic-messages-cache/keeps-a-long-tool-turn-inside-the-cache-lookback.json +48 -0
  356. package/test/fixtures/recordings/anthropic-messages-cache/writes-then-reads-cache-control-on-identical-second-call.json +48 -0
  357. package/test/fixtures/recordings/assemblyai-transcription/uploads-submits-and-polls-a-transcript.json +98 -0
  358. package/test/fixtures/recordings/azure/chat-streams-text-from-a-foundry-models-url.json +31 -0
  359. package/test/fixtures/recordings/azure/chat-streams-text.json +28 -0
  360. package/test/fixtures/recordings/azure/messages-calls-a-tool.json +31 -0
  361. package/test/fixtures/recordings/azure/messages-streams-text.json +31 -0
  362. package/test/fixtures/recordings/azure/responses-calls-a-tool.json +31 -0
  363. package/test/fixtures/recordings/azure/responses-continues-after-a-tool-result.json +31 -0
  364. package/test/fixtures/recordings/azure/responses-streams-text.json +31 -0
  365. package/test/fixtures/recordings/baseten-decision/decides-choice-score-and-predicate-questions.json +33 -0
  366. package/test/fixtures/recordings/bedrock-converse/continues-after-parallel-tool-results.json +36 -0
  367. package/test/fixtures/recordings/bedrock-converse/drives-a-tool-loop.json +55 -0
  368. package/test/fixtures/recordings/bedrock-converse/streams-a-tool-call.json +29 -0
  369. package/test/fixtures/recordings/bedrock-converse/streams-text.json +29 -0
  370. package/test/fixtures/recordings/bedrock-converse-cache/writes-then-reads-cachepoint-on-identical-second-call.json +48 -0
  371. package/test/fixtures/recordings/bedrock-converse-options/constrains-claude-output-to-a-json-schema.json +33 -0
  372. package/test/fixtures/recordings/bedrock-converse-options/sends-claude-effort-with-adaptive-thinking-service-tier-and-request-metadata.json +34 -0
  373. package/test/fixtures/recordings/bedrock-converse-options/sends-gpt-oss-reasoning-effort-with-the-priority-tier.json +34 -0
  374. package/test/fixtures/recordings/bedrock-converse-options/sends-nova-2-reasoning-effort.json +34 -0
  375. package/test/fixtures/recordings/bedrock-converse-thinking-binding/accepts-the-default-binding-with-no-thinking-configured.json +34 -0
  376. package/test/fixtures/recordings/bedrock-converse-thinking-binding/keeps-a-session-working-after-the-system-prompt-changes.json +71 -0
  377. package/test/fixtures/recordings/bedrock-mantle/streams-text.json +33 -0
  378. package/test/fixtures/recordings/bedrock-mantle-messages/applies-mid-conversation-effort-updates-and-thinking-block-binding-on-opus-5-5.json +57 -0
  379. package/test/fixtures/recordings/bedrock-mantle-messages/lowers-system-updates-to-wrapped-user-text-on-haiku-4-5-with-budget-thinking.json +37 -0
  380. package/test/fixtures/recordings/bedrock-mantle-messages/replays-signed-thinking-through-a-tool-loop-and-native-system-update.json +59 -0
  381. package/test/fixtures/recordings/bedrock-mantle-messages/strips-unsupported-mid-conversation-effort-updates-on-opus-5-0.json +37 -0
  382. package/test/fixtures/recordings/cartesia-speech/generates-speech.json +34 -0
  383. package/test/fixtures/recordings/cartesia-speech/streams-speech-with-timestamps.json +33 -0
  384. package/test/fixtures/recordings/cerebras-chat/cerebras-gpt-oss-120b-text.json +32 -0
  385. package/test/fixtures/recordings/cerebras-chat/cerebras-gpt-oss-120b-tool-call.json +32 -0
  386. package/test/fixtures/recordings/cerebras-chat/cerebras-gpt-oss-120b-tool-loop.json +50 -0
  387. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-claude-haiku-4-5-text.json +38 -0
  388. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-claude-haiku-4-5-tool-loop.json +58 -0
  389. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-openai-gpt-5-nano-text.json +37 -0
  390. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-openai-gpt-5-nano-tool-loop.json +56 -0
  391. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-workers-ai-gpt-oss-20b-tools-tool-call.json +32 -0
  392. package/test/fixtures/recordings/cloudflare-ai-gateway/cloudflare-ai-gateway-workers-ai-llama-3-1-8b-text.json +32 -0
  393. package/test/fixtures/recordings/cloudflare-ai-gateway-decision/decides-choice-score-and-predicate-questions.json +33 -0
  394. package/test/fixtures/recordings/cloudflare-workers-ai/cloudflare-workers-ai-gpt-oss-20b-tools-tool-call.json +32 -0
  395. package/test/fixtures/recordings/cloudflare-workers-ai/cloudflare-workers-ai-llama-3-1-8b-text.json +32 -0
  396. package/test/fixtures/recordings/cloudflare-workers-ai-decision/decides-choice-score-and-predicate-questions.json +33 -0
  397. package/test/fixtures/recordings/cloudflare-workers-ai-extraction/extracts-invoice-fields.json +33 -0
  398. package/test/fixtures/recordings/cloudflare-workers-ai-images/generates-a-flux-2-image-from-multipart-fields.json +32 -0
  399. package/test/fixtures/recordings/cloudflare-workers-ai-images/generates-a-raw-binary-image.json +33 -0
  400. package/test/fixtures/recordings/cohere/continues-a-native-tool-call.json +49 -0
  401. package/test/fixtures/recordings/cohere/streams-compatible-chat-reasoning.json +31 -0
  402. package/test/fixtures/recordings/cohere/streams-native-text-and-usage.json +31 -0
  403. package/test/fixtures/recordings/cohere/streams-native-thinking-with-a-budget.json +31 -0
  404. package/test/fixtures/recordings/cohere-embedding/embeds-text-through-the-compatibility-api.json +33 -0
  405. package/test/fixtures/recordings/deepgram-speech/generates-speech.json +36 -0
  406. package/test/fixtures/recordings/deepgram-speech/streams-speech.json +36 -0
  407. package/test/fixtures/recordings/deepgram-transcription/splits-utterances-at-speaker-changes.json +32 -0
  408. package/test/fixtures/recordings/deepgram-transcription/transcribes-raw-audio-with-speakers-and-word-timestamps.json +50 -0
  409. package/test/fixtures/recordings/deepinfra-chat/deepinfra-llama-3-3-70b-text.json +32 -0
  410. package/test/fixtures/recordings/deepinfra-chat/deepinfra-llama-3-3-70b-tool-call.json +32 -0
  411. package/test/fixtures/recordings/deepinfra-chat/deepinfra-llama-3-3-70b-tool-loop.json +50 -0
  412. package/test/fixtures/recordings/digitalocean-chat/gpt-nano-continues-a-tool-call-with-cache-markers.json +54 -0
  413. package/test/fixtures/recordings/digitalocean-chat/gpt-nano-reuses-a-cached-prompt.json +53 -0
  414. package/test/fixtures/recordings/digitalocean-chat/haiku-continues-a-tool-call-with-cache-markers.json +54 -0
  415. package/test/fixtures/recordings/digitalocean-chat/haiku-reuses-a-cached-prompt.json +53 -0
  416. package/test/fixtures/recordings/digitalocean-decision/decides-choice-score-and-predicate-questions.json +33 -0
  417. package/test/fixtures/recordings/digitalocean-responses/calls-a-freeform-text-tool.json +35 -0
  418. package/test/fixtures/recordings/digitalocean-responses/continues-a-tool-call.json +53 -0
  419. package/test/fixtures/recordings/digitalocean-responses/streams-text.json +35 -0
  420. package/test/fixtures/recordings/elevenlabs-speech/generates-speech.json +35 -0
  421. package/test/fixtures/recordings/elevenlabs-speech/streams-speech-with-timestamps.json +34 -0
  422. package/test/fixtures/recordings/elevenlabs-transcription/groups-diarized-words-into-speaker-turns.json +32 -0
  423. package/test/fixtures/recordings/elevenlabs-transcription/transcribes-audio-with-word-timestamps.json +50 -0
  424. package/test/fixtures/recordings/gemini/gemini-2-5-flash-image.json +32 -0
  425. package/test/fixtures/recordings/gemini-cache/reports-cachedcontenttokencount-on-identical-second-call.json +46 -0
  426. package/test/fixtures/recordings/google-decision/decides-choice-score-and-predicate-questions.json +33 -0
  427. package/test/fixtures/recordings/google-embedding/embeds-an-image-and-text-into-one-vector-each.json +32 -0
  428. package/test/fixtures/recordings/google-embedding/embeds-text-through-batchembedcontents.json +32 -0
  429. package/test/fixtures/recordings/google-embedding/maps-inputtype-to-a-task-type-for-gemini-embedding-001.json +50 -0
  430. package/test/fixtures/recordings/google-images/edits-an-image.json +28 -0
  431. package/test/fixtures/recordings/google-images/generates-an-image.json +28 -0
  432. package/test/fixtures/recordings/google-interactions/continues-tool-results-with-previous-interaction-id.json +66 -0
  433. package/test/fixtures/recordings/google-interactions/replays-native-tool-results-and-signatures-statelessly.json +50 -0
  434. package/test/fixtures/recordings/google-interactions/streams-reasoning-and-retains-thought-signatures.json +32 -0
  435. package/test/fixtures/recordings/google-interactions/streams-text-and-reports-usage.json +32 -0
  436. package/test/fixtures/recordings/google-interactions-video/generates-a-video.json +96 -0
  437. package/test/fixtures/recordings/google-speech/generates-speech.json +32 -0
  438. package/test/fixtures/recordings/google-speech/streams-speech.json +32 -0
  439. package/test/fixtures/recordings/google-transcription/streams-speaker-turns.json +32 -0
  440. package/test/fixtures/recordings/google-transcription/transcribes-with-speakers-and-word-timestamps.json +32 -0
  441. package/test/fixtures/recordings/google-vertex/calls-a-tool.json +32 -0
  442. package/test/fixtures/recordings/google-vertex/continues-after-a-tool-result.json +32 -0
  443. package/test/fixtures/recordings/google-vertex/streams-text.json +32 -0
  444. package/test/fixtures/recordings/google-vertex-embedding/embeds-gemini-embedding-001-one-text-per-predict-request.json +50 -0
  445. package/test/fixtures/recordings/google-vertex-embedding/embeds-text-through-predict.json +32 -0
  446. package/test/fixtures/recordings/groq-chat/continues-qwen-parallel-tool-calls.json +47 -0
  447. package/test/fixtures/recordings/groq-chat/replays-gpt-oss-reasoning-through-a-tool-loop.json +47 -0
  448. package/test/fixtures/recordings/groq-chat/streams-qwen-parsed-reasoning.json +29 -0
  449. package/test/fixtures/recordings/groq-chat/streams-text-with-usage.json +29 -0
  450. package/test/fixtures/recordings/meta-chat/continues-a-generated-tool-call.json +56 -0
  451. package/test/fixtures/recordings/meta-chat/streams-text-with-default-reasoning.json +37 -0
  452. package/test/fixtures/recordings/meta-chat/streams-text-with-high-reasoning.json +29 -0
  453. package/test/fixtures/recordings/meta-chat/streams-text-with-low-reasoning.json +29 -0
  454. package/test/fixtures/recordings/meta-chat/streams-text-with-max-reasoning.json +29 -0
  455. package/test/fixtures/recordings/meta-chat/streams-text-with-medium-reasoning.json +37 -0
  456. package/test/fixtures/recordings/meta-chat/streams-text-with-minimal-reasoning.json +37 -0
  457. package/test/fixtures/recordings/meta-chat/streams-text-with-xhigh-reasoning.json +29 -0
  458. package/test/fixtures/recordings/meta-images/edits-image-bytes-and-returns-png.json +29 -0
  459. package/test/fixtures/recordings/meta-images/generates-default-webp-bytes.json +29 -0
  460. package/test/fixtures/recordings/meta-images/replays-a-signed-image-handle-for-a-responses-edit.json +55 -0
  461. package/test/fixtures/recordings/meta-messages/replays-encrypted-thinking-through-a-tool-loop.json +54 -0
  462. package/test/fixtures/recordings/meta-messages/streams-text-with-adaptive-thinking.json +36 -0
  463. package/test/fixtures/recordings/meta-messages/streams-text-with-enabled-thinking.json +36 -0
  464. package/test/fixtures/recordings/meta-responses/replays-encrypted-reasoning-through-a-tool-loop.json +56 -0
  465. package/test/fixtures/recordings/meta-responses/streams-text-with-default-reasoning.json +37 -0
  466. package/test/fixtures/recordings/meta-responses/streams-text-with-high-reasoning.json +37 -0
  467. package/test/fixtures/recordings/meta-responses/streams-text-with-low-reasoning.json +37 -0
  468. package/test/fixtures/recordings/meta-responses/streams-text-with-max-reasoning.json +37 -0
  469. package/test/fixtures/recordings/meta-responses/streams-text-with-medium-reasoning.json +37 -0
  470. package/test/fixtures/recordings/meta-responses/streams-text-with-minimal-reasoning.json +37 -0
  471. package/test/fixtures/recordings/meta-responses/streams-text-with-xhigh-reasoning.json +37 -0
  472. package/test/fixtures/recordings/meta-search/searches-and-replays-grounded-messages.json +56 -0
  473. package/test/fixtures/recordings/meta-search/searches-and-replays-grounded-responses.json +56 -0
  474. package/test/fixtures/recordings/minimax-chat/m3-continues-a-tool-loop-with-default-thinking.json +56 -0
  475. package/test/fixtures/recordings/minimax-chat/m3-streams-text-with-thinking-disabled.json +36 -0
  476. package/test/fixtures/recordings/minimax-images/generates-an-image.json +32 -0
  477. package/test/fixtures/recordings/minimax-images/generates-from-a-subject-reference.json +32 -0
  478. package/test/fixtures/recordings/minimax-messages/m2-7-streams-default-thinking.json +36 -0
  479. package/test/fixtures/recordings/minimax-messages/m3-continues-a-tool-loop-with-adaptive-thinking.json +56 -0
  480. package/test/fixtures/recordings/minimax-messages/m3-generates-a-named-tool-call-with-default-thinking-off.json +36 -0
  481. package/test/fixtures/recordings/minimax-messages/m3-streams-adaptive-thinking.json +36 -0
  482. package/test/fixtures/recordings/minimax-messages/m3-streams-text-with-thinking-disabled.json +36 -0
  483. package/test/fixtures/recordings/minimax-responses/m3-continues-a-tool-loop-with-effort-minimal.json +56 -0
  484. package/test/fixtures/recordings/minimax-responses/m3-streams-text-with-effort-none.json +36 -0
  485. package/test/fixtures/recordings/minimax-video/generates-a-hailuo-video-from-a-first-frame.json +176 -0
  486. package/test/fixtures/recordings/minimax-video/generates-an-h3-video.json +96 -0
  487. package/test/fixtures/recordings/mistral-chat/drives-a-tool-loop.json +54 -0
  488. package/test/fixtures/recordings/mistral-chat/replays-native-reasoning.json +47 -0
  489. package/test/fixtures/recordings/mistral-chat/streams-text-with-usage.json +29 -0
  490. package/test/fixtures/recordings/mistral-chat-glm/streams-an-indexed-tool-call.json +36 -0
  491. package/test/fixtures/recordings/moonshot-chat/k3-reads-image-bytes.json +29 -0
  492. package/test/fixtures/recordings/moonshot-chat/k3-respects-tool-choice-none.json +29 -0
  493. package/test/fixtures/recordings/moonshot-chat/k3-respects-tool-choice-required.json +29 -0
  494. package/test/fixtures/recordings/moonshot-chat/k3-returns-native-structured-output.json +29 -0
  495. package/test/fixtures/recordings/moonshot-chat/k3-streams-text-with-default-effort.json +29 -0
  496. package/test/fixtures/recordings/moonshot-chat/k3-streams-text-with-high-effort.json +29 -0
  497. package/test/fixtures/recordings/moonshot-chat/k3-streams-text-with-low-effort.json +29 -0
  498. package/test/fixtures/recordings/moonshot-chat/k3-streams-text-with-max-effort.json +29 -0
  499. package/test/fixtures/recordings/moonshot-chat/kimi-k2-6-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  500. package/test/fixtures/recordings/moonshot-chat/kimi-k2-6-streams-text-with-default-thinking.json +29 -0
  501. package/test/fixtures/recordings/moonshot-chat/kimi-k2-6-streams-text-with-disabled-thinking.json +29 -0
  502. package/test/fixtures/recordings/moonshot-chat/kimi-k2-6-streams-text-with-enabled-thinking.json +29 -0
  503. package/test/fixtures/recordings/moonshot-chat/kimi-k2-7-code-highspeed-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  504. package/test/fixtures/recordings/moonshot-chat/kimi-k2-7-code-highspeed-streams-text-with-default-thinking.json +29 -0
  505. package/test/fixtures/recordings/moonshot-chat/kimi-k2-7-code-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  506. package/test/fixtures/recordings/moonshot-chat/kimi-k2-7-code-streams-text-with-default-thinking.json +29 -0
  507. package/test/fixtures/recordings/moonshot-chat/kimi-k3-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  508. package/test/fixtures/recordings/moonshot-messages/k3-reads-image-bytes.json +36 -0
  509. package/test/fixtures/recordings/moonshot-messages/k3-respects-tool-choice-none.json +36 -0
  510. package/test/fixtures/recordings/moonshot-messages/k3-respects-tool-choice-required.json +36 -0
  511. package/test/fixtures/recordings/moonshot-messages/k3-returns-native-structured-output.json +35 -0
  512. package/test/fixtures/recordings/moonshot-messages/k3-streams-text-with-default-effort.json +36 -0
  513. package/test/fixtures/recordings/moonshot-messages/k3-streams-text-with-high-effort.json +36 -0
  514. package/test/fixtures/recordings/moonshot-messages/k3-streams-text-with-low-effort.json +36 -0
  515. package/test/fixtures/recordings/moonshot-messages/k3-streams-text-with-max-effort.json +36 -0
  516. package/test/fixtures/recordings/moonshot-messages/kimi-k3-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  517. package/test/fixtures/recordings/moonshot-responses/k3-reads-image-bytes.json +36 -0
  518. package/test/fixtures/recordings/moonshot-responses/k3-rejects-unsupported-tool-choice-none.json +36 -0
  519. package/test/fixtures/recordings/moonshot-responses/k3-rejects-unsupported-tool-choice-required.json +36 -0
  520. package/test/fixtures/recordings/moonshot-responses/k3-returns-native-structured-output.json +35 -0
  521. package/test/fixtures/recordings/moonshot-responses/k3-streams-text-with-default-effort.json +36 -0
  522. package/test/fixtures/recordings/moonshot-responses/k3-streams-text-with-high-effort.json +36 -0
  523. package/test/fixtures/recordings/moonshot-responses/k3-streams-text-with-low-effort.json +36 -0
  524. package/test/fixtures/recordings/moonshot-responses/k3-streams-text-with-max-effort.json +36 -0
  525. package/test/fixtures/recordings/moonshot-responses/kimi-k3-preserves-reasoning-through-a-tool-loop-and-follow-up.json +74 -0
  526. package/test/fixtures/recordings/openai-compatible-chat/gemini-parallel-tool-signatures.json +54 -0
  527. package/test/fixtures/recordings/openai-compatible-chat/togetherai-streams-text.json +28 -0
  528. package/test/fixtures/recordings/openai-compatible-chat/togetherai-streams-tool-call.json +28 -0
  529. package/test/fixtures/recordings/openai-decision/decides-choice-score-and-predicate-questions-about-json-state.json +33 -0
  530. package/test/fixtures/recordings/openai-embedding/embeds-text-with-requested-dimensions.json +33 -0
  531. package/test/fixtures/recordings/openai-images/edits-an-image.json +28 -0
  532. package/test/fixtures/recordings/openai-images/generates-an-image.json +28 -0
  533. package/test/fixtures/recordings/openai-images/streams-a-partial-image-before-the-final-image.json +32 -0
  534. package/test/fixtures/recordings/openai-responses/openai-responses-gpt-5-5-image-tool-result.json +42 -0
  535. package/test/fixtures/recordings/openai-responses/openai-responses-gpt-5-5-reasoning-continuation.json +58 -0
  536. package/test/fixtures/recordings/openai-responses/openai-responses-gpt-5-5-reasoning.json +38 -0
  537. package/test/fixtures/recordings/openai-responses/openai-responses-gpt-5-5-tool-loop.json +57 -0
  538. package/test/fixtures/recordings/openai-responses-cache/caches-the-system-prompt-on-gpt-6-2-sol.json +51 -0
  539. package/test/fixtures/recordings/openai-responses-cache/reports-cached-tokens-on-identical-second-call.json +51 -0
  540. package/test/fixtures/recordings/openai-responses-images/generates-and-edits-an-image-with-the-hosted-tool.json +50 -0
  541. package/test/fixtures/recordings/openai-responses-websocket/continues-a-tool-call-over-one-socket.json +588 -0
  542. package/test/fixtures/recordings/openai-responses-websocket/reconstructs-full-context-after-reconnect.json +167 -0
  543. package/test/fixtures/recordings/openai-responses-websocket/recovers-from-explicit-continuation-rejection.json +167 -0
  544. package/test/fixtures/recordings/openai-speech/generates-speech.json +33 -0
  545. package/test/fixtures/recordings/openai-speech/streams-speech.json +32 -0
  546. package/test/fixtures/recordings/openai-transcription/diarizes-speakers-into-segments.json +32 -0
  547. package/test/fixtures/recordings/openai-transcription/returns-whisper-word-timestamps.json +32 -0
  548. package/test/fixtures/recordings/openai-transcription/streams-text-deltas.json +32 -0
  549. package/test/fixtures/recordings/openai-transcription/transcribes-with-a-language-hint.json +32 -0
  550. package/test/fixtures/recordings/opencode-decision/decides-choice-score-and-predicate-questions.json +33 -0
  551. package/test/fixtures/recordings/openrouter-decision/decides-choice-score-and-predicate-questions.json +33 -0
  552. package/test/fixtures/recordings/openrouter-images/edits-an-image-through-input-references.json +32 -0
  553. package/test/fixtures/recordings/openrouter-images/renders-flux-3-from-an-aspect-ratio-and-tier.json +32 -0
  554. package/test/fixtures/recordings/openrouter-images/renders-gemini-at-the-requested-2k-tier.json +32 -0
  555. package/test/fixtures/recordings/openrouter-reasoning-tool-loop.json +55 -0
  556. package/test/fixtures/recordings/openrouter-reasoning.json +29 -0
  557. package/test/fixtures/recordings/openrouter-responses/calls-a-freeform-text-tool.json +35 -0
  558. package/test/fixtures/recordings/openrouter-responses/continues-a-tool-call.json +53 -0
  559. package/test/fixtures/recordings/openrouter-responses/streams-text.json +35 -0
  560. package/test/fixtures/recordings/openrouter-video/generates-a-video.json +113 -0
  561. package/test/fixtures/recordings/pdf/anthropic-tool-result.json +28 -0
  562. package/test/fixtures/recordings/pdf/anthropic-user-input.json +28 -0
  563. package/test/fixtures/recordings/pdf/bedrock-tool-result.json +29 -0
  564. package/test/fixtures/recordings/pdf/bedrock-user-input.json +29 -0
  565. package/test/fixtures/recordings/pdf/gemini-tool-result.json +53 -0
  566. package/test/fixtures/recordings/pdf/gemini-user-input.json +28 -0
  567. package/test/fixtures/recordings/pdf/openai-tool-result.json +35 -0
  568. package/test/fixtures/recordings/pdf/openai-user-input.json +34 -0
  569. package/test/fixtures/recordings/pdf/xai-tool-result.json +35 -0
  570. package/test/fixtures/recordings/pdf/xai-user-input.json +34 -0
  571. package/test/fixtures/recordings/typesafe-decision/decides-choice-score-and-predicate-questions.json +33 -0
  572. package/test/fixtures/recordings/venice-chat/claude-opus-4-8-preserves-reasoning-through-a-tool-loop-and-follow-up.json +75 -0
  573. package/test/fixtures/recordings/venice-chat/deepseek-v4-flash-preserves-reasoning-through-a-tool-loop-and-follow-up.json +75 -0
  574. package/test/fixtures/recordings/venice-chat/gemini-3-1-pro-preview-preserves-reasoning-through-a-tool-loop-and-follow-up.json +75 -0
  575. package/test/fixtures/recordings/venice-chat/gemini-preserves-per-call-signatures-through-parallel-tools.json +71 -0
  576. package/test/fixtures/recordings/venice-chat/openai-gpt-54-mini-preserves-reasoning-through-a-tool-loop-and-follow-up.json +75 -0
  577. package/test/fixtures/recordings/venice-chat/qwen-disables-reasoning.json +35 -0
  578. package/test/fixtures/recordings/venice-chat/surfaces-venice-model-errors.json +33 -0
  579. package/test/fixtures/recordings/venice-responses/calls-a-freeform-text-tool.json +35 -0
  580. package/test/fixtures/recordings/venice-responses/continues-a-tool-call.json +53 -0
  581. package/test/fixtures/recordings/venice-responses/streams-text.json +35 -0
  582. package/test/fixtures/recordings/vercel-ai-gateway-images/generates-an-image.json +32 -0
  583. package/test/fixtures/recordings/vercel-ai-gateway-images/sizes-grok-through-xai-provider-options.json +32 -0
  584. package/test/fixtures/recordings/vercel-ai-gateway-reasoning-tool-loop.json +55 -0
  585. package/test/fixtures/recordings/vercel-ai-gateway-reasoning.json +29 -0
  586. package/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json +49 -0
  587. package/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json +49 -0
  588. package/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json +49 -0
  589. package/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json +49 -0
  590. package/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json +49 -0
  591. package/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json +49 -0
  592. package/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json +49 -0
  593. package/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json +49 -0
  594. package/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json +31 -0
  595. package/test/fixtures/recordings/xai-images/edits-an-image.json +28 -0
  596. package/test/fixtures/recordings/xai-images/generates-an-image.json +28 -0
  597. package/test/fixtures/recordings/xai-video/generates-a-video.json +129 -0
  598. package/test/fixtures/recordings/zai-chat/glm-4-5-calls-a-tool-without-streaming-arguments.json +28 -0
  599. package/test/fixtures/recordings/zai-chat/glm-4-7-streams-thinking-disabled.json +28 -0
  600. package/test/fixtures/recordings/zai-chat/glm-4-7-streams-thinking-enabled.json +28 -0
  601. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-high-effort.json +28 -0
  602. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-low-effort.json +28 -0
  603. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-max-effort.json +28 -0
  604. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-medium-effort.json +28 -0
  605. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-minimal-effort.json +28 -0
  606. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-none-effort.json +28 -0
  607. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-thinking-disabled.json +28 -0
  608. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-thinking-enabled.json +28 -0
  609. package/test/fixtures/recordings/zai-chat/glm-5-2-streams-xhigh-effort.json +28 -0
  610. package/test/fixtures/recordings/zai-chat/glm-5-3-flash-reads-image-bytes.json +28 -0
  611. package/test/fixtures/recordings/zai-chat/glm-5-3-preserves-reasoning-through-a-tool-loop-and-follow-up.json +64 -0
  612. package/test/fixtures/recordings/zai-chat/glm-5-3-rejects-disabled-thinking.json +27 -0
  613. package/test/fixtures/recordings/zai-chat/glm-5-3-returns-a-json-object.json +28 -0
  614. package/test/fixtures/recordings/zai-chat/glm-5-3-streams-default-effort.json +28 -0
  615. package/test/fixtures/recordings/zai-chat/glm-5-3-streams-high-effort.json +28 -0
  616. package/test/fixtures/recordings/zai-chat/glm-5-3-streams-low-effort.json +28 -0
  617. package/test/fixtures/recordings/zai-chat/glm-5-3-streams-max-effort.json +28 -0
  618. package/test/fixtures/recordings/zai-images/generates-an-image.json +28 -0
  619. package/test/generate-object.test.ts +281 -0
  620. package/test/generation.test.ts +191 -0
  621. package/test/google-interactions-video.test.ts +351 -0
  622. package/test/http-hooks.test.ts +137 -0
  623. package/test/http-timeout.test.ts +287 -0
  624. package/test/image-job.test.ts +199 -0
  625. package/test/image-sizing.test.ts +47 -0
  626. package/test/image.test.ts +1114 -0
  627. package/test/image.types.ts +203 -0
  628. package/test/keyless-auth.test.ts +85 -0
  629. package/test/lib/effect.ts +50 -0
  630. package/test/lib/env.ts +30 -0
  631. package/test/lib/http.ts +141 -0
  632. package/test/lib/image.ts +29 -0
  633. package/test/lib/openai-chunks.ts +27 -0
  634. package/test/lib/sse.ts +20 -0
  635. package/test/lib/tool-runtime.ts +152 -0
  636. package/test/llm-option-types.types.ts +153 -0
  637. package/test/llm.test.ts +286 -0
  638. package/test/loop-steps.test.ts +77 -0
  639. package/test/loop-tools.types.ts +79 -0
  640. package/test/loop.test.ts +425 -0
  641. package/test/media-input.test.ts +98 -0
  642. package/test/media-usage.test.ts +13 -0
  643. package/test/media.test.ts +340 -0
  644. package/test/minimax-video.test.ts +553 -0
  645. package/test/openai-freeform.test.ts +252 -0
  646. package/test/openrouter-video.test.ts +294 -0
  647. package/test/partial-json.test.ts +58 -0
  648. package/test/promise-parity.types.ts +83 -0
  649. package/test/promise.test.ts +632 -0
  650. package/test/provider/alibaba-capabilities.recorded.test.ts +253 -0
  651. package/test/provider/alibaba-images.recorded.test.ts +71 -0
  652. package/test/provider/alibaba-images.test.ts +199 -0
  653. package/test/provider/alibaba.recorded.test.ts +165 -0
  654. package/test/provider/alibaba.test.ts +419 -0
  655. package/test/provider/anthropic-compaction.test.ts +171 -0
  656. package/test/provider/anthropic-messages-cache.recorded.test.ts +111 -0
  657. package/test/provider/anthropic-messages.recorded.test.ts +45 -0
  658. package/test/provider/anthropic-messages.test.ts +2609 -0
  659. package/test/provider/anthropic-thinking-binding.test.ts +65 -0
  660. package/test/provider/assemblyai-transcription.recorded.test.ts +39 -0
  661. package/test/provider/azure.recorded.test.ts +139 -0
  662. package/test/provider/azure.test.ts +48 -0
  663. package/test/provider/bedrock-converse-cache.recorded.test.ts +61 -0
  664. package/test/provider/bedrock-converse-cache.test.ts +168 -0
  665. package/test/provider/bedrock-converse-options.recorded.test.ts +119 -0
  666. package/test/provider/bedrock-converse-options.test.ts +149 -0
  667. package/test/provider/bedrock-converse-thinking-binding.recorded.test.ts +103 -0
  668. package/test/provider/bedrock-converse-thinking-binding.test.ts +107 -0
  669. package/test/provider/bedrock-converse.test.ts +2548 -0
  670. package/test/provider/bedrock-mantle.test.ts +444 -0
  671. package/test/provider/bedrock-mistral-ids.test.ts +86 -0
  672. package/test/provider/cartesia-speech.recorded.test.ts +47 -0
  673. package/test/provider/checkpoint.test.ts +324 -0
  674. package/test/provider/cloudflare-workers-ai-images.recorded.test.ts +57 -0
  675. package/test/provider/cloudflare-workers-ai-images.test.ts +155 -0
  676. package/test/provider/cloudflare.test.ts +330 -0
  677. package/test/provider/cohere.recorded.test.ts +94 -0
  678. package/test/provider/cohere.test.ts +301 -0
  679. package/test/provider/compaction-websocket.test.ts +50 -0
  680. package/test/provider/compaction.recorded.test.ts +89 -0
  681. package/test/provider/compaction.test.ts +178 -0
  682. package/test/provider/conversation-lowering.test.ts +31 -0
  683. package/test/provider/decision.recorded.test.ts +211 -0
  684. package/test/provider/deepgram-speech.recorded.test.ts +41 -0
  685. package/test/provider/deepgram-transcription.recorded.test.ts +47 -0
  686. package/test/provider/digitalocean.recorded.test.ts +78 -0
  687. package/test/provider/digitalocean.test.ts +123 -0
  688. package/test/provider/elevenlabs-speech.recorded.test.ts +54 -0
  689. package/test/provider/elevenlabs-transcription.recorded.test.ts +50 -0
  690. package/test/provider/embedding.recorded.test.ts +109 -0
  691. package/test/provider/empty-tool-choice.test.ts +80 -0
  692. package/test/provider/error-retention.test.ts +158 -0
  693. package/test/provider/explicit-compaction.test.ts +503 -0
  694. package/test/provider/extraction.recorded.test.ts +46 -0
  695. package/test/provider/freeform-tools.test.ts +446 -0
  696. package/test/provider/gemini-cache.recorded.test.ts +49 -0
  697. package/test/provider/gemini-openai-chat.recorded.test.ts +69 -0
  698. package/test/provider/gemini.test.ts +2336 -0
  699. package/test/provider/golden.recorded.test.ts +287 -0
  700. package/test/provider/google-images.recorded.test.ts +53 -0
  701. package/test/provider/google-interactions-video.recorded.test.ts +48 -0
  702. package/test/provider/google-interactions.recorded.test.ts +169 -0
  703. package/test/provider/google-interactions.test.ts +593 -0
  704. package/test/provider/google-speech.recorded.test.ts +45 -0
  705. package/test/provider/google-transcription.recorded.test.ts +54 -0
  706. package/test/provider/google-vertex-interactions.test.ts +307 -0
  707. package/test/provider/google-vertex.recorded.test.ts +75 -0
  708. package/test/provider/google-vertex.test.ts +595 -0
  709. package/test/provider/groq.recorded.test.ts +187 -0
  710. package/test/provider/groq.test.ts +134 -0
  711. package/test/provider/image-detail.test.ts +58 -0
  712. package/test/provider/media-entrypoints.test.ts +618 -0
  713. package/test/provider/meta-capabilities.test.ts +216 -0
  714. package/test/provider/meta-images.recorded.test.ts +119 -0
  715. package/test/provider/meta-messages.recorded.test.ts +121 -0
  716. package/test/provider/meta-search.recorded.test.ts +97 -0
  717. package/test/provider/meta.recorded.test.ts +182 -0
  718. package/test/provider/meta.test.ts +140 -0
  719. package/test/provider/minimax-images.recorded.test.ts +52 -0
  720. package/test/provider/minimax-images.test.ts +236 -0
  721. package/test/provider/minimax-video.recorded.test.ts +83 -0
  722. package/test/provider/minimax.recorded.test.ts +257 -0
  723. package/test/provider/minimax.test.ts +110 -0
  724. package/test/provider/missing-tool-input.test.ts +73 -0
  725. package/test/provider/mistral-chat.test.ts +757 -0
  726. package/test/provider/mistral.recorded.test.ts +170 -0
  727. package/test/provider/moonshot-capabilities.recorded.test.ts +131 -0
  728. package/test/provider/moonshot.recorded.test.ts +191 -0
  729. package/test/provider/moonshot.test.ts +218 -0
  730. package/test/provider/native-providers.test.ts +299 -0
  731. package/test/provider/open-responses-errors.test.ts +141 -0
  732. package/test/provider/open-responses-finals.test.ts +209 -0
  733. package/test/provider/open-responses-lifecycle.test.ts +526 -0
  734. package/test/provider/open-responses-replay.test.ts +120 -0
  735. package/test/provider/openai-chat-reasoning.recorded.test.ts +154 -0
  736. package/test/provider/openai-chat.test.ts +2505 -0
  737. package/test/provider/openai-compatible-chat.test.ts +819 -0
  738. package/test/provider/openai-compatible-responses.test.ts +1139 -0
  739. package/test/provider/openai-images.recorded.test.ts +91 -0
  740. package/test/provider/openai-responses-cache.recorded.test.ts +68 -0
  741. package/test/provider/openai-responses-images.recorded.test.ts +66 -0
  742. package/test/provider/openai-responses-websocket.recorded.test.ts +221 -0
  743. package/test/provider/openai-responses.test.ts +5414 -0
  744. package/test/provider/openai-speech.recorded.test.ts +38 -0
  745. package/test/provider/openai-transcription.recorded.test.ts +91 -0
  746. package/test/provider/openrouter-images.recorded.test.ts +76 -0
  747. package/test/provider/openrouter-video.recorded.test.ts +53 -0
  748. package/test/provider/openrouter.test.ts +656 -0
  749. package/test/provider/pdf.recorded.test.ts +211 -0
  750. package/test/provider/queued-recording.ts +10 -0
  751. package/test/provider/responses-routes.recorded.test.ts +91 -0
  752. package/test/provider/seedance-video.recorded.test.ts +52 -0
  753. package/test/provider/speech-recording.ts +19 -0
  754. package/test/provider/transcription-recording.ts +41 -0
  755. package/test/provider/venice.recorded.test.ts +237 -0
  756. package/test/provider/venice.test.ts +373 -0
  757. package/test/provider/vercel-ai-gateway-images.recorded.test.ts +55 -0
  758. package/test/provider/vercel-ai-gateway.recorded.test.ts +125 -0
  759. package/test/provider/vercel-ai-gateway.test.ts +303 -0
  760. package/test/provider/xai-images.recorded.test.ts +54 -0
  761. package/test/provider/xai-images.test.ts +109 -0
  762. package/test/provider/xai-responses.test.ts +339 -0
  763. package/test/provider/xai-video.recorded.test.ts +54 -0
  764. package/test/provider/zai-capabilities.recorded.test.ts +156 -0
  765. package/test/provider/zai-images.recorded.test.ts +33 -0
  766. package/test/provider/zai-images.test.ts +163 -0
  767. package/test/provider/zai.recorded.test.ts +115 -0
  768. package/test/provider/zai.test.ts +374 -0
  769. package/test/provider-api-methods.types.ts +8 -0
  770. package/test/provider-error.test.ts +800 -0
  771. package/test/provider-model.types.ts +37 -0
  772. package/test/provider-options/alibaba.types.ts +46 -0
  773. package/test/provider-options/amazon-bedrock.types.ts +33 -0
  774. package/test/provider-options/anthropic-compatible.types.ts +13 -0
  775. package/test/provider-options/anthropic.types.ts +30 -0
  776. package/test/provider-options/azure.types.ts +13 -0
  777. package/test/provider-options/checkpoint.types.ts +150 -0
  778. package/test/provider-options/cloudflare.types.ts +13 -0
  779. package/test/provider-options/compaction.types.ts +146 -0
  780. package/test/provider-options/google-vertex-chat.types.ts +7 -0
  781. package/test/provider-options/google-vertex-interactions.types.ts +29 -0
  782. package/test/provider-options/google-vertex-messages.types.ts +13 -0
  783. package/test/provider-options/google-vertex-responses.types.ts +14 -0
  784. package/test/provider-options/google-vertex.types.ts +17 -0
  785. package/test/provider-options/google.types.ts +43 -0
  786. package/test/provider-options/minimax.types.ts +33 -0
  787. package/test/provider-options/mistral.types.ts +24 -0
  788. package/test/provider-options/moonshot.types.ts +45 -0
  789. package/test/provider-options/openai-compatible-responses.types.ts +17 -0
  790. package/test/provider-options/openai-compatible.types.ts +13 -0
  791. package/test/provider-options/openai.types.ts +27 -0
  792. package/test/provider-options/openrouter.types.ts +55 -0
  793. package/test/provider-options/venice.types.ts +39 -0
  794. package/test/provider-options/vercel-ai-gateway.types.ts +30 -0
  795. package/test/provider-options/xai.types.ts +14 -0
  796. package/test/provider-options/zai.types.ts +42 -0
  797. package/test/provider-package.test.ts +586 -0
  798. package/test/raw-events.test.ts +75 -0
  799. package/test/realtime.test.ts +172 -0
  800. package/test/recorded-golden.ts +104 -0
  801. package/test/recorded-runner.ts +101 -0
  802. package/test/recorded-scenarios.ts +468 -0
  803. package/test/recorded-test.ts +127 -0
  804. package/test/recorded-utils.ts +56 -0
  805. package/test/request-encoding.test.ts +57 -0
  806. package/test/request-transport.test.ts +74 -0
  807. package/test/response.test.ts +203 -0
  808. package/test/route.test.ts +225 -0
  809. package/test/sanitize.test.ts +80 -0
  810. package/test/schema.test.ts +412 -0
  811. package/test/seedance-video.test.ts +418 -0
  812. package/test/speech.test.ts +297 -0
  813. package/test/speech.types.ts +33 -0
  814. package/test/testing.test.ts +372 -0
  815. package/test/tool-history.test.ts +162 -0
  816. package/test/tool-runtime.test.ts +926 -0
  817. package/test/tool-schema-projection.test.ts +427 -0
  818. package/test/tool-stream.test.ts +252 -0
  819. package/test/tool-updates.test.ts +849 -0
  820. package/test/tool.types.ts +131 -0
  821. package/test/transcription.test.ts +618 -0
  822. package/test/transcription.types.ts +44 -0
  823. package/test/video.test.ts +447 -0
  824. package/test/video.types.ts +110 -0
  825. package/tsconfig.build.json +8 -0
  826. package/tsconfig.json +17 -0
  827. package/tsconfig.types.json +16 -0
@@ -0,0 +1,222 @@
1
+ import { describe, expect, test } from "bun:test"
2
+ import { Effect, Layer } from "effect"
3
+ import {
4
+ ai,
5
+ AIClient,
6
+ AIError,
7
+ DecisionClient,
8
+ EmbeddingClient,
9
+ Generation,
10
+ ImageClient,
11
+ VideoClient,
12
+ LanguageModel,
13
+ LLMClient,
14
+ LLMEvent,
15
+ Media,
16
+ RawEvent,
17
+ } from "@zyro-sec/ai/effect"
18
+ import { AI } from "@zyro-sec/ai"
19
+ import { Speech, SpeechClient, SpeechEvent, TranscriptionClient } from "@zyro-sec/ai/experimental"
20
+ import { Route, Protocol, RequestExecutor, WebSocketTransport } from "@zyro-sec/ai/route"
21
+ import {
22
+ Alibaba,
23
+ AssemblyAI,
24
+ Baseten,
25
+ Cartesia,
26
+ CloudflareAIGateway,
27
+ CloudflareWorkersAI,
28
+ Deepgram,
29
+ DeepSeek,
30
+ DigitalOcean,
31
+ ElevenLabs,
32
+ Fireworks,
33
+ Google,
34
+ Meta,
35
+ MiniMax,
36
+ OpenCode,
37
+ OpenAI,
38
+ OpenAICompatible,
39
+ OpenRouter,
40
+ TypeSafeAI,
41
+ VercelAIGateway,
42
+ XAI,
43
+ ZAI,
44
+ } from "@zyro-sec/ai/providers"
45
+ import {
46
+ AnthropicMessages,
47
+ OpenAIChat,
48
+ OpenAICompatibleChat,
49
+ OpenAICompatibleResponses,
50
+ OpenAIResponses,
51
+ OpenResponses,
52
+ OpenResponsesChannel,
53
+ } from "@zyro-sec/ai/protocols"
54
+ import { TestLLM } from "@zyro-sec/ai/testing"
55
+
56
+ describe("public exports", () => {
57
+ test("modality, provider, and protocol entrypoints load first in a fresh process", async () => {
58
+ const results = await Promise.all(
59
+ ["image", "video", "speech", "transcription", "providers", "protocols"].map(async (entry) => {
60
+ const child = Bun.spawn(
61
+ [process.execPath, "-e", `await import(${JSON.stringify(`${import.meta.dir}/../src/${entry}.ts`)})`],
62
+ { stderr: "pipe" },
63
+ )
64
+ return { entry, exitCode: await child.exited, stderr: await new Response(child.stderr).text() }
65
+ }),
66
+ )
67
+ expect(results.filter((result) => result.exitCode !== 0)).toEqual([])
68
+ })
69
+
70
+ test("root exposes app-facing runtime APIs", () => {
71
+ expect(ai.request).toBeFunction()
72
+ expect(LLMClient.Service).toBeFunction()
73
+ expect(LLMClient.layer).toBeDefined()
74
+ expect(AIError).toBeFunction()
75
+ expect(LanguageModel.make).toBeFunction()
76
+ expect(Media.bytes).toBeFunction()
77
+ expect(ai.image.generate).toBeFunction()
78
+ expect(ai.video.start).toBeFunction()
79
+ expect(ai.video.status).toBeFunction()
80
+ expect(ai.video.result).toBeFunction()
81
+ expect(ai.video.cancel).toBeFunction()
82
+ expect(VideoClient.layer).toBeDefined()
83
+ expect(AI.ai.video.start).toBeFunction()
84
+ expect(Speech.generate).toBeFunction()
85
+ expect(Speech.stream).toBeFunction()
86
+ expect(SpeechClient.layer).toBeDefined()
87
+ expect(SpeechEvent.is.audioDelta).toBeFunction()
88
+ expect(Generation).toBeFunction()
89
+ expect(TestLLM.testLayer).toBeFunction()
90
+ expect(TestLLM.Test.of).toBeFunction()
91
+ expect(ai.decision.generate).toBeFunction()
92
+ expect(DecisionClient.layer).toBeDefined()
93
+ expect(DecisionClient.fetchLayer).toBeDefined()
94
+ expect(ai.embedding.generate).toBeFunction()
95
+ expect(EmbeddingClient.layer).toBeDefined()
96
+ expect(AI.ai.embedding.generate).toBeFunction()
97
+ })
98
+
99
+ test("both entry points export the raw event type", () => {
100
+ const event: RawEvent = LLMEvent.raw({ data: { type: "ping" } })
101
+ const promiseEvent: AI.RawEvent = event
102
+ expect(RawEvent).toBe(AI.RawEvent)
103
+ expect(LLMEvent.is.raw(promiseEvent)).toBe(true)
104
+ })
105
+
106
+ test("AIClient.layerWith shares one executor across every client", async () => {
107
+ let built = 0
108
+ const counting = Layer.effect(
109
+ RequestExecutor.Service,
110
+ Effect.sync(() => {
111
+ built++
112
+ return RequestExecutor.Service.of({ execute: () => Effect.die("unexpected request") })
113
+ }),
114
+ )
115
+ await Effect.runPromise(
116
+ Effect.gen(function* () {
117
+ yield* LLMClient.Service
118
+ yield* ImageClient.Service
119
+ yield* VideoClient.Service
120
+ yield* SpeechClient.Service
121
+ yield* TranscriptionClient.Service
122
+ yield* DecisionClient.Service
123
+ yield* EmbeddingClient.Service
124
+ yield* RequestExecutor.Service
125
+ }).pipe(Effect.provide(AIClient.layerWith(counting))),
126
+ )
127
+ expect(built).toBe(1)
128
+ })
129
+
130
+ test("route barrel exposes route-authoring APIs", () => {
131
+ expect(Route.make).toBeFunction()
132
+ expect(Protocol.make).toBeFunction()
133
+ expect(WebSocketTransport.makeDirect).toBeFunction()
134
+ })
135
+
136
+ test("provider barrels expose user-facing facades", async () => {
137
+ const { OpenAICompatibleResponses } = await import("@zyro-sec/ai/providers")
138
+
139
+ expect(OpenAI.model).toBeFunction()
140
+ expect(OpenAI.embedding).toBeFunction()
141
+ expect(OpenAI.provider.responses).toBe(OpenAI.responses)
142
+ expect(OpenAI.configure({ apiKey: "fixture" }).responses).toBeFunction()
143
+ for (const provider of [Baseten, DeepSeek, Fireworks]) {
144
+ expect(provider.configure).toBeFunction()
145
+ expect(provider.model).toBeFunction()
146
+ }
147
+ for (const name of ["baseten", "cerebras", "deepinfra", "deepseek", "fireworks", "groq", "togetherai"]) {
148
+ expect(OpenAICompatible).not.toHaveProperty(name)
149
+ }
150
+ expect(
151
+ OpenAICompatibleResponses.configure({ baseURL: "https://responses.test/v1" }).model("fixture").route.id,
152
+ ).toBe("openai-compatible-responses")
153
+ expect(CloudflareAIGateway.configure).toBeFunction()
154
+ expect(CloudflareAIGateway.configure({ accountId: "fixture", gatewayApiKey: "fixture" }).model).toBeFunction()
155
+ expect(CloudflareWorkersAI.configure).toBeFunction()
156
+ expect(CloudflareWorkersAI.configure({ accountId: "fixture", apiKey: "fixture" }).model).toBeFunction()
157
+ expect(OpenRouter.model).toBeFunction()
158
+ expect(OpenRouter.decision).toBeFunction()
159
+ expect(TypeSafeAI.decision).toBeFunction()
160
+ expect(OpenCode.decision).toBeFunction()
161
+ expect(VercelAIGateway.decision("typesafe-ai/jev").route.id).toBe("openai-decisions")
162
+ expect(Baseten.decision).toBeFunction()
163
+ expect(DigitalOcean.decision).toBeFunction()
164
+ expect(OpenAI.decision("gpt-6-luna").route.id).toBe("openai-decisions")
165
+ expect(XAI.model).toBeFunction()
166
+ expect(XAI.provider.responses).toBe(XAI.responses)
167
+ expect(XAI.provider.chat).toBe(XAI.chat)
168
+ expect(XAI.configure({ apiKey: "fixture" }).responses("grok-4.3").route.id).toBe("xai-responses")
169
+ expect(XAI.configure({ apiKey: "fixture" }).chat("grok-4.3").route.id).toBe("xai-chat")
170
+ expect(OpenAI.configure({ apiKey: "fixture" }).image("gpt-image-2").route.id).toBe("openai-images")
171
+ expect(OpenAI.provider.image).toBe(OpenAI.image)
172
+ expect(Google.configure({ apiKey: "fixture" }).image("imagen-4.0-generate-001").route.id).toBe("google-images")
173
+ expect(Google.provider.image).toBe(Google.image)
174
+ expect(XAI.configure({ apiKey: "fixture" }).image("grok-imagine-image").route.id).toBe("xai-images")
175
+ expect(XAI.provider.image).toBe(XAI.image)
176
+ expect(Meta.configure({ apiKey: "fixture" }).image("muse-image").route.id).toBe("meta-images")
177
+ expect(Meta.provider.image).toBe(Meta.image)
178
+ expect(ZAI.configure({ apiKey: "fixture" }).image("glm-image").route.id).toBe("zai-images")
179
+ expect(ZAI.provider.image).toBe(ZAI.image)
180
+ expect(MiniMax.configure({ apiKey: "fixture" }).image("image-01").route.id).toBe("minimax-images")
181
+ expect(MiniMax.provider.image).toBe(MiniMax.image)
182
+ expect(Alibaba.configure({ region: "ap-southeast-1", apiKey: "fixture" }).image("qwen-image-2.0").route.id).toBe(
183
+ "alibaba-images",
184
+ )
185
+ expect(VercelAIGateway.configure({ apiKey: "fixture" }).image("meta/muse-image-1.0").route.id).toBe("openai-images")
186
+ expect(VercelAIGateway.provider.image).toBe(VercelAIGateway.image)
187
+ expect(
188
+ CloudflareWorkersAI.configure({ accountId: "fixture", apiKey: "fixture" }).image(
189
+ "@cf/black-forest-labs/flux-1-schnell",
190
+ ).route.id,
191
+ ).toBe("cloudflare-workers-ai-images")
192
+ expect(XAI.configure({ apiKey: "fixture" }).video("grok-imagine-video-1.5").route.id).toBe("xai-video")
193
+ expect(XAI.provider.video).toBe(XAI.video)
194
+ expect(OpenAI.configure({ apiKey: "fixture" }).speech("gpt-4o-mini-tts").route.id).toBe("openai-speech")
195
+ expect(Google.configure({ apiKey: "fixture" }).speech("gemini-2.5-flash-preview-tts").route.id).toBe(
196
+ "google-speech",
197
+ )
198
+ expect(ElevenLabs.configure({ apiKey: "fixture" }).speech("eleven_flash_v2_5").route.id).toBe("elevenlabs-speech")
199
+ expect(Cartesia.configure({ apiKey: "fixture" }).speech("sonic-3").route.id).toBe("cartesia-speech")
200
+ expect(Deepgram.configure({ apiKey: "fixture" }).speech("aura-2-thalia-en").route.id).toBe("deepgram-speech")
201
+ expect(OpenAI.configure({ apiKey: "fixture" }).transcription("gpt-transcribe").route.kind).toBe("stream")
202
+ expect(Google.configure({ apiKey: "fixture" }).transcription("gemini-3.5-transcribe").route.kind).toBe("stream")
203
+ expect(Deepgram.configure({ apiKey: "fixture" }).transcription("nova-3").route.kind).toBe("inline")
204
+ expect(AssemblyAI.configure({ apiKey: "fixture" }).transcription("universal-3-5-pro").route.kind).toBe("queued")
205
+ expect(ElevenLabs.configure({ apiKey: "fixture" }).transcription("scribe_v2").route.id).toBe(
206
+ "elevenlabs-transcription",
207
+ )
208
+ expect(ElevenLabs.configure({ apiKey: "fixture" }).transcription("scribe_v2").route.kind).toBe("inline")
209
+ expect(ElevenLabs.provider.transcription).toBe(ElevenLabs.transcription)
210
+ })
211
+
212
+ test("protocol barrels expose supported low-level routes", () => {
213
+ expect(OpenAIChat.route.id).toBe("openai-chat")
214
+ expect(OpenAICompatibleChat.route.id).toBe("openai-compatible-chat")
215
+ expect(OpenResponses.protocol.id).toBe("open-responses")
216
+ expect(OpenResponsesChannel.transport).toBeFunction()
217
+ expect(OpenAICompatibleResponses.route.id).toBe("openai-compatible-responses")
218
+ expect(OpenAICompatibleResponses.route.protocol).toBe("open-responses")
219
+ expect(OpenAIResponses.route.id).toBe("openai-responses")
220
+ expect(AnthropicMessages.route.id).toBe("anthropic-messages")
221
+ })
222
+ })
@@ -0,0 +1,227 @@
1
+ import { describe, expect } from "bun:test"
2
+ import { Effect } from "effect"
3
+ import { Extraction } from "../src/experimental.js"
4
+ import { CloudflareWorkersAI } from "../src/providers.js"
5
+ import { it } from "./lib/effect.js"
6
+ import { dynamicResponse, json } from "./lib/http.js"
7
+
8
+ const model = CloudflareWorkersAI.configure({
9
+ accountId: "test-account",
10
+ apiKey: "cloudflare-key",
11
+ }).experimental.extraction("@cf/cloudflare/clairic")
12
+
13
+ describe("Extraction", () => {
14
+ it.effect("sends Clairic fields and decodes typed answers", () =>
15
+ Extraction.generate({
16
+ model,
17
+ input: "Invoice INV-7 issued March 2, net 30, total $1,080.00. Contacts: Dana, Priya.",
18
+ fields: {
19
+ invoice: { type: "text", nullThreshold: 0.8 },
20
+ total: { type: "number", decimals: 2, unit: "USD" },
21
+ due: { type: "date", instructions: "Issue date plus net days" },
22
+ contacts: { type: "list", items: "text" },
23
+ payDays: { type: "estimate", min: 0, max: 120, step: 1 },
24
+ sales: { type: "forecast", min: 0, max: 500, horizon: 2, interval: "month" },
25
+ },
26
+ referenceDate: "2026-01-01",
27
+ providerOptions: { options: { include_quantiles: true } },
28
+ }).pipe(
29
+ Effect.tap((response) =>
30
+ Effect.sync(() => {
31
+ expect(response.answers).toEqual({
32
+ invoice: {
33
+ value: "INV-7",
34
+ guess: "INV-7",
35
+ nullProbability: 0.01,
36
+ confidence: 0.99,
37
+ span: [8, 13],
38
+ },
39
+ total: { value: null, guess: 1080, nullProbability: 0.6, confidence: 0.9 },
40
+ due: { value: "2026-04-01", nullProbability: 0, confidence: 1 },
41
+ contacts: {
42
+ value: ["Dana", "Priya"],
43
+ spans: [
44
+ [67, 71],
45
+ [73, 78],
46
+ ],
47
+ confidence: 0.98,
48
+ },
49
+ payDays: {
50
+ value: 30,
51
+ mean: 29.5,
52
+ median: 30,
53
+ p10: 21,
54
+ p90: 38,
55
+ belowProbability: 0.001,
56
+ aboveProbability: 0.002,
57
+ quantiles: [20, 30, 40],
58
+ },
59
+ sales: {
60
+ value: [140, 148],
61
+ steps: [
62
+ { value: 140, mean: 140, median: 141, p10: 130, p90: 151 },
63
+ { value: 148, mean: 148, median: 148, p10: 131, p90: 165 },
64
+ ],
65
+ },
66
+ })
67
+ expect(response.usage?.inputTokens).toBe(655)
68
+ expect(response.usage?.providerMetadata?.["cloudflare-workers-ai"]).toMatchObject({ passes: 3 })
69
+ expect(response.providerMetadata).toEqual({ "cloudflare-workers-ai": { model: "clairic", truncated: false } })
70
+ }),
71
+ ),
72
+ Effect.provide(
73
+ dynamicResponse((input) => {
74
+ expect(input.request.url).toBe(
75
+ "https://api.cloudflare.com/client/v4/accounts/test-account/ai/run/@cf/cloudflare/clairic",
76
+ )
77
+ expect(input.request.headers.authorization).toBe("Bearer cloudflare-key")
78
+ expect(JSON.parse(input.text)).toEqual({
79
+ options: { include_quantiles: true },
80
+ model: "@cf/cloudflare/clairic",
81
+ state: "Invoice INV-7 issued March 2, net 30, total $1,080.00. Contacts: Dana, Priya.",
82
+ fields: {
83
+ invoice: { type: "text", null_threshold: 0.8 },
84
+ total: { type: "number", decimals: 2, unit: "USD" },
85
+ due: { type: "date", instructions: "Issue date plus net days" },
86
+ contacts: { type: "list", items: "text" },
87
+ payDays: { type: "estimate", min: 0, max: 120, step: 1 },
88
+ sales: { type: "forecast", min: 0, max: 500, horizon: 2, interval: "month" },
89
+ },
90
+ reference_date: "2026-01-01",
91
+ })
92
+ return Effect.succeed(
93
+ json(input, {
94
+ result: {
95
+ model: "clairic",
96
+ answers: {
97
+ invoice: {
98
+ type: "text",
99
+ p_null: 0.01,
100
+ span: [8, 13],
101
+ guess: "INV-7",
102
+ confidence: 0.99,
103
+ value: "INV-7",
104
+ },
105
+ total: { type: "number", p_null: 0.6, guess: 1080, confidence: 0.9, value: null },
106
+ due: { type: "date", p_null: 0, confidence: 1, value: "2026-04-01" },
107
+ contacts: {
108
+ type: "list",
109
+ value: ["Dana", "Priya"],
110
+ spans: [
111
+ [67, 71],
112
+ [73, 78],
113
+ ],
114
+ confidence: 0.98,
115
+ },
116
+ payDays: {
117
+ type: "estimate",
118
+ value: 30,
119
+ mean: 29.5,
120
+ median: 30,
121
+ p10: 21,
122
+ p90: 38,
123
+ p_below: 0.001,
124
+ p_above: 0.002,
125
+ quantiles: [20, 30, 40],
126
+ },
127
+ sales: {
128
+ type: "forecast",
129
+ value: [140, 148],
130
+ median: [141, 148],
131
+ p10: [130, 131],
132
+ p90: [151, 165],
133
+ steps: [
134
+ { value: 140, mean: 140, median: 141, p10: 130, p90: 151 },
135
+ { value: 148, mean: 148, median: 148, p10: 131, p90: 165 },
136
+ ],
137
+ },
138
+ },
139
+ truncated: false,
140
+ usage: {
141
+ state_tokens: 61,
142
+ image_tokens: 0,
143
+ schema_tokens: 472,
144
+ input_tokens: 655,
145
+ output_tokens: 0,
146
+ passes: 3,
147
+ },
148
+ },
149
+ success: true,
150
+ errors: [],
151
+ messages: [],
152
+ }),
153
+ )
154
+ }),
155
+ ),
156
+ ),
157
+ )
158
+
159
+ it.effect("passes unknown field types through and drops extra answers", () =>
160
+ Extraction.generate({
161
+ model,
162
+ input: "Ship by May 20 in EUR.",
163
+ fields: { ship: { type: "date" }, money: { type: "currency", codes: ["EUR"] } },
164
+ }).pipe(
165
+ Effect.tap((response) =>
166
+ Effect.sync(() =>
167
+ expect(response.answers).toEqual({
168
+ ship: { value: "2026-05-20", confidence: 0.97 },
169
+ money: { type: "currency", value: "EUR", p_null: 0 },
170
+ }),
171
+ ),
172
+ ),
173
+ Effect.provide(
174
+ dynamicResponse((input) => {
175
+ expect(JSON.parse(input.text).fields.money).toEqual({ type: "currency", codes: ["EUR"] })
176
+ return Effect.succeed(
177
+ json(input, {
178
+ result: {
179
+ model: "clairic",
180
+ answers: {
181
+ ship: { type: "date", value: "2026-05-20", confidence: 0.97, calendar: "gregorian" },
182
+ money: { type: "currency", value: "EUR", p_null: 0 },
183
+ extra: { type: "hologram", value: { x: 1 } },
184
+ },
185
+ future_flag: true,
186
+ },
187
+ }),
188
+ )
189
+ }),
190
+ ),
191
+ ),
192
+ )
193
+
194
+ it.effect("fails when a requested field has no answer", () =>
195
+ Extraction.generate({ model, input: "Nothing here.", fields: { total: { type: "number" } } }).pipe(
196
+ Effect.flip,
197
+ Effect.tap((error) => Effect.sync(() => expect(error.reason._tag).toBe("InvalidProviderOutput"))),
198
+ Effect.provide(
199
+ dynamicResponse((input) =>
200
+ Effect.succeed(json(input, { result: { model: "clairic", answers: {}, usage: { input_tokens: 1 } } })),
201
+ ),
202
+ ),
203
+ ),
204
+ )
205
+
206
+ it.effect("fails when an answer value does not match its field", () =>
207
+ Extraction.generate({ model, input: "Total: lots.", fields: { total: { type: "number" } } }).pipe(
208
+ Effect.flip,
209
+ Effect.tap((error) => Effect.sync(() => expect(error.reason._tag).toBe("InvalidProviderOutput"))),
210
+ Effect.provide(
211
+ dynamicResponse((input) =>
212
+ Effect.succeed(
213
+ json(input, { result: { model: "clairic", answers: { total: { type: "number", value: "lots" } } } }),
214
+ ),
215
+ ),
216
+ ),
217
+ ),
218
+ )
219
+
220
+ it.effect("rejects an empty field map before the network", () =>
221
+ Extraction.generate({ model, input: "x", fields: {} }).pipe(
222
+ Effect.flip,
223
+ Effect.tap((error) => Effect.sync(() => expect(error.reason._tag).toBe("InvalidRequest"))),
224
+ Effect.provide(dynamicResponse(() => Effect.die("an invalid extraction request reached the network"))),
225
+ ),
226
+ )
227
+ })
Binary file
Binary file
Binary file
@@ -0,0 +1,35 @@
1
+ {
2
+ "version": 1,
3
+ "metadata": {
4
+ "tags": [
5
+ "prefix:alibaba-chat",
6
+ "provider:alibaba",
7
+ "protocol:alibaba-chat",
8
+ "region:ap-southeast-1",
9
+ "thinking",
10
+ "usage"
11
+ ],
12
+ "name": "alibaba-chat/qwen-3-7-plus-streams-thinking-disabled",
13
+ "recordedAt": "2026-10-02T01:23:37.836Z"
14
+ },
15
+ "interactions": [
16
+ {
17
+ "transport": "http",
18
+ "request": {
19
+ "method": "POST",
20
+ "url": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions",
21
+ "headers": {
22
+ "content-type": "application/json"
23
+ },
24
+ "body": "{\"model\":\"qwen3.7-plus\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is 173 multiplied by 219? Reply with only the final integer.\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":4096,\"enable_thinking\":false}"
25
+ },
26
+ "response": {
27
+ "status": 200,
28
+ "headers": {
29
+ "content-type": "text/event-stream;charset=utf-8"
30
+ },
31
+ "body": "data: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-e96a3356-bec9-98ad-bdbe-af00a15ee965\",\"created\":1790904216,\"object\":\"chat.completion.chunk\",\"usage\":null,\"choices\":[{\"logprobs\":null,\"index\":0,\"delta\":{\"content\":\"\",\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-e96a3356-bec9-98ad-bdbe-af00a15ee965\",\"choices\":[{\"delta\":{\"content\":\"3\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904216,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-e96a3356-bec9-98ad-bdbe-af00a15ee965\",\"choices\":[{\"delta\":{\"content\":\"7887\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904216,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-e96a3356-bec9-98ad-bdbe-af00a15ee965\",\"choices\":[{\"delta\":{\"content\":\"\"},\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null}],\"created\":1790904216,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"choices\":[],\"created\":1790904216,\"id\":\"chatcmpl-e96a3356-bec9-98ad-bdbe-af00a15ee965\",\"model\":\"qwen3.7-plus\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":5,\"prompt_tokens\":32,\"prompt_tokens_details\":{\"cache_creation\":{\"ephemeral_5m_input_tokens\":0},\"cache_creation_input_tokens\":0,\"cache_type\":\"ephemeral\",\"cache_write_tokens\":0,\"cached_tokens\":0,\"text_tokens\":32},\"total_tokens\":37}}\n\ndata: [DONE]\n\n"
32
+ }
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "version": 1,
3
+ "metadata": {
4
+ "tags": [
5
+ "prefix:alibaba-chat",
6
+ "provider:alibaba",
7
+ "protocol:alibaba-chat",
8
+ "region:ap-southeast-1",
9
+ "thinking",
10
+ "usage"
11
+ ],
12
+ "name": "alibaba-chat/qwen-3-7-plus-streams-thinking-enabled",
13
+ "recordedAt": "2026-10-02T01:23:43.998Z"
14
+ },
15
+ "interactions": [
16
+ {
17
+ "transport": "http",
18
+ "request": {
19
+ "method": "POST",
20
+ "url": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions",
21
+ "headers": {
22
+ "content-type": "application/json"
23
+ },
24
+ "body": "{\"model\":\"qwen3.7-plus\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is 173 multiplied by 219? Reply with only the final integer.\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":4096,\"enable_thinking\":true,\"thinking_budget\":1024}"
25
+ },
26
+ "response": {
27
+ "status": 200,
28
+ "headers": {
29
+ "content-type": "text/event-stream;charset=utf-8"
30
+ },
31
+ "body": "data: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null,\"choices\":[{\"logprobs\":null,\"index\":0,\"delta\":{\"content\":\"\",\"role\":\"assistant\",\"reasoning_content\":\"\"},\"finish_reason\":null}]}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"Thinking\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Process:\\n\\n1\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\". Identify\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" the core\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" question: Calculate \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"173 *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 219\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\".\\n2.\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Constraint: Reply\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" with *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"only* the final\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" integer.\\n3\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\". Perform the\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" multiplication:\\n\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"17\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"3 * 2\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"00 = \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"3460\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"0\\n \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * 1\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"73 * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"10 = \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"1730\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\\n * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 173\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * 9 =\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 155\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"7\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\\n * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Sum: 3\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"4600\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" + 17\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"30 + \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"1557\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\\n * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 346\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"00 + \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"1730\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" = 36\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"33\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"0\\n *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 36\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"330 +\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 155\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"7 = 3\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"7887\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\\n4. \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Double check:\\n\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 173\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * 21\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"9\\n *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"173 *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 220\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" = \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"173 *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 22 *\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 10 =\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 380\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"6 * 1\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"0 = 3\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"8060\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\\n * \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 380\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"60 - \"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"173 =\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" 378\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"87.\\n\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" * Matches\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\".\\n5.\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Format output:\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Only the integer\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\". \\\"37\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"88\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"7\\\"\\n6\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\". Final verification\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" of\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" the constraint: \\\"\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"Reply with only the\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" final integer.\\\" ->\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" No punctuation, no\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" extra words.\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\" Just `37\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"88\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"7`.\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"378\",\"reasoning_content\":\"\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"87\",\"reasoning_content\":\"\"},\"index\":0,\"finish_reason\":null,\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"model\":\"qwen3.7-plus\",\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"choices\":[{\"delta\":{\"content\":\"\",\"reasoning_content\":\"\"},\"index\":0,\"finish_reason\":\"stop\",\"logprobs\":null}],\"created\":1790904218,\"object\":\"chat.completion.chunk\",\"usage\":null}\n\ndata: {\"choices\":[],\"created\":1790904218,\"id\":\"chatcmpl-70ed9ebc-62fe-9ee8-a442-7a3881697fdf\",\"model\":\"qwen3.7-plus\",\"object\":\"chat.completion.chunk\",\"usage\":{\"completion_tokens\":323,\"completion_tokens_details\":{\"reasoning_tokens\":315,\"text_tokens\":323},\"prompt_tokens\":30,\"prompt_tokens_details\":{\"cache_creation\":{\"ephemeral_5m_input_tokens\":0},\"cache_creation_input_tokens\":0,\"cache_type\":\"ephemeral\",\"cache_write_tokens\":0,\"cached_tokens\":0,\"text_tokens\":30},\"total_tokens\":353}}\n\ndata: [DONE]\n\n"
32
+ }
33
+ }
34
+ ]
35
+ }