@arcships/aimux 0.3.0 → 0.6.0

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 (295) hide show
  1. package/README.md +92 -0
  2. package/dist/error.d.ts +28 -69
  3. package/dist/error.js +72 -160
  4. package/dist/generated/ops.d.ts +75 -0
  5. package/dist/generated/ops.js +80 -0
  6. package/dist/generated/types.d.ts +5607 -0
  7. package/dist/{types/CallOptions.js → generated/types.js} +1 -0
  8. package/dist/index.d.ts +144 -184
  9. package/dist/index.js +314 -295
  10. package/dist/native.d.ts +30 -0
  11. package/dist/native.js +116 -0
  12. package/dist/types.d.ts +1 -139
  13. package/dist/types.js +0 -3
  14. package/index.d.ts +21 -469
  15. package/index.js +57 -107
  16. package/package.json +20 -17
  17. package/dist/types/AiMuxError.d.ts +0 -48
  18. package/dist/types/AiMuxError.js +0 -2
  19. package/dist/types/ApiCallError.d.ts +0 -65
  20. package/dist/types/ApiCallError.js +0 -3
  21. package/dist/types/AspectRatio.d.ts +0 -11
  22. package/dist/types/AspectRatio.js +0 -3
  23. package/dist/types/AudioChunk.d.ts +0 -8
  24. package/dist/types/AudioChunk.js +0 -3
  25. package/dist/types/AudioData.d.ts +0 -11
  26. package/dist/types/AudioData.js +0 -3
  27. package/dist/types/AudioInput.d.ts +0 -8
  28. package/dist/types/AudioInput.js +0 -3
  29. package/dist/types/BreakKind.d.ts +0 -1
  30. package/dist/types/BreakKind.js +0 -3
  31. package/dist/types/CallOptions.d.ts +0 -117
  32. package/dist/types/CatalogueSource.d.ts +0 -4
  33. package/dist/types/CatalogueSource.js +0 -3
  34. package/dist/types/ChatCompletion.d.ts +0 -16
  35. package/dist/types/ChatCompletion.js +0 -2
  36. package/dist/types/ChatCompletionChoice.d.ts +0 -8
  37. package/dist/types/ChatCompletionChoice.js +0 -2
  38. package/dist/types/ChatCompletionChunk.d.ts +0 -15
  39. package/dist/types/ChatCompletionChunk.js +0 -2
  40. package/dist/types/ChatCompletionChunkChoice.d.ts +0 -8
  41. package/dist/types/ChatCompletionChunkChoice.js +0 -2
  42. package/dist/types/ChatCompletionChunkFunction.d.ts +0 -4
  43. package/dist/types/ChatCompletionChunkFunction.js +0 -3
  44. package/dist/types/ChatCompletionChunkToolCall.d.ts +0 -7
  45. package/dist/types/ChatCompletionChunkToolCall.js +0 -2
  46. package/dist/types/ChatCompletionDelta.d.ts +0 -7
  47. package/dist/types/ChatCompletionDelta.js +0 -2
  48. package/dist/types/ChatCompletionFunction.d.ts +0 -4
  49. package/dist/types/ChatCompletionFunction.js +0 -3
  50. package/dist/types/ChatCompletionMessage.d.ts +0 -9
  51. package/dist/types/ChatCompletionMessage.js +0 -2
  52. package/dist/types/ChatCompletionToolCall.d.ts +0 -6
  53. package/dist/types/ChatCompletionToolCall.js +0 -2
  54. package/dist/types/ChatCompletionUsage.d.ts +0 -9
  55. package/dist/types/ChatCompletionUsage.js +0 -2
  56. package/dist/types/CompletionTokensDetails.d.ts +0 -3
  57. package/dist/types/CompletionTokensDetails.js +0 -3
  58. package/dist/types/ContentPart.d.ts +0 -106
  59. package/dist/types/ContentPart.js +0 -2
  60. package/dist/types/EmbeddingCallOptions.d.ts +0 -24
  61. package/dist/types/EmbeddingCallOptions.js +0 -2
  62. package/dist/types/EmbeddingResponse.d.ts +0 -16
  63. package/dist/types/EmbeddingResponse.js +0 -2
  64. package/dist/types/EmbeddingResult.d.ts +0 -33
  65. package/dist/types/EmbeddingResult.js +0 -2
  66. package/dist/types/EmbeddingUsage.d.ts +0 -9
  67. package/dist/types/EmbeddingUsage.js +0 -3
  68. package/dist/types/FileBytes.d.ts +0 -12
  69. package/dist/types/FileBytes.js +0 -3
  70. package/dist/types/FileData.d.ts +0 -25
  71. package/dist/types/FileData.js +0 -2
  72. package/dist/types/FilePart.d.ts +0 -8
  73. package/dist/types/FilePart.js +0 -2
  74. package/dist/types/Fingerprint.d.ts +0 -21
  75. package/dist/types/Fingerprint.js +0 -3
  76. package/dist/types/FinishReason.d.ts +0 -14
  77. package/dist/types/FinishReason.js +0 -2
  78. package/dist/types/FinishReasonUnified.d.ts +0 -4
  79. package/dist/types/FinishReasonUnified.js +0 -3
  80. package/dist/types/FunctionTool.d.ts +0 -35
  81. package/dist/types/FunctionTool.js +0 -2
  82. package/dist/types/GenerateContent.d.ts +0 -77
  83. package/dist/types/GenerateContent.js +0 -2
  84. package/dist/types/GenerateObjectResult.d.ts +0 -48
  85. package/dist/types/GenerateObjectResult.js +0 -2
  86. package/dist/types/GenerateResult.d.ts +0 -45
  87. package/dist/types/GenerateResult.js +0 -2
  88. package/dist/types/GenerateTextOptions.d.ts +0 -62
  89. package/dist/types/GenerateTextOptions.js +0 -2
  90. package/dist/types/GenerateTextResult.d.ts +0 -81
  91. package/dist/types/GenerateTextResult.js +0 -2
  92. package/dist/types/HttpExchange.d.ts +0 -23
  93. package/dist/types/HttpExchange.js +0 -2
  94. package/dist/types/HttpRecord.d.ts +0 -12
  95. package/dist/types/HttpRecord.js +0 -3
  96. package/dist/types/ImageCallOptions.d.ts +0 -54
  97. package/dist/types/ImageCallOptions.js +0 -2
  98. package/dist/types/ImageFile.d.ts +0 -25
  99. package/dist/types/ImageFile.js +0 -2
  100. package/dist/types/ImageFileData.d.ts +0 -8
  101. package/dist/types/ImageFileData.js +0 -3
  102. package/dist/types/ImageOutputs.d.ts +0 -14
  103. package/dist/types/ImageOutputs.js +0 -3
  104. package/dist/types/ImageResponse.d.ts +0 -19
  105. package/dist/types/ImageResponse.js +0 -3
  106. package/dist/types/ImageResult.d.ts +0 -34
  107. package/dist/types/ImageResult.js +0 -2
  108. package/dist/types/ImageUsage.d.ts +0 -19
  109. package/dist/types/ImageUsage.js +0 -3
  110. package/dist/types/InputAudioFormat.d.ts +0 -13
  111. package/dist/types/InputAudioFormat.js +0 -3
  112. package/dist/types/InputRecord.d.ts +0 -16
  113. package/dist/types/InputRecord.js +0 -2
  114. package/dist/types/LanguageModelPromptMessage.d.ts +0 -20
  115. package/dist/types/LanguageModelPromptMessage.js +0 -2
  116. package/dist/types/MessageContent.d.ts +0 -5
  117. package/dist/types/MessageContent.js +0 -2
  118. package/dist/types/Modality.d.ts +0 -4
  119. package/dist/types/Modality.js +0 -3
  120. package/dist/types/ModelCapabilities.d.ts +0 -21
  121. package/dist/types/ModelCapabilities.js +0 -3
  122. package/dist/types/ModelCost.d.ts +0 -10
  123. package/dist/types/ModelCost.js +0 -3
  124. package/dist/types/ModelId.d.ts +0 -7
  125. package/dist/types/ModelId.js +0 -3
  126. package/dist/types/ModelLimits.d.ts +0 -17
  127. package/dist/types/ModelLimits.js +0 -3
  128. package/dist/types/ModelMessage.d.ts +0 -9
  129. package/dist/types/ModelMessage.js +0 -2
  130. package/dist/types/ModelModalities.d.ts +0 -8
  131. package/dist/types/ModelModalities.js +0 -2
  132. package/dist/types/ModelPrompt.d.ts +0 -7
  133. package/dist/types/ModelPrompt.js +0 -2
  134. package/dist/types/ModelSpec.d.ts +0 -33
  135. package/dist/types/ModelSpec.js +0 -2
  136. package/dist/types/ModelType.d.ts +0 -4
  137. package/dist/types/ModelType.js +0 -3
  138. package/dist/types/OutcomeRecord.d.ts +0 -14
  139. package/dist/types/OutcomeRecord.js +0 -2
  140. package/dist/types/OutcomeStatus.d.ts +0 -4
  141. package/dist/types/OutcomeStatus.js +0 -3
  142. package/dist/types/PrefixBreak.d.ts +0 -11
  143. package/dist/types/PrefixBreak.js +0 -2
  144. package/dist/types/PromptTokensDetails.d.ts +0 -4
  145. package/dist/types/PromptTokensDetails.js +0 -3
  146. package/dist/types/ProviderAuditSpec.d.ts +0 -33
  147. package/dist/types/ProviderAuditSpec.js +0 -2
  148. package/dist/types/ProviderFamily.d.ts +0 -5
  149. package/dist/types/ProviderFamily.js +0 -3
  150. package/dist/types/ProviderName.d.ts +0 -258
  151. package/dist/types/ProviderName.js +0 -262
  152. package/dist/types/ProviderRecord.d.ts +0 -30
  153. package/dist/types/ProviderRecord.js +0 -2
  154. package/dist/types/ProviderTool.d.ts +0 -24
  155. package/dist/types/ProviderTool.js +0 -2
  156. package/dist/types/ReasoningEffort.d.ts +0 -7
  157. package/dist/types/ReasoningEffort.js +0 -3
  158. package/dist/types/ReasoningMode.d.ts +0 -4
  159. package/dist/types/ReasoningMode.js +0 -3
  160. package/dist/types/ReasoningPart.d.ts +0 -9
  161. package/dist/types/ReasoningPart.js +0 -3
  162. package/dist/types/ReasoningSpec.d.ts +0 -39
  163. package/dist/types/ReasoningSpec.js +0 -2
  164. package/dist/types/ReasoningVisibility.d.ts +0 -4
  165. package/dist/types/ReasoningVisibility.js +0 -3
  166. package/dist/types/Recording.d.ts +0 -56
  167. package/dist/types/Recording.js +0 -2
  168. package/dist/types/RequestCacheHints.d.ts +0 -9
  169. package/dist/types/RequestCacheHints.js +0 -3
  170. package/dist/types/RequestInfo.d.ts +0 -12
  171. package/dist/types/RequestInfo.js +0 -2
  172. package/dist/types/RerankingCallOptions.d.ts +0 -33
  173. package/dist/types/RerankingCallOptions.js +0 -2
  174. package/dist/types/RerankingDocuments.d.ts +0 -15
  175. package/dist/types/RerankingDocuments.js +0 -2
  176. package/dist/types/RerankingRank.d.ts +0 -13
  177. package/dist/types/RerankingRank.js +0 -3
  178. package/dist/types/RerankingResponse.d.ts +0 -28
  179. package/dist/types/RerankingResponse.js +0 -2
  180. package/dist/types/RerankingResult.d.ts +0 -31
  181. package/dist/types/RerankingResult.js +0 -2
  182. package/dist/types/ResponseFormat.d.ts +0 -11
  183. package/dist/types/ResponseFormat.js +0 -2
  184. package/dist/types/ResponseInfo.d.ts +0 -30
  185. package/dist/types/ResponseInfo.js +0 -2
  186. package/dist/types/ResponseMetadata.d.ts +0 -8
  187. package/dist/types/ResponseMetadata.js +0 -3
  188. package/dist/types/ResponseRecord.d.ts +0 -13
  189. package/dist/types/ResponseRecord.js +0 -3
  190. package/dist/types/Role.d.ts +0 -4
  191. package/dist/types/Role.js +0 -3
  192. package/dist/types/RuntimeModel.d.ts +0 -22
  193. package/dist/types/RuntimeModel.js +0 -3
  194. package/dist/types/SearchCallOptions.d.ts +0 -46
  195. package/dist/types/SearchCallOptions.js +0 -2
  196. package/dist/types/SearchResponse.d.ts +0 -16
  197. package/dist/types/SearchResponse.js +0 -2
  198. package/dist/types/SearchResult.d.ts +0 -32
  199. package/dist/types/SearchResult.js +0 -2
  200. package/dist/types/SearchResultItem.d.ts +0 -33
  201. package/dist/types/SearchResultItem.js +0 -2
  202. package/dist/types/SessionCall.d.ts +0 -20
  203. package/dist/types/SessionCall.js +0 -3
  204. package/dist/types/SessionChainView.d.ts +0 -10
  205. package/dist/types/SessionChainView.js +0 -2
  206. package/dist/types/SessionSource.d.ts +0 -4
  207. package/dist/types/SessionSource.js +0 -3
  208. package/dist/types/SessionStepStat.d.ts +0 -27
  209. package/dist/types/SessionStepStat.js +0 -2
  210. package/dist/types/SessionView.d.ts +0 -16
  211. package/dist/types/SessionView.js +0 -2
  212. package/dist/types/Size.d.ts +0 -11
  213. package/dist/types/Size.js +0 -3
  214. package/dist/types/SourcePart.d.ts +0 -9
  215. package/dist/types/SourcePart.js +0 -3
  216. package/dist/types/SpeechCallOptions.d.ts +0 -47
  217. package/dist/types/SpeechCallOptions.js +0 -2
  218. package/dist/types/SpeechRequest.d.ts +0 -10
  219. package/dist/types/SpeechRequest.js +0 -2
  220. package/dist/types/SpeechResponse.d.ts +0 -24
  221. package/dist/types/SpeechResponse.js +0 -2
  222. package/dist/types/SpeechResult.d.ts +0 -34
  223. package/dist/types/SpeechResult.js +0 -2
  224. package/dist/types/StreamPart.d.ts +0 -161
  225. package/dist/types/StreamPart.js +0 -2
  226. package/dist/types/StreamTextResultAggregated.d.ts +0 -74
  227. package/dist/types/StreamTextResultAggregated.js +0 -2
  228. package/dist/types/TimeoutConfiguration.d.ts +0 -23
  229. package/dist/types/TimeoutConfiguration.js +0 -3
  230. package/dist/types/TimingRecord.d.ts +0 -7
  231. package/dist/types/TimingRecord.js +0 -3
  232. package/dist/types/TokenUsage.d.ts +0 -29
  233. package/dist/types/TokenUsage.js +0 -3
  234. package/dist/types/Tool.d.ts +0 -12
  235. package/dist/types/Tool.js +0 -2
  236. package/dist/types/ToolCall.d.ts +0 -33
  237. package/dist/types/ToolCall.js +0 -2
  238. package/dist/types/ToolChoice.d.ts +0 -12
  239. package/dist/types/ToolChoice.js +0 -3
  240. package/dist/types/ToolResult.d.ts +0 -22
  241. package/dist/types/ToolResult.js +0 -2
  242. package/dist/types/TraceFilter.d.ts +0 -9
  243. package/dist/types/TraceFilter.js +0 -3
  244. package/dist/types/TraceRecord.d.ts +0 -54
  245. package/dist/types/TraceRecord.js +0 -2
  246. package/dist/types/TraceStats.d.ts +0 -20
  247. package/dist/types/TraceStats.js +0 -3
  248. package/dist/types/TranscriptionCallOptions.d.ts +0 -29
  249. package/dist/types/TranscriptionCallOptions.js +0 -2
  250. package/dist/types/TranscriptionRequest.d.ts +0 -9
  251. package/dist/types/TranscriptionRequest.js +0 -3
  252. package/dist/types/TranscriptionResponse.d.ts +0 -24
  253. package/dist/types/TranscriptionResponse.js +0 -2
  254. package/dist/types/TranscriptionResult.d.ts +0 -46
  255. package/dist/types/TranscriptionResult.js +0 -2
  256. package/dist/types/TranscriptionSegment.d.ts +0 -17
  257. package/dist/types/TranscriptionSegment.js +0 -3
  258. package/dist/types/TranscriptionStreamPart.d.ts +0 -70
  259. package/dist/types/TranscriptionStreamPart.js +0 -2
  260. package/dist/types/UploadFileCallOptions.d.ts +0 -27
  261. package/dist/types/UploadFileCallOptions.js +0 -2
  262. package/dist/types/UploadFileData.d.ts +0 -17
  263. package/dist/types/UploadFileData.js +0 -2
  264. package/dist/types/UploadFileResult.d.ts +0 -35
  265. package/dist/types/UploadFileResult.js +0 -2
  266. package/dist/types/Usage.d.ts +0 -13
  267. package/dist/types/Usage.js +0 -2
  268. package/dist/types/UsageSnapshot.d.ts +0 -18
  269. package/dist/types/UsageSnapshot.js +0 -2
  270. package/dist/types/Verdict.d.ts +0 -23
  271. package/dist/types/Verdict.js +0 -2
  272. package/dist/types/VerdictConfidence.d.ts +0 -4
  273. package/dist/types/VerdictConfidence.js +0 -3
  274. package/dist/types/VerdictKind.d.ts +0 -4
  275. package/dist/types/VerdictKind.js +0 -3
  276. package/dist/types/VideoCallOptions.d.ts +0 -69
  277. package/dist/types/VideoCallOptions.js +0 -2
  278. package/dist/types/VideoData.d.ts +0 -22
  279. package/dist/types/VideoData.js +0 -3
  280. package/dist/types/VideoFile.d.ts +0 -29
  281. package/dist/types/VideoFile.js +0 -2
  282. package/dist/types/VideoFileData.d.ts +0 -8
  283. package/dist/types/VideoFileData.js +0 -3
  284. package/dist/types/VideoFrameImage.d.ts +0 -17
  285. package/dist/types/VideoFrameImage.js +0 -2
  286. package/dist/types/VideoFrameType.d.ts +0 -6
  287. package/dist/types/VideoFrameType.js +0 -3
  288. package/dist/types/VideoResponse.d.ts +0 -19
  289. package/dist/types/VideoResponse.js +0 -3
  290. package/dist/types/VideoResult.d.ts +0 -29
  291. package/dist/types/VideoResult.js +0 -2
  292. package/dist/types/Warning.d.ts +0 -23
  293. package/dist/types/Warning.js +0 -3
  294. package/dist/types/serde_json/JsonValue.d.ts +0 -3
  295. package/dist/types/serde_json/JsonValue.js +0 -3
@@ -1,35 +0,0 @@
1
- import type { JsonValue } from "./serde_json/JsonValue";
2
- /**
3
- * A tool definition passed to the model in `CallOptions.tools`.
4
- */
5
- export type FunctionTool = {
6
- /**
7
- * Unique tool name.
8
- */
9
- name: string;
10
- /**
11
- * Human-readable description.
12
- */
13
- description: string | null;
14
- /**
15
- * JSON Schema describing the tool's parameters.
16
- */
17
- input_schema: JsonValue;
18
- /**
19
- * Whether the tool supports strict schema enforcement (OpenAI strict mode).
20
- */
21
- strict: boolean | null;
22
- /**
23
- * Provider-specific options, keyed by provider name
24
- * (e.g. `{"anthropic": {"eagerInputStreaming": true}}`). Aligned with the
25
- * V4 `providerOptions` field on function tools.
26
- */
27
- provider_options?: {
28
- [key in string]: JsonValue;
29
- } | null;
30
- /**
31
- * Example inputs for the tool (V4 `inputExamples`), used by some providers
32
- * to emit `input_examples` in the request body.
33
- */
34
- input_examples?: Array<JsonValue> | null;
35
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,77 +0,0 @@
1
- import type { FileData } from "./FileData";
2
- import type { JsonValue } from "./serde_json/JsonValue";
3
- /**
4
- * A content item in the generation result.
5
- */
6
- export type GenerateContent = {
7
- "Text": {
8
- text: string;
9
- provider_metadata?: JsonValue | null;
10
- };
11
- } | {
12
- "ToolCall": {
13
- tool_call_id: string;
14
- tool_name: string;
15
- input: JsonValue;
16
- /**
17
- * Whether the tool call will be executed by the provider.
18
- * If false/unset, the tool call is executed by the client.
19
- */
20
- provider_executed?: boolean | null;
21
- /**
22
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
23
- */
24
- dynamic?: boolean | null;
25
- /**
26
- * Provider-assigned thought signature (e.g. Google Gemini
27
- * `thoughtSignature`). Must be echoed back verbatim on the follow-up
28
- * turn when the tool result is sent.
29
- */
30
- thought_signature?: string | null;
31
- /**
32
- * Additional provider-specific metadata for the tool call.
33
- */
34
- provider_metadata?: JsonValue | null;
35
- };
36
- } | {
37
- "Source": {
38
- id: string;
39
- source_type: string;
40
- url: string | null;
41
- title: string | null;
42
- provider_metadata?: JsonValue | null;
43
- };
44
- } | {
45
- "Reasoning": {
46
- text: string;
47
- provider_metadata: JsonValue | null;
48
- };
49
- } | {
50
- "File": {
51
- data: FileData;
52
- media_type: string;
53
- provider_metadata?: JsonValue | null;
54
- };
55
- } | {
56
- "ToolResult": {
57
- tool_call_id: string;
58
- tool_name: string;
59
- result: JsonValue;
60
- /**
61
- * Whether the result is an error or error message.
62
- */
63
- is_error?: boolean | null;
64
- /**
65
- * Whether the result is preliminary (replaces prior, e.g. image previews).
66
- */
67
- preliminary?: boolean | null;
68
- /**
69
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
70
- */
71
- dynamic?: boolean | null;
72
- /**
73
- * Additional provider-specific metadata for the tool result.
74
- */
75
- provider_metadata?: JsonValue | null;
76
- };
77
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,48 +0,0 @@
1
- import type { FinishReason } from "./FinishReason";
2
- import type { GenerateTextResult } from "./GenerateTextResult";
3
- import type { ResponseMetadata } from "./ResponseMetadata";
4
- import type { Usage } from "./Usage";
5
- import type { Warning } from "./Warning";
6
- import type { JsonValue } from "./serde_json/JsonValue";
7
- /**
8
- * Result of `generate_object` (user-facing, M12). The parsed JSON object plus
9
- * convenience fields from the underlying `generate_text` call.
10
- */
11
- export type GenerateObjectResult = {
12
- /**
13
- * The parsed JSON object returned by the model.
14
- */
15
- object: JsonValue;
16
- /**
17
- * Why generation stopped.
18
- */
19
- finish_reason: FinishReason;
20
- /**
21
- * Raw provider-specific finish reason string.
22
- */
23
- raw_finish_reason: string | null;
24
- /**
25
- * Token usage.
26
- */
27
- usage: Usage;
28
- /**
29
- * Warnings from the provider.
30
- */
31
- warnings: Array<Warning>;
32
- /**
33
- * Concatenated reasoning text (if the model produced reasoning/thinking).
34
- */
35
- reasoning: string | null;
36
- /**
37
- * Provider-specific metadata (e.g. Anthropic cache info).
38
- */
39
- provider_metadata: JsonValue | null;
40
- /**
41
- * Response metadata (id, timestamp, model_id).
42
- */
43
- response: ResponseMetadata;
44
- /**
45
- * The full `generate_text` result (for advanced use).
46
- */
47
- raw: GenerateTextResult;
48
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,45 +0,0 @@
1
- import type { FinishReason } from "./FinishReason";
2
- import type { GenerateContent } from "./GenerateContent";
3
- import type { ResponseMetadata } from "./ResponseMetadata";
4
- import type { Usage } from "./Usage";
5
- import type { Warning } from "./Warning";
6
- import type { JsonValue } from "./serde_json/JsonValue";
7
- /**
8
- * Result of `LanguageModel::do_generate` (non-streaming).
9
- */
10
- export type GenerateResult = {
11
- /**
12
- * Generated content items (text, tool calls, etc.).
13
- */
14
- content: Array<GenerateContent>;
15
- /**
16
- * Why generation stopped.
17
- */
18
- finish_reason: FinishReason;
19
- /**
20
- * Token usage.
21
- */
22
- usage: Usage;
23
- /**
24
- * Warnings issued by the provider.
25
- */
26
- warnings: Array<Warning>;
27
- /**
28
- * Provider-specific metadata.
29
- */
30
- provider_metadata: JsonValue | null;
31
- /**
32
- * Response metadata (id, timestamp, model_id).
33
- */
34
- response: ResponseMetadata;
35
- /**
36
- * The request body that was sent (for debugging).
37
- */
38
- request_body: JsonValue | null;
39
- /**
40
- * Response headers.
41
- */
42
- response_headers: {
43
- [key in string]: string;
44
- } | null;
45
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,62 +0,0 @@
1
- import type { ReasoningEffort } from "./ReasoningEffort";
2
- import type { ResponseFormat } from "./ResponseFormat";
3
- import type { TimeoutConfiguration } from "./TimeoutConfiguration";
4
- import type { Tool } from "./Tool";
5
- import type { ToolChoice } from "./ToolChoice";
6
- import type { JsonValue } from "./serde_json/JsonValue";
7
- /**
8
- * User-facing options for `generate_text` and `stream_text`.
9
- *
10
- * Unlike `CallOptions` (provider-facing), this does not include `prompt`
11
- * (passed separately) and defaults are more ergonomic.
12
- */
13
- export type GenerateTextOptions = {
14
- max_output_tokens: number | null;
15
- temperature: number | null;
16
- stop_sequences: Array<string> | null;
17
- top_p: number | null;
18
- top_k: number | null;
19
- presence_penalty: number | null;
20
- frequency_penalty: number | null;
21
- response_format: ResponseFormat | null;
22
- seed: number | null;
23
- tools: Array<Tool> | null;
24
- tool_choice: ToolChoice | null;
25
- headers: {
26
- [key in string]: string;
27
- } | null;
28
- provider_options: {
29
- [key in string]: JsonValue;
30
- } | null;
31
- /**
32
- * Top-level reasoning effort.
33
- */
34
- reasoning: ReasoningEffort | null;
35
- /**
36
- * System instructions prepended to the prompt.
37
- */
38
- instructions: string | null;
39
- /**
40
- * Per-call request body overrides (deep-merged). See RFC-0017.
41
- */
42
- body_overrides: JsonValue | null;
43
- /**
44
- * Per-call retry count override. `None` = provider default, `Some(0)` = disable.
45
- */
46
- max_retries: number | null;
47
- /**
48
- * Per-call timeout configuration (total / first-chunk / chunk idle).
49
- */
50
- timeout: TimeoutConfiguration | null;
51
- /**
52
- * Session identifier, for grouping consecutive calls into a session
53
- * (observability, see RFC-0024). Orthogonal to RFC-0019 session-affinity
54
- * headers. When `None` and the optional session inferer is enabled, one
55
- * may be inferred from prompt-prefix continuation.
56
- */
57
- session_id: string | null;
58
- /**
59
- * Emit raw provider stream chunks as `StreamPart::Raw` (debugging aid).
60
- */
61
- include_raw_chunks: boolean | null;
62
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,81 +0,0 @@
1
- import type { FilePart } from "./FilePart";
2
- import type { FinishReason } from "./FinishReason";
3
- import type { GenerateResult } from "./GenerateResult";
4
- import type { ModelMessage } from "./ModelMessage";
5
- import type { ReasoningPart } from "./ReasoningPart";
6
- import type { ResponseMetadata } from "./ResponseMetadata";
7
- import type { SourcePart } from "./SourcePart";
8
- import type { ToolCall } from "./ToolCall";
9
- import type { Usage } from "./Usage";
10
- import type { Warning } from "./Warning";
11
- import type { JsonValue } from "./serde_json/JsonValue";
12
- /**
13
- * Result of `generate_text` (user-facing).
14
- */
15
- export type GenerateTextResult = {
16
- /**
17
- * The generated text (concatenated from all text content parts).
18
- */
19
- text: string;
20
- /**
21
- * Tool calls requested by the model.
22
- */
23
- tool_calls: Array<ToolCall>;
24
- /**
25
- * Why generation stopped.
26
- */
27
- finish_reason: FinishReason;
28
- /**
29
- * Token usage.
30
- */
31
- usage: Usage;
32
- /**
33
- * Warnings from the provider.
34
- */
35
- warnings: Array<Warning>;
36
- /**
37
- * Raw provider result (for advanced use).
38
- */
39
- raw: GenerateResult;
40
- /**
41
- * Reasoning / thinking segments from the model.
42
- */
43
- reasoning: Array<ReasoningPart>;
44
- /**
45
- * Concatenated reasoning text (convenience for `reasoning.iter().map(text).join("")`).
46
- */
47
- reasoning_text: string;
48
- /**
49
- * Sources / citations (search-preview models).
50
- */
51
- sources: Array<SourcePart>;
52
- /**
53
- * Files generated by the model.
54
- */
55
- files: Array<FilePart>;
56
- /**
57
- * Assistant messages ready to append to the prompt for the next turn
58
- * (solves the multi-turn "manually build assistant message" footgun).
59
- */
60
- response_messages: Array<ModelMessage>;
61
- /**
62
- * The raw provider-specific finish reason string (e.g. "stop",
63
- * "end_turn", "safety"). Useful when `finish_reason.unified` is `Other`.
64
- */
65
- raw_finish_reason: string | null;
66
- /**
67
- * Provider-specific metadata (e.g. Anthropic cache info). Mirrored from
68
- * `raw.provider_metadata` for top-level convenience.
69
- */
70
- provider_metadata: JsonValue | null;
71
- /**
72
- * Response metadata (id, timestamp, model_id). Mirrored from
73
- * `raw.response` for top-level convenience.
74
- */
75
- response: ResponseMetadata;
76
- /**
77
- * Total token usage across all steps. In single-step mode (aimux's
78
- * default), `total_usage` equals `usage`. Provided for AI SDK parity.
79
- */
80
- total_usage: Usage;
81
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,23 +0,0 @@
1
- import type { HttpRecord } from "./HttpRecord";
2
- import type { ResponseRecord } from "./ResponseRecord";
3
- import type { TimingRecord } from "./TimingRecord";
4
- /**
5
- * ③ HTTP 侧:单次 attempt 的 wire 交换。
6
- */
7
- export type HttpExchange = {
8
- /**
9
- * 第几次重试(0=首次);per-attempt 递增。
10
- */
11
- attempt: number;
12
- request: HttpRecord;
13
- /**
14
- * None = 请求失败未获响应。
15
- */
16
- response: ResponseRecord | null;
17
- timing: TimingRecord;
18
- error: string | null;
19
- /**
20
- * 流式:该 exchange 是否已终结(收到 response 补全)。非流式恒 true。
21
- */
22
- finalized: boolean;
23
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- export type HttpRecord = {
2
- method: string;
3
- url: string;
4
- /**
5
- * 敏感头(authorization/cookie/含 api-key/key/x-amz-security-token 等)已脱敏为 "\[REDACTED\]"。
6
- */
7
- headers: Array<[string, string]>;
8
- /**
9
- * 明文(脱敏后);None = 无 body。
10
- */
11
- body: string | null;
12
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,54 +0,0 @@
1
- import type { AspectRatio } from "./AspectRatio";
2
- import type { ImageFile } from "./ImageFile";
3
- import type { Size } from "./Size";
4
- import type { JsonValue } from "./serde_json/JsonValue";
5
- /**
6
- * Options passed to [`ImageModel::do_generate`].
7
- *
8
- * Aligned with V4 `ImageModelV4CallOptions`.
9
- */
10
- export type ImageCallOptions = {
11
- /**
12
- * Prompt for the image generation. `None` for operations (e.g. upscaling)
13
- * that do not require a prompt.
14
- */
15
- prompt: string | null;
16
- /**
17
- * Number of images to generate.
18
- */
19
- n: number;
20
- /**
21
- * Size of the images, in `{width}x{height}` format.
22
- * `None` uses the provider's default size.
23
- */
24
- size: Size | null;
25
- /**
26
- * Aspect ratio of the images, in `{width}:{height}` format.
27
- * `None` uses the provider's default aspect ratio.
28
- */
29
- aspect_ratio: AspectRatio | null;
30
- /**
31
- * Seed for deterministic generation. `None` uses the provider's default.
32
- */
33
- seed: number | null;
34
- /**
35
- * Images for image editing or variation generation.
36
- */
37
- files: Array<ImageFile> | null;
38
- /**
39
- * Mask image for inpainting operations.
40
- */
41
- mask: ImageFile | null;
42
- /**
43
- * Additional provider-specific options, keyed by provider name.
44
- */
45
- provider_options: {
46
- [key in string]: JsonValue;
47
- };
48
- /**
49
- * Additional HTTP headers to send with the request.
50
- */
51
- headers: {
52
- [key in string]: string;
53
- } | null;
54
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,25 +0,0 @@
1
- import type { ImageFileData } from "./ImageFileData";
2
- /**
3
- * An image file used for image editing or variation generation.
4
- *
5
- * Aligned with V4 `ImageModelV4File`.
6
- */
7
- export type ImageFile = {
8
- "File": {
9
- /**
10
- * IANA media type, e.g. `"image/png"`.
11
- */
12
- media_type: string;
13
- /**
14
- * File data as base64 string or binary bytes.
15
- */
16
- data: ImageFileData;
17
- };
18
- } | {
19
- "Url": {
20
- /**
21
- * The URL of the image file.
22
- */
23
- url: string;
24
- };
25
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- /**
2
- * File payload for an [`ImageFile::File`]: base64 string or raw bytes.
3
- */
4
- export type ImageFileData = {
5
- "Base64": string;
6
- } | {
7
- "Binary": Array<number>;
8
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +0,0 @@
1
- /**
2
- * The generated images, returned as a homogeneous collection.
3
- *
4
- * The TS result type is `Array<string> | Array<Uint8Array>` — i.e. either all
5
- * base64 strings or all binary blobs, never mixed. This enum models that
6
- * union. Providers should return data without unnecessary conversion: if the
7
- * upstream API returns base64, return [`ImageOutputs::Base64`]; if binary,
8
- * return [`ImageOutputs::Binary`].
9
- */
10
- export type ImageOutputs = {
11
- "Base64": Array<string>;
12
- } | {
13
- "Binary": Array<Array<number>>;
14
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- /**
2
- * Response information for an image generation call.
3
- */
4
- export type ImageResponse = {
5
- /**
6
- * Timestamp for the start of the generated response (ISO 8601 string).
7
- */
8
- timestamp: string | null;
9
- /**
10
- * The ID of the model that was used to generate the response.
11
- */
12
- model_id: string | null;
13
- /**
14
- * Response headers.
15
- */
16
- headers: {
17
- [key in string]: string;
18
- } | null;
19
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,34 +0,0 @@
1
- import type { ImageOutputs } from "./ImageOutputs";
2
- import type { ImageResponse } from "./ImageResponse";
3
- import type { ImageUsage } from "./ImageUsage";
4
- import type { Warning } from "./Warning";
5
- import type { JsonValue } from "./serde_json/JsonValue";
6
- /**
7
- * The result of [`ImageModel::do_generate`].
8
- *
9
- * Aligned with V4 `ImageModelV4Result`.
10
- */
11
- export type ImageResult = {
12
- /**
13
- * Generated images (base64 strings or binary data).
14
- */
15
- images: ImageOutputs;
16
- /**
17
- * Warnings for the call, e.g. unsupported features.
18
- */
19
- warnings: Array<Warning>;
20
- /**
21
- * Additional provider-specific metadata, keyed by provider name.
22
- */
23
- provider_metadata: {
24
- [key in string]: JsonValue;
25
- } | null;
26
- /**
27
- * Response information for telemetry and debugging.
28
- */
29
- response: ImageResponse;
30
- /**
31
- * Optional token usage for the call (if the provider reports it).
32
- */
33
- usage: ImageUsage | null;
34
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +0,0 @@
1
- /**
2
- * Token usage for an image generation call (if the provider reports it).
3
- *
4
- * Aligned with V4 `ImageModelV4Usage`.
5
- */
6
- export type ImageUsage = {
7
- /**
8
- * Number of input (prompt) tokens used.
9
- */
10
- input_tokens: number | null;
11
- /**
12
- * Number of output tokens used, if reported.
13
- */
14
- output_tokens: number | null;
15
- /**
16
- * Total tokens as reported by the provider.
17
- */
18
- total_tokens: number | null;
19
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- /**
2
- * The input audio format for a streaming transcription request.
3
- */
4
- export type InputAudioFormat = {
5
- /**
6
- * Audio format type, e.g. `"audio/pcm"`, `"audio/pcmu"`, `"audio/pcma"`.
7
- */
8
- format_type: string;
9
- /**
10
- * Sample rate in Hz. Only applicable for formats that require a rate.
11
- */
12
- rate: number | null;
13
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });