@arcships/aimux 0.1.0 → 0.1.2

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 (157) hide show
  1. package/aimux.darwin-arm64.node +0 -0
  2. package/aimux.linux-x64-gnu.node +0 -0
  3. package/dist/index.d.ts +54 -0
  4. package/dist/index.js +78 -0
  5. package/dist/types/AiMuxError.d.ts +34 -0
  6. package/dist/types/AiMuxError.js +3 -0
  7. package/dist/types/AspectRatio.d.ts +11 -0
  8. package/dist/types/AspectRatio.js +3 -0
  9. package/dist/types/AudioChunk.d.ts +8 -0
  10. package/dist/types/AudioChunk.js +3 -0
  11. package/dist/types/AudioData.d.ts +11 -0
  12. package/dist/types/AudioData.js +3 -0
  13. package/dist/types/AudioInput.d.ts +8 -0
  14. package/dist/types/AudioInput.js +3 -0
  15. package/dist/types/CallOptions.d.ts +80 -0
  16. package/dist/types/CallOptions.js +2 -0
  17. package/dist/types/ContentPart.d.ts +100 -0
  18. package/dist/types/ContentPart.js +2 -0
  19. package/dist/types/EmbeddingCallOptions.d.ts +24 -0
  20. package/dist/types/EmbeddingCallOptions.js +2 -0
  21. package/dist/types/EmbeddingResponse.d.ts +16 -0
  22. package/dist/types/EmbeddingResponse.js +2 -0
  23. package/dist/types/EmbeddingResult.d.ts +33 -0
  24. package/dist/types/EmbeddingResult.js +2 -0
  25. package/dist/types/EmbeddingUsage.d.ts +9 -0
  26. package/dist/types/EmbeddingUsage.js +3 -0
  27. package/dist/types/FileBytes.d.ts +12 -0
  28. package/dist/types/FileBytes.js +3 -0
  29. package/dist/types/FileData.d.ts +25 -0
  30. package/dist/types/FileData.js +2 -0
  31. package/dist/types/FinishReason.d.ts +14 -0
  32. package/dist/types/FinishReason.js +2 -0
  33. package/dist/types/FinishReasonUnified.d.ts +4 -0
  34. package/dist/types/FinishReasonUnified.js +3 -0
  35. package/dist/types/FunctionTool.d.ts +35 -0
  36. package/dist/types/FunctionTool.js +2 -0
  37. package/dist/types/GenerateContent.d.ts +71 -0
  38. package/dist/types/GenerateContent.js +2 -0
  39. package/dist/types/GenerateResult.d.ts +45 -0
  40. package/dist/types/GenerateResult.js +2 -0
  41. package/dist/types/GenerateTextOptions.d.ts +38 -0
  42. package/dist/types/GenerateTextOptions.js +2 -0
  43. package/dist/types/GenerateTextResult.d.ts +34 -0
  44. package/dist/types/GenerateTextResult.js +2 -0
  45. package/dist/types/ImageCallOptions.d.ts +54 -0
  46. package/dist/types/ImageCallOptions.js +2 -0
  47. package/dist/types/ImageFile.d.ts +25 -0
  48. package/dist/types/ImageFile.js +2 -0
  49. package/dist/types/ImageFileData.d.ts +8 -0
  50. package/dist/types/ImageFileData.js +3 -0
  51. package/dist/types/ImageOutputs.d.ts +14 -0
  52. package/dist/types/ImageOutputs.js +3 -0
  53. package/dist/types/ImageResponse.d.ts +19 -0
  54. package/dist/types/ImageResponse.js +3 -0
  55. package/dist/types/ImageResult.d.ts +34 -0
  56. package/dist/types/ImageResult.js +2 -0
  57. package/dist/types/ImageUsage.d.ts +19 -0
  58. package/dist/types/ImageUsage.js +3 -0
  59. package/dist/types/InputAudioFormat.d.ts +13 -0
  60. package/dist/types/InputAudioFormat.js +3 -0
  61. package/dist/types/LanguageModelPromptMessage.d.ts +20 -0
  62. package/dist/types/LanguageModelPromptMessage.js +2 -0
  63. package/dist/types/MessageContent.d.ts +5 -0
  64. package/dist/types/MessageContent.js +2 -0
  65. package/dist/types/ModelId.d.ts +7 -0
  66. package/dist/types/ModelId.js +3 -0
  67. package/dist/types/ModelMessage.d.ts +9 -0
  68. package/dist/types/ModelMessage.js +2 -0
  69. package/dist/types/ModelPrompt.d.ts +7 -0
  70. package/dist/types/ModelPrompt.js +2 -0
  71. package/dist/types/ProviderTool.d.ts +24 -0
  72. package/dist/types/ProviderTool.js +2 -0
  73. package/dist/types/ReasoningEffort.d.ts +7 -0
  74. package/dist/types/ReasoningEffort.js +3 -0
  75. package/dist/types/RequestInfo.d.ts +12 -0
  76. package/dist/types/RequestInfo.js +2 -0
  77. package/dist/types/RerankingCallOptions.d.ts +33 -0
  78. package/dist/types/RerankingCallOptions.js +2 -0
  79. package/dist/types/RerankingDocuments.d.ts +15 -0
  80. package/dist/types/RerankingDocuments.js +2 -0
  81. package/dist/types/RerankingRank.d.ts +13 -0
  82. package/dist/types/RerankingRank.js +3 -0
  83. package/dist/types/RerankingResponse.d.ts +28 -0
  84. package/dist/types/RerankingResponse.js +2 -0
  85. package/dist/types/RerankingResult.d.ts +31 -0
  86. package/dist/types/RerankingResult.js +2 -0
  87. package/dist/types/ResponseFormat.d.ts +11 -0
  88. package/dist/types/ResponseFormat.js +2 -0
  89. package/dist/types/ResponseInfo.d.ts +30 -0
  90. package/dist/types/ResponseInfo.js +2 -0
  91. package/dist/types/ResponseMetadata.d.ts +8 -0
  92. package/dist/types/ResponseMetadata.js +3 -0
  93. package/dist/types/Role.d.ts +4 -0
  94. package/dist/types/Role.js +3 -0
  95. package/dist/types/SearchCallOptions.d.ts +46 -0
  96. package/dist/types/SearchCallOptions.js +2 -0
  97. package/dist/types/SearchResponse.d.ts +16 -0
  98. package/dist/types/SearchResponse.js +2 -0
  99. package/dist/types/SearchResult.d.ts +32 -0
  100. package/dist/types/SearchResult.js +2 -0
  101. package/dist/types/SearchResultItem.d.ts +33 -0
  102. package/dist/types/SearchResultItem.js +2 -0
  103. package/dist/types/Size.d.ts +11 -0
  104. package/dist/types/Size.js +3 -0
  105. package/dist/types/SpeechCallOptions.d.ts +47 -0
  106. package/dist/types/SpeechCallOptions.js +2 -0
  107. package/dist/types/SpeechRequest.d.ts +10 -0
  108. package/dist/types/SpeechRequest.js +2 -0
  109. package/dist/types/SpeechResponse.d.ts +24 -0
  110. package/dist/types/SpeechResponse.js +2 -0
  111. package/dist/types/SpeechResult.d.ts +34 -0
  112. package/dist/types/SpeechResult.js +2 -0
  113. package/dist/types/StreamPart.d.ts +155 -0
  114. package/dist/types/StreamPart.js +2 -0
  115. package/dist/types/TokenUsage.d.ts +29 -0
  116. package/dist/types/TokenUsage.js +3 -0
  117. package/dist/types/Tool.d.ts +12 -0
  118. package/dist/types/Tool.js +2 -0
  119. package/dist/types/ToolCall.d.ts +26 -0
  120. package/dist/types/ToolCall.js +2 -0
  121. package/dist/types/ToolChoice.d.ts +12 -0
  122. package/dist/types/ToolChoice.js +3 -0
  123. package/dist/types/ToolResult.d.ts +22 -0
  124. package/dist/types/ToolResult.js +2 -0
  125. package/dist/types/UploadFileCallOptions.d.ts +27 -0
  126. package/dist/types/UploadFileCallOptions.js +2 -0
  127. package/dist/types/UploadFileData.d.ts +17 -0
  128. package/dist/types/UploadFileData.js +2 -0
  129. package/dist/types/UploadFileResult.d.ts +35 -0
  130. package/dist/types/UploadFileResult.js +2 -0
  131. package/dist/types/Usage.d.ts +13 -0
  132. package/dist/types/Usage.js +2 -0
  133. package/dist/types/VideoCallOptions.d.ts +69 -0
  134. package/dist/types/VideoCallOptions.js +2 -0
  135. package/dist/types/VideoData.d.ts +22 -0
  136. package/dist/types/VideoData.js +3 -0
  137. package/dist/types/VideoFile.d.ts +29 -0
  138. package/dist/types/VideoFile.js +2 -0
  139. package/dist/types/VideoFileData.d.ts +8 -0
  140. package/dist/types/VideoFileData.js +3 -0
  141. package/dist/types/VideoFrameImage.d.ts +17 -0
  142. package/dist/types/VideoFrameImage.js +2 -0
  143. package/dist/types/VideoFrameType.d.ts +6 -0
  144. package/dist/types/VideoFrameType.js +3 -0
  145. package/dist/types/VideoResponse.d.ts +19 -0
  146. package/dist/types/VideoResponse.js +3 -0
  147. package/dist/types/VideoResult.d.ts +29 -0
  148. package/dist/types/VideoResult.js +2 -0
  149. package/dist/types/Warning.d.ts +23 -0
  150. package/dist/types/Warning.js +3 -0
  151. package/dist/types/serde_json/JsonValue.d.ts +3 -0
  152. package/dist/types/serde_json/JsonValue.js +3 -0
  153. package/dist/types.d.ts +73 -0
  154. package/dist/types.js +5 -0
  155. package/index.js +109 -109
  156. package/package.json +8 -6
  157. package/src/index.ts +0 -134
@@ -0,0 +1,71 @@
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
+ * Additional provider-specific metadata for the tool call.
27
+ */
28
+ provider_metadata?: JsonValue | null;
29
+ };
30
+ } | {
31
+ "Source": {
32
+ id: string;
33
+ source_type: string;
34
+ url: string | null;
35
+ title: string | null;
36
+ provider_metadata?: JsonValue | null;
37
+ };
38
+ } | {
39
+ "Reasoning": {
40
+ text: string;
41
+ provider_metadata: JsonValue | null;
42
+ };
43
+ } | {
44
+ "File": {
45
+ data: FileData;
46
+ media_type: string;
47
+ provider_metadata?: JsonValue | null;
48
+ };
49
+ } | {
50
+ "ToolResult": {
51
+ tool_call_id: string;
52
+ tool_name: string;
53
+ result: JsonValue;
54
+ /**
55
+ * Whether the result is an error or error message.
56
+ */
57
+ is_error?: boolean | null;
58
+ /**
59
+ * Whether the result is preliminary (replaces prior, e.g. image previews).
60
+ */
61
+ preliminary?: boolean | null;
62
+ /**
63
+ * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
64
+ */
65
+ dynamic?: boolean | null;
66
+ /**
67
+ * Additional provider-specific metadata for the tool result.
68
+ */
69
+ provider_metadata?: JsonValue | null;
70
+ };
71
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,45 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
1
+ import type { ReasoningEffort } from "./ReasoningEffort";
2
+ import type { ResponseFormat } from "./ResponseFormat";
3
+ import type { Tool } from "./Tool";
4
+ import type { ToolChoice } from "./ToolChoice";
5
+ import type { JsonValue } from "./serde_json/JsonValue";
6
+ /**
7
+ * User-facing options for `generate_text` and `stream_text`.
8
+ *
9
+ * Unlike `CallOptions` (provider-facing), this does not include `prompt`
10
+ * (passed separately) and defaults are more ergonomic.
11
+ */
12
+ export type GenerateTextOptions = {
13
+ max_output_tokens: number | null;
14
+ temperature: number | null;
15
+ stop_sequences: Array<string> | null;
16
+ top_p: number | null;
17
+ top_k: number | null;
18
+ presence_penalty: number | null;
19
+ frequency_penalty: number | null;
20
+ response_format: ResponseFormat | null;
21
+ seed: bigint | null;
22
+ tools: Array<Tool> | null;
23
+ tool_choice: ToolChoice | null;
24
+ headers: {
25
+ [key in string]: string;
26
+ } | null;
27
+ provider_options: {
28
+ [key in string]: JsonValue;
29
+ } | null;
30
+ /**
31
+ * Top-level reasoning effort.
32
+ */
33
+ reasoning: ReasoningEffort | null;
34
+ /**
35
+ * System instructions prepended to the prompt.
36
+ */
37
+ instructions: string | null;
38
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import type { FinishReason } from "./FinishReason";
2
+ import type { GenerateResult } from "./GenerateResult";
3
+ import type { ToolCall } from "./ToolCall";
4
+ import type { Usage } from "./Usage";
5
+ import type { Warning } from "./Warning";
6
+ /**
7
+ * Result of `generate_text` (user-facing).
8
+ */
9
+ export type GenerateTextResult = {
10
+ /**
11
+ * The generated text (concatenated from all text content parts).
12
+ */
13
+ text: string;
14
+ /**
15
+ * Tool calls requested by the model.
16
+ */
17
+ tool_calls: Array<ToolCall>;
18
+ /**
19
+ * Why generation stopped.
20
+ */
21
+ finish_reason: FinishReason;
22
+ /**
23
+ * Token usage.
24
+ */
25
+ usage: Usage;
26
+ /**
27
+ * Warnings from the provider.
28
+ */
29
+ warnings: Array<Warning>;
30
+ /**
31
+ * Raw provider result (for advanced use).
32
+ */
33
+ raw: GenerateResult;
34
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,54 @@
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: bigint | 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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,19 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,34 @@
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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,13 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,20 @@
1
+ import type { ContentPart } from "./ContentPart";
2
+ import type { Role } from "./Role";
3
+ import type { JsonValue } from "./serde_json/JsonValue";
4
+ /**
5
+ * A single provider-facing message.
6
+ *
7
+ * Unlike `ModelMessage` (which can have string content), this always has
8
+ * `content: Vec<ContentPart>` — strings are normalized to `ContentPart::Text`.
9
+ */
10
+ export type LanguageModelPromptMessage = {
11
+ role: Role;
12
+ content: Array<ContentPart>;
13
+ /**
14
+ * Message-level provider-specific options (e.g.
15
+ * `anthropic.cacheControl`), applied to the last part of the message when
16
+ * converting to a provider prompt. Mirrors the Vercel AI SDK
17
+ * `LanguageModelV4Message.providerOptions`.
18
+ */
19
+ provider_options: JsonValue | null;
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { ContentPart } from "./ContentPart";
2
+ /**
3
+ * Message body: either a simple string or multi-part content.
4
+ */
5
+ export type MessageContent = string | Array<ContentPart>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A model identifier in `"provider/model-name"` format, e.g. `"openai/gpt-4o"`.
3
+ */
4
+ export type ModelId = {
5
+ provider: string;
6
+ model: string;
7
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,9 @@
1
+ import type { MessageContent } from "./MessageContent";
2
+ import type { Role } from "./Role";
3
+ /**
4
+ * A single user-facing chat message.
5
+ */
6
+ export type ModelMessage = {
7
+ role: Role;
8
+ content: MessageContent;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type { ModelMessage } from "./ModelMessage";
2
+ /**
3
+ * What the user passes as `prompt` to `generate_text` / `stream_text`.
4
+ *
5
+ * Can be a simple string (converted to a single user message) or a list of messages.
6
+ */
7
+ export type ModelPrompt = string | Array<ModelMessage>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import type { JsonValue } from "./serde_json/JsonValue";
2
+ /**
3
+ * A provider-defined tool (e.g. `anthropic.web_search_20250305`,
4
+ * `google.googleSearch`). Mirrors the V4 `LanguageModelV4ProviderTool`.
5
+ *
6
+ * Provider tools are specific to a certain provider. The input and output
7
+ * schemas are defined by the provider, and some are executed on the provider's
8
+ * servers (e.g. web search, code execution).
9
+ */
10
+ export type ProviderTool = {
11
+ /**
12
+ * The ID of the tool, following the format `<provider-id>.<unique-tool-name>`.
13
+ */
14
+ id: string;
15
+ /**
16
+ * The name of the tool, unique within this model call.
17
+ */
18
+ name: string;
19
+ /**
20
+ * The arguments for configuring the tool. Must match the expected
21
+ * arguments defined by the provider for this tool.
22
+ */
23
+ args: JsonValue;
24
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Reasoning effort level (aligned with V4 `reasoning` option).
3
+ *
4
+ * Controls how much reasoning/thinking the model performs. Maps to
5
+ * OpenAI `reasoning_effort` and Anthropic `thinking` config.
6
+ */
7
+ export type ReasoningEffort = "provider-default" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,12 @@
1
+ import type { JsonValue } from "./serde_json/JsonValue";
2
+ /**
3
+ * Optional request information for telemetry and debugging.
4
+ *
5
+ * Aligned with the `request?` object that appears on some V4 model results.
6
+ */
7
+ export type RequestInfo = {
8
+ /**
9
+ * The request body that was sent (opaque JSON).
10
+ */
11
+ body: JsonValue | null;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ import type { RerankingDocuments } from "./RerankingDocuments";
2
+ import type { JsonValue } from "./serde_json/JsonValue";
3
+ /**
4
+ * Options passed to [`RerankingModel::do_rerank`].
5
+ *
6
+ * Aligned with V4 `RerankingModelV4CallOptions`.
7
+ */
8
+ export type RerankingCallOptions = {
9
+ /**
10
+ * Documents to rerank.
11
+ */
12
+ documents: RerankingDocuments;
13
+ /**
14
+ * The query to rerank the documents against.
15
+ */
16
+ query: string;
17
+ /**
18
+ * Optional limit: return only the top `n` documents.
19
+ */
20
+ top_n: number | null;
21
+ /**
22
+ * Additional provider-specific options, keyed by provider name.
23
+ */
24
+ provider_options: {
25
+ [key in string]: JsonValue;
26
+ } | null;
27
+ /**
28
+ * Additional HTTP headers to send with the request.
29
+ */
30
+ headers: {
31
+ [key in string]: string;
32
+ } | null;
33
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import type { JsonValue } from "./serde_json/JsonValue";
2
+ /**
3
+ * Documents to rerank: either a list of texts or a list of JSON objects.
4
+ *
5
+ * Aligned with V4 `RerankingModelV4CallOptions.documents`.
6
+ */
7
+ export type RerankingDocuments = {
8
+ "Text": {
9
+ values: Array<string>;
10
+ };
11
+ } | {
12
+ "Object": {
13
+ values: Array<JsonValue>;
14
+ };
15
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A single reranked entry: the original index and its relevance score.
3
+ */
4
+ export type RerankingRank = {
5
+ /**
6
+ * The index of the document in the original list (before reranking).
7
+ */
8
+ index: number;
9
+ /**
10
+ * The relevance score of the document after reranking.
11
+ */
12
+ relevance_score: number;
13
+ };
@@ -0,0 +1,3 @@
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 });