fix(ai): validate models server-side and fix reasoning detection (#1443)
This commit is contained in:
parent
49ba1d5f14
commit
99cd8699c1
4 changed files with 21 additions and 9 deletions
|
|
@ -24,8 +24,8 @@ export const chatModels: ChatModel[] = [
|
|||
description: "Fast and cost-effective for simple tasks",
|
||||
},
|
||||
{
|
||||
id: "openai/gpt-5.2",
|
||||
name: "GPT-5.2",
|
||||
id: "openai/gpt-5-mini",
|
||||
name: "GPT-5 Mini",
|
||||
provider: "openai",
|
||||
description: "Most capable OpenAI model",
|
||||
},
|
||||
|
|
@ -65,6 +65,8 @@ export const chatModels: ChatModel[] = [
|
|||
];
|
||||
|
||||
// Group models by provider for UI
|
||||
export const allowedModelIds = new Set(chatModels.map((m) => m.id));
|
||||
|
||||
export const modelsByProvider = chatModels.reduce(
|
||||
(acc, model) => {
|
||||
if (!acc[model.provider]) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ export function getLanguageModel(modelId: string) {
|
|||
}
|
||||
|
||||
const isReasoningModel =
|
||||
modelId.includes("reasoning") || modelId.endsWith("-thinking");
|
||||
modelId.endsWith("-thinking") ||
|
||||
(modelId.includes("reasoning") && !modelId.includes("non-reasoning"));
|
||||
|
||||
if (isReasoningModel) {
|
||||
const gatewayModelId = modelId.replace(THINKING_SUFFIX_REGEX, "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue