@code-yeongyu/senpi-ai 2026.9.4-3 → 2026.9.5
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/api/openai-codex-responses.d.ts +1 -1
- package/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/dist/api/openai-codex-responses.js +3 -1
- package/dist/api/openai-codex-responses.js.map +1 -1
- package/dist/api/openai-completions.d.ts.map +1 -1
- package/dist/api/openai-completions.js +14 -9
- package/dist/api/openai-completions.js.map +1 -1
- package/dist/api/openai-responses-shared.d.ts +3 -3
- package/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/dist/api/openai-responses-shared.js.map +1 -1
- package/dist/api/openai-responses.d.ts +1 -1
- package/dist/api/openai-responses.d.ts.map +1 -1
- package/dist/api/openai-responses.js +6 -4
- package/dist/api/openai-responses.js.map +1 -1
- package/dist/image-models.generated.d.ts +30 -0
- package/dist/image-models.generated.d.ts.map +1 -1
- package/dist/image-models.generated.js +30 -0
- package/dist/image-models.generated.js.map +1 -1
- package/dist/models.d.ts +3 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +27 -3
- package/dist/models.js.map +1 -1
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/azure-openai-responses.json +1 -1
- package/dist/providers/data/fireworks.json +1 -1
- package/dist/providers/data/github-copilot.json +1 -1
- package/dist/providers/data/openai-codex.json +1 -1
- package/dist/providers/data/openai.json +1 -1
- package/dist/providers/data/opencode.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OpenAI from "openai";
|
|
2
|
-
import { calculateCost, clampThinkingLevel, supportsMax, supportsXhigh } from "../models.js";
|
|
2
|
+
import { calculateCost, clampThinkingLevel, inferOpenAIThinkingLevelMap, supportsMax, supportsXhigh, } from "../models.js";
|
|
3
3
|
import { formatProviderError, normalizeProviderError } from "../utils/error-body.js";
|
|
4
4
|
import { AssistantMessageEventStream } from "../utils/event-stream.js";
|
|
5
5
|
import { shortHash } from "../utils/hash.js";
|
|
@@ -62,9 +62,9 @@ const OLLAMA_THINKING_LEVEL_MAP = {
|
|
|
62
62
|
max: "high",
|
|
63
63
|
};
|
|
64
64
|
function getThinkingLevelMap(model, compat) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const inferred = inferOpenAIThinkingLevelMap(model);
|
|
66
|
+
if (inferred !== undefined)
|
|
67
|
+
return inferred;
|
|
68
68
|
const id = model.id.toLowerCase();
|
|
69
69
|
const isKimiK3 = id === "k3" || id.startsWith("k3-") || /(?:^|[/:-])kimi-k3(?:$|[/.:_-])/.test(id);
|
|
70
70
|
const isDeepSeek = id.includes("deepseek");
|
|
@@ -716,12 +716,17 @@ export const streamSimple = (model, context, options) => {
|
|
|
716
716
|
const compat = getCompat(model);
|
|
717
717
|
const thinkingLevelMap = getThinkingLevelMap(model, compat);
|
|
718
718
|
const thinkingModel = thinkingLevelMap === model.thinkingLevelMap ? model : { ...model, thinkingLevelMap };
|
|
719
|
-
const clampedReasoning = options?.reasoning
|
|
720
|
-
|
|
719
|
+
const clampedReasoning = options?.reasoning
|
|
720
|
+
? clampThinkingLevel(thinkingModel, options.reasoning)
|
|
721
|
+
: model.id.includes("gpt-6-astra")
|
|
722
|
+
? "off"
|
|
723
|
+
: undefined;
|
|
724
|
+
const normalizedReasoning = clampedReasoning === "off" && model.id.includes("gpt-6-astra") ? "low" : clampedReasoning;
|
|
725
|
+
const reasoningEffort = normalizedReasoning === "off"
|
|
721
726
|
? undefined
|
|
722
|
-
:
|
|
727
|
+
: normalizedReasoning === "max" && supportsMax(thinkingModel)
|
|
723
728
|
? "max"
|
|
724
|
-
: clampMaxForOpenAI(
|
|
729
|
+
: clampMaxForOpenAI(normalizedReasoning, supportsXhigh(thinkingModel));
|
|
725
730
|
return stream(model, context, {
|
|
726
731
|
...base,
|
|
727
732
|
reasoningEffort,
|
|
@@ -864,7 +869,7 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
864
869
|
}
|
|
865
870
|
if (compat.supportsReasoningEffort) {
|
|
866
871
|
const requestedEffort = options?.reasoningEffort;
|
|
867
|
-
const mappedEffort = requestedEffort ?
|
|
872
|
+
const mappedEffort = requestedEffort ? thinkingLevelMap?.[requestedEffort] : thinkingLevelMap?.off;
|
|
868
873
|
const effort = mappedEffort === undefined ? requestedEffort : mappedEffort;
|
|
869
874
|
if (typeof effort === "string") {
|
|
870
875
|
basetenParams.reasoning_effort = effort;
|