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

model.ts

40 lines1.2 KB

1export const MODEL_OPTIONS = [
2 { slug: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
3 { slug: "gpt-5.3-codex-spark", name: "GPT-5.3 Codex Spark" },
4 { slug: "gpt-5.2-codex", name: "GPT-5.2 Codex" },
5 { slug: "gpt-5.2", name: "GPT-5.2" },
6] as const;
7​
8export type BuiltInModelSlug = (typeof MODEL_OPTIONS)[number]["slug"];
9export type ModelSlug = string;
10​
11export const DEFAULT_MODEL = "gpt-5.3-codex";
12​
13export const MODEL_SLUG_ALIASES: Record<string, BuiltInModelSlug> = {
14 "5.3": "gpt-5.3-codex",
15 "gpt-5.3": "gpt-5.3-codex",
16 "5.3-spark": "gpt-5.3-codex-spark",
17 "gpt-5.3-spark": "gpt-5.3-codex-spark",
18};
19​
20export function normalizeModelSlug(model: string | null | undefined): ModelSlug | null {
21 if (typeof model !== "string") {
22 return null;
23 }
24​
25 const trimmed = model.trim();
26 if (!trimmed) {
27 return null;
28 }
29​
30 return MODEL_SLUG_ALIASES[trimmed] ?? trimmed;
32​
33export function resolveModelSlug(model: string | null | undefined): ModelSlug {
34 const normalized = normalizeModelSlug(model);
35 return normalized ?? DEFAULT_MODEL;
37​
38export const REASONING_OPTIONS = ["xhigh", "high", "medium", "low"] as const;
39export type ReasoningEffort = (typeof REASONING_OPTIONS)[number];
40export const DEFAULT_REASONING: ReasoningEffort = "high";