fix: use a named case

This commit is contained in:
Frost Ming
2025-03-05 16:17:50 +08:00
committed by GitHub
parent 21c8b98f9c
commit a7fd64e019

View File

@@ -67,7 +67,7 @@ export function selectAIProvider(config: { apiUrl: string; apiKey: string }) {
baseURL: config.apiUrl,
apiKey: config.apiKey,
});
default:
case "custom":
return createOpenAICompatible({
name: "custom",
baseURL: config.apiUrl,
@@ -75,5 +75,7 @@ export function selectAIProvider(config: { apiUrl: string; apiKey: string }) {
Authorization: `Bearer ${config.apiKey}`,
},
)};
case default:
throw new Error(`Unsupported AI provider for URL: ${config.apiUrl}`);
}
}