Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

model.ts

32 lines815 Bytes

1export const MODEL_OPTIONS = ["gpt-5.3-codex", "gpt-5.2-codex", "gpt-5.2"] as const;
2​
3export const DEFAULT_MODEL = "gpt-5.3-codex";
4​
5export const MODEL_SLUG_ALIASES: Record<string, string> = {
6 "5.3": "gpt-5.3-codex",
7 "gpt-5.3": "gpt-5.3-codex",
8};
9​
10export function normalizeModelSlug(model: string | null | undefined): string | null {
11 if (typeof model !== "string") {
12 return null;
13 }
14​
15 const trimmed = model.trim();
16 if (!trimmed) {
17 return null;
18 }
19​
20 return MODEL_SLUG_ALIASES[trimmed] ?? trimmed;
22​
23export function resolveModelSlug(model: string | null | undefined): string {
24 const normalized = normalizeModelSlug(model);
25 if (!normalized) {
26 return DEFAULT_MODEL;
27 }
28​
29 return MODEL_OPTIONS.includes(normalized as (typeof MODEL_OPTIONS)[number])
30 ? normalized
31 : DEFAULT_MODEL;