(provider: string)
| 1759 | }; |
| 1760 | |
| 1761 | const normalizeAIProviderType = (provider: string): AIProviderType => { |
| 1762 | const normalized = provider.trim().toLowerCase(); |
| 1763 | const aliased = |
| 1764 | normalized === "openai-compatible" || normalized === "openai_compatible" |
| 1765 | ? "openai-compat" |
| 1766 | : normalized; |
| 1767 | const providerType = AIProviderTypes.find( |
| 1768 | (candidate) => candidate === aliased, |
| 1769 | ); |
| 1770 | if (!providerType) { |
| 1771 | throw new Error(`Unsupported AI provider type "${provider}".`); |
| 1772 | } |
| 1773 | return providerType; |
| 1774 | }; |
| 1775 | |
| 1776 | export const createChatProviderConfig = (queryClient: QueryClient) => ({ |
| 1777 | mutationFn: (req: TypesGen.CreateChatProviderConfigRequest) => { |
no test coverage detected