@arcships/aimux 0.1.2 → 0.1.3

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.
Binary file
Binary file
@@ -77,4 +77,15 @@ export type CallOptions = {
77
77
  * Anthropic `thinking` config.
78
78
  */
79
79
  reasoning: ReasoningEffort | null;
80
+ /**
81
+ * Per-call request body overrides. Deep-merged into the provider-built
82
+ * request body (after any built-in vendor override) before sending.
83
+ * `null` values delete the corresponding key. See RFC-0017.
84
+ */
85
+ body_overrides: JsonValue | null;
86
+ /**
87
+ * Per-call retry count override. `None` uses the provider's configured
88
+ * `RetryConfig.max_retries`. `Some(0)` disables retries.
89
+ */
90
+ max_retries: number | null;
80
91
  };
@@ -35,4 +35,12 @@ export type GenerateTextOptions = {
35
35
  * System instructions prepended to the prompt.
36
36
  */
37
37
  instructions: string | null;
38
+ /**
39
+ * Per-call request body overrides (deep-merged). See RFC-0017.
40
+ */
41
+ body_overrides: JsonValue | null;
42
+ /**
43
+ * Per-call retry count override. `None` = provider default, `Some(0)` = disable.
44
+ */
45
+ max_retries: number | null;
38
46
  };
package/index.d.ts CHANGED
@@ -113,7 +113,7 @@ export declare class VideoModel {
113
113
  }
114
114
 
115
115
  /** Create an Anthropic model instance. */
116
- export declare function anthropic(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<Model>
116
+ export declare function anthropic(apiKey: string, modelId: string, config?: string | ProviderConfig | undefined | null): Promise<Model>
117
117
 
118
118
  /** Create a Cohere embedding model instance. */
119
119
  export declare function cohereEmbedding(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<EmbeddingModel>
@@ -122,7 +122,7 @@ export declare function cohereEmbedding(apiKey: string, modelId: string, baseUrl
122
122
  export declare function cohereReranking(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<RerankingModel>
123
123
 
124
124
  /** Create a DeepSeek model instance. */
125
- export declare function deepseek(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<Model>
125
+ export declare function deepseek(apiKey: string, modelId: string, config?: string | ProviderConfig | undefined | null): Promise<Model>
126
126
 
127
127
  /** Create a Google embedding model instance. */
128
128
  export declare function googleEmbedding(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<EmbeddingModel>
@@ -134,7 +134,7 @@ export declare function googleImage(apiKey: string, modelId: string, baseUrl?: s
134
134
  export declare function googleVideo(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<VideoModel>
135
135
 
136
136
  /** Create an OpenAI model instance. */
137
- export declare function openai(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<Model>
137
+ export declare function openai(apiKey: string, modelId: string, config?: string | ProviderConfig | undefined | null): Promise<Model>
138
138
 
139
139
  /** Create an OpenAI embedding model instance. */
140
140
  export declare function openaiEmbedding(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<EmbeddingModel>
@@ -151,5 +151,35 @@ export declare function openaiSpeech(apiKey: string, modelId: string, baseUrl?:
151
151
  /** Create an OpenAI transcription model instance. */
152
152
  export declare function openaiTranscription(apiKey: string, modelId: string, baseUrl?: string | undefined | null): Promise<TranscriptionModel>
153
153
 
154
+ /**
155
+ * Optional provider configuration accepted by factory functions.
156
+ *
157
+ * Passed as the 3rd argument to `openai()` / `anthropic()` / `deepseek()`.
158
+ * For backward compatibility a bare string is still accepted (treated as
159
+ * `baseUrl`). See RFC-0017.
160
+ */
161
+ export interface ProviderConfig {
162
+ /** Base URL for API calls (e.g. a relay/proxy endpoint). */
163
+ baseUrl?: string
164
+ /**
165
+ * Extra HTTP headers merged into every request, as a JSON object string
166
+ * (e.g. `'{"X-Custom":"value"}'`).
167
+ */
168
+ headers?: string
169
+ /** OpenAI organization ID (sent via `OpenAI-Organization` header). */
170
+ organization?: string
171
+ /** OpenAI project ID (sent via `OpenAI-Project` header). */
172
+ project?: string
173
+ /** Override the provider's retry count. `0` disables retries. */
174
+ maxRetries?: number
175
+ /**
176
+ * Provider-level request body overrides as a JSON string (deep-merged
177
+ * into every request). Per-call `bodyOverrides` in GenerateTextOptions
178
+ * takes precedence. Pass a JSON object string, e.g.
179
+ * `'{"enable_thinking": false}'`.
180
+ */
181
+ bodyOverrides?: string
182
+ }
183
+
154
184
  /** Create a Tavily search model instance. */
155
185
  export declare function tavilySearch(apiKey: string, baseUrl?: string | undefined | null): Promise<SearchModel>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcships/aimux",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Unified LLM service layer — one API for 172+ AI providers (Rust core, Node.js binding)",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",