mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
export const CLAUDE_MODEL_LABELS = {
|
|
sonnet: 'Sonnet',
|
|
'sonnet[1m]': 'Sonnet 1M',
|
|
opus: 'Opus',
|
|
'opus[1m]': 'Opus 1M'
|
|
} as const
|
|
|
|
export type ClaudeModelPreset = keyof typeof CLAUDE_MODEL_LABELS
|
|
export const CLAUDE_MODEL_PRESETS = Object.keys(CLAUDE_MODEL_LABELS) as ClaudeModelPreset[]
|
|
|
|
export const GEMINI_MODEL_LABELS = {
|
|
'gemini-3.1-pro-preview': 'Gemini 3.1 Pro Preview',
|
|
'gemini-3-flash-preview': 'Gemini 3 Flash Preview',
|
|
'gemini-2.5-pro': 'Gemini 2.5 Pro',
|
|
'gemini-2.5-flash': 'Gemini 2.5 Flash',
|
|
'gemini-2.5-flash-lite': 'Gemini 2.5 Flash Lite',
|
|
} as const
|
|
|
|
export type GeminiModelPreset = keyof typeof GEMINI_MODEL_LABELS
|
|
export const GEMINI_MODEL_PRESETS = Object.keys(GEMINI_MODEL_LABELS) as GeminiModelPreset[]
|
|
export const DEFAULT_GEMINI_MODEL: GeminiModelPreset = 'gemini-2.5-pro'
|
|
|
|
export function isClaudeModelPreset(model: string | null | undefined): model is ClaudeModelPreset {
|
|
return typeof model === 'string' && Object.hasOwn(CLAUDE_MODEL_LABELS, model)
|
|
}
|
|
|
|
export function getClaudeModelLabel(model: string): string | null {
|
|
const trimmedModel = model.trim()
|
|
if (!trimmedModel) {
|
|
return null
|
|
}
|
|
|
|
return CLAUDE_MODEL_LABELS[trimmedModel as ClaudeModelPreset] ?? null
|
|
}
|