@sayknow-cli/ai 0.3.9 → 0.3.10
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.
- package/dist/types/auth-storage.d.ts +16 -0
- package/dist/types/types.d.ts +4 -5
- package/package.json +2 -2
- package/src/auth-storage.ts +134 -12
- package/src/models.json +3589 -673
- package/src/provider-models/openai-compat.ts +4 -8
- package/src/types.ts +6 -9
- package/src/utils/oauth/index.ts +0 -1
|
@@ -665,6 +665,7 @@ export function deepseekModelManagerOptions(
|
|
|
665
665
|
): ModelManagerOptions<"openai-completions"> {
|
|
666
666
|
return createSimpleOpenAICompletionsOptions("deepseek", "https://api.deepseek.com", config);
|
|
667
667
|
}
|
|
668
|
+
|
|
668
669
|
export interface DeepInfraModelManagerConfig {
|
|
669
670
|
apiKey?: string;
|
|
670
671
|
baseUrl?: string;
|
|
@@ -673,13 +674,8 @@ export interface DeepInfraModelManagerConfig {
|
|
|
673
674
|
export function deepinfraModelManagerOptions(
|
|
674
675
|
config?: DeepInfraModelManagerConfig,
|
|
675
676
|
): ModelManagerOptions<"openai-completions"> {
|
|
676
|
-
return createSimpleOpenAICompletionsOptions(
|
|
677
|
-
"deepinfra" as Parameters<typeof getBundledModels>[0],
|
|
678
|
-
"https://api.deepinfra.com/v1/openai",
|
|
679
|
-
config,
|
|
680
|
-
);
|
|
677
|
+
return createSimpleOpenAICompletionsOptions("deepinfra", "https://api.deepinfra.com/v1/openai", config);
|
|
681
678
|
}
|
|
682
|
-
|
|
683
679
|
// ---------------------------------------------------------------------------
|
|
684
680
|
// 7.5 Fireworks
|
|
685
681
|
// ---------------------------------------------------------------------------
|
|
@@ -2269,8 +2265,6 @@ const MODELS_DEV_PROVIDER_DESCRIPTORS_CORE: readonly ModelsDevProviderDescriptor
|
|
|
2269
2265
|
}),
|
|
2270
2266
|
// --- xAI ---
|
|
2271
2267
|
openAiCompletionsDescriptor("xai", "xai", "https://api.x.ai/v1"),
|
|
2272
|
-
// --- DeepInfra ---
|
|
2273
|
-
openAiCompletionsDescriptor("deepinfra", "deepinfra", "https://api.deepinfra.com/v1/openai"),
|
|
2274
2268
|
// --- DeepSeek ---
|
|
2275
2269
|
openAiCompletionsDescriptor("deepseek", "deepseek", "https://api.deepseek.com", {
|
|
2276
2270
|
// Only ship the v4 family as built-ins; older deepseek-chat / deepseek-reasoner
|
|
@@ -2299,6 +2293,8 @@ const MODELS_DEV_PROVIDER_DESCRIPTORS_CORE: readonly ModelsDevProviderDescriptor
|
|
|
2299
2293
|
requiresAssistantContentForToolCalls: true,
|
|
2300
2294
|
},
|
|
2301
2295
|
}),
|
|
2296
|
+
// --- DeepInfra ---
|
|
2297
|
+
openAiCompletionsDescriptor("deepinfra", "deepinfra", "https://api.deepinfra.com/v1/openai"),
|
|
2302
2298
|
];
|
|
2303
2299
|
|
|
2304
2300
|
const MODELS_DEV_PROVIDER_DESCRIPTORS_CODING_PLANS: readonly ModelsDevProviderDescriptor[] = [
|
package/src/types.ts
CHANGED
|
@@ -187,7 +187,7 @@ export type CacheRetention = "none" | "short" | "long";
|
|
|
187
187
|
*
|
|
188
188
|
* The unscoped values (`"auto"`, `"default"`, `"flex"`, `"scale"`,
|
|
189
189
|
* `"priority"`) are passed through to providers that understand them
|
|
190
|
-
* (OpenAI's `service_tier` field directly; Anthropic translates
|
|
190
|
+
* (OpenAI and DeepInfra's `service_tier` field directly; Anthropic translates
|
|
191
191
|
* `"priority"` into `speed: "fast"` on supported Opus models).
|
|
192
192
|
*
|
|
193
193
|
* The scoped values target a specific provider family and behave as the
|
|
@@ -224,21 +224,18 @@ export function resolveServiceTier(
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
|
-
* True when the (possibly scoped) tier should be sent as OpenAI
|
|
228
|
-
* `service_tier` request field for
|
|
229
|
-
* `
|
|
230
|
-
* Unsupported tiers (`"auto"`, `"default"`) and scope mismatches return false.
|
|
227
|
+
* True when the (possibly scoped) tier should be sent as an OpenAI-compatible
|
|
228
|
+
* `service_tier` request field for providers that support it. Unsupported tiers
|
|
229
|
+
* (`"auto"`, `"default"`) and scope mismatches all return false.
|
|
231
230
|
*/
|
|
232
231
|
export function shouldSendServiceTier(
|
|
233
232
|
serviceTier: ServiceTier | null | undefined,
|
|
234
233
|
provider: Provider | undefined,
|
|
235
234
|
): boolean {
|
|
236
235
|
const resolved = resolveServiceTier(serviceTier, provider);
|
|
237
|
-
if (provider === "openai" || provider === "openai-codex") {
|
|
238
|
-
return resolved === "flex" || resolved === "scale" || resolved === "priority";
|
|
239
|
-
}
|
|
240
236
|
if (provider === "deepinfra") return resolved === "priority";
|
|
241
|
-
return false;
|
|
237
|
+
if (provider !== "openai" && provider !== "openai-codex") return false;
|
|
238
|
+
return resolved === "flex" || resolved === "scale" || resolved === "priority";
|
|
242
239
|
}
|
|
243
240
|
|
|
244
241
|
/**
|