<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds “Dyad Turbo” models for Pro users and centralizes model/provider constants. Pro users can pick fast, cost‑effective models directly from the ModelPicker, with clearer labels and gating. - **New Features** - Added Dyad Turbo provider in ModelPicker with Qwen3 Coder and Kimi K2 (Pro only). - Turbo options are hidden for non‑Pro users; “Pro only” badge shown where applicable. - “Smart Auto” label now applies only to the Auto model to avoid confusion. - **Refactors** - Moved all model/provider constants into language_model_constants.ts and updated imports (helpers, client, thinking utils). <!-- End of auto-generated description by cubic. -->
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { PROVIDERS_THAT_SUPPORT_THINKING } from "../shared/language_model_constants";
|
|
import type { UserSettings } from "../../lib/schemas";
|
|
|
|
function getThinkingBudgetTokens(
|
|
thinkingBudget?: "low" | "medium" | "high",
|
|
): number {
|
|
switch (thinkingBudget) {
|
|
case "low":
|
|
return 1_000;
|
|
case "medium":
|
|
return 4_000;
|
|
case "high":
|
|
return -1;
|
|
default:
|
|
return 4_000; // Default to medium
|
|
}
|
|
}
|
|
|
|
export function getExtraProviderOptions(
|
|
providerId: string | undefined,
|
|
settings: UserSettings,
|
|
): Record<string, any> {
|
|
if (!providerId) {
|
|
return {};
|
|
}
|
|
if (providerId === "openai") {
|
|
return {
|
|
reasoning_effort: "medium",
|
|
};
|
|
}
|
|
if (PROVIDERS_THAT_SUPPORT_THINKING.includes(providerId)) {
|
|
const budgetTokens = getThinkingBudgetTokens(settings?.thinkingBudget);
|
|
return {
|
|
thinking: {
|
|
type: "enabled",
|
|
include_thoughts: true,
|
|
// -1 means dynamic thinking where model determines.
|
|
// budget_tokens: 128, // minimum for Gemini Pro is 128
|
|
budget_tokens: budgetTokens,
|
|
},
|
|
};
|
|
}
|
|
return {};
|
|
}
|