@oh-my-pi/pi-catalog 17.0.3 → 17.0.4
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/CHANGELOG.md +6 -0
- package/dist/types/types.d.ts +6 -3
- package/package.json +3 -3
- package/src/compat/openai.ts +7 -1
- package/src/types.ts +6 -3
package/CHANGELOG.md
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -276,8 +276,10 @@ export interface OpenAICompat {
|
|
|
276
276
|
* normalization (collapse `const`→`enum`, infer `type` on bare enums, strip
|
|
277
277
|
* unsupported validators/`prefixItems`) because Moonshot/Kimi native hosts
|
|
278
278
|
* reject standard JSON Schema constructs with HTTP 400. Default:
|
|
279
|
-
* auto-detected
|
|
280
|
-
*
|
|
279
|
+
* auto-detected — Moonshot native hosts (api.moonshot.ai / api.kimi.com)
|
|
280
|
+
* and Kimi-family model ids on any host, since proxies (OpenRouter, custom
|
|
281
|
+
* gateways) forward schemas to Moonshot verbatim. Set `"none"` to opt a
|
|
282
|
+
* host out.
|
|
281
283
|
*/
|
|
282
284
|
toolSchemaFlavor?: "moonshot-mfjs" | "none";
|
|
283
285
|
/**
|
|
@@ -471,6 +473,8 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
471
473
|
openRouterRouting?: OpenAICompat["openRouterRouting"];
|
|
472
474
|
/** Provider-specific wire model-id transform applied to the base id. */
|
|
473
475
|
wireModelIdMode: "raw" | "firepass" | "fireworks" | "openrouter";
|
|
476
|
+
/** See {@link OpenAICompat.toolSchemaFlavor}. Read by both wire paths when converting tools. */
|
|
477
|
+
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
474
478
|
}
|
|
475
479
|
/**
|
|
476
480
|
* Fully-resolved chat-completions compat view: every detected default
|
|
@@ -485,7 +489,6 @@ export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat & Required<Omit<Op
|
|
|
485
489
|
thinkingKeep?: OpenAICompat["thinkingKeep"];
|
|
486
490
|
streamIdleTimeoutMs?: number;
|
|
487
491
|
toolStrictMode: ResolvedToolStrictMode;
|
|
488
|
-
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
489
492
|
/** The model sits behind Vercel AI Gateway. */
|
|
490
493
|
isVercelGatewayHost: boolean;
|
|
491
494
|
dropThinkingWhenReasoningEffort: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-catalog",
|
|
4
|
-
"version": "17.0.
|
|
4
|
+
"version": "17.0.4",
|
|
5
5
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@bufbuild/protobuf": "^2.12.1",
|
|
37
|
-
"@oh-my-pi/pi-utils": "17.0.
|
|
37
|
+
"@oh-my-pi/pi-utils": "17.0.4",
|
|
38
38
|
"arktype": "2.2.3",
|
|
39
39
|
"zod": "^4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@oh-my-pi/pi-ai": "17.0.
|
|
42
|
+
"@oh-my-pi/pi-ai": "17.0.4",
|
|
43
43
|
"@types/bun": "^1.3.14"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
package/src/compat/openai.ts
CHANGED
|
@@ -532,7 +532,10 @@ export function buildOpenAICompat(spec: ModelSpec<"openai-completions">): Resolv
|
|
|
532
532
|
supportsStrictMode: detectStrictModeSupport(provider, baseUrl),
|
|
533
533
|
extraBody: isDirectDeepseekReasoning ? { thinking: { type: "enabled" } } : undefined,
|
|
534
534
|
toolStrictMode: isCerebras ? "all_strict" : "mixed",
|
|
535
|
-
|
|
535
|
+
// Kimi-family ids trigger MFJS on any host, not just native base URLs:
|
|
536
|
+
// proxies (OpenRouter, custom gateways) forward `tools.function.parameters`
|
|
537
|
+
// to Moonshot verbatim, which 400s on non-MFJS constructs.
|
|
538
|
+
toolSchemaFlavor: isMoonshotNative || isKimiModel ? "moonshot-mfjs" : undefined,
|
|
536
539
|
streamIdleTimeoutMs,
|
|
537
540
|
stripDeepseekSpecialTokens:
|
|
538
541
|
isDeepseekModelIdOrName(spec.id) && (provider === "nvidia" || provider === "deepseek"),
|
|
@@ -658,6 +661,9 @@ export function buildOpenAIResponsesCompat(spec: OpenAIResponsesSpecLike): Resol
|
|
|
658
661
|
openRouterRouting: undefined,
|
|
659
662
|
isOpenRouterHost: isOpenRouter,
|
|
660
663
|
wireModelIdMode: isOpenRouter ? "openrouter" : "raw",
|
|
664
|
+
// Mirrors buildOpenAICompat: Kimi behind a Responses-capable proxy still
|
|
665
|
+
// lands on Moonshot's MFJS validator.
|
|
666
|
+
toolSchemaFlavor: isKimiModel ? "moonshot-mfjs" : undefined,
|
|
661
667
|
alwaysSendMaxTokens: spec.id ? isKimiModelId(spec.id) : false,
|
|
662
668
|
enableGeminiThinkingLoopGuard: modelFamilyToken(spec.id ?? "") === "gemini",
|
|
663
669
|
supportsObfuscationOptOut: isOpenAIUrl || spec.provider === "openai",
|
package/src/types.ts
CHANGED
|
@@ -314,8 +314,10 @@ export interface OpenAICompat {
|
|
|
314
314
|
* normalization (collapse `const`→`enum`, infer `type` on bare enums, strip
|
|
315
315
|
* unsupported validators/`prefixItems`) because Moonshot/Kimi native hosts
|
|
316
316
|
* reject standard JSON Schema constructs with HTTP 400. Default:
|
|
317
|
-
* auto-detected
|
|
318
|
-
*
|
|
317
|
+
* auto-detected — Moonshot native hosts (api.moonshot.ai / api.kimi.com)
|
|
318
|
+
* and Kimi-family model ids on any host, since proxies (OpenRouter, custom
|
|
319
|
+
* gateways) forward schemas to Moonshot verbatim. Set `"none"` to opt a
|
|
320
|
+
* host out.
|
|
319
321
|
*/
|
|
320
322
|
toolSchemaFlavor?: "moonshot-mfjs" | "none";
|
|
321
323
|
/**
|
|
@@ -514,6 +516,8 @@ export interface ResolvedOpenAISharedCompat {
|
|
|
514
516
|
openRouterRouting?: OpenAICompat["openRouterRouting"];
|
|
515
517
|
/** Provider-specific wire model-id transform applied to the base id. */
|
|
516
518
|
wireModelIdMode: "raw" | "firepass" | "fireworks" | "openrouter";
|
|
519
|
+
/** See {@link OpenAICompat.toolSchemaFlavor}. Read by both wire paths when converting tools. */
|
|
520
|
+
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
517
521
|
}
|
|
518
522
|
|
|
519
523
|
/**
|
|
@@ -584,7 +588,6 @@ export type ResolvedOpenAICompat = ResolvedOpenAISharedCompat &
|
|
|
584
588
|
thinkingKeep?: OpenAICompat["thinkingKeep"];
|
|
585
589
|
streamIdleTimeoutMs?: number;
|
|
586
590
|
toolStrictMode: ResolvedToolStrictMode;
|
|
587
|
-
toolSchemaFlavor?: OpenAICompat["toolSchemaFlavor"];
|
|
588
591
|
/** The model sits behind Vercel AI Gateway. */
|
|
589
592
|
isVercelGatewayHost: boolean;
|
|
590
593
|
dropThinkingWhenReasoningEffort: boolean;
|