MCPcopy Index your code
hub / github.com/coder/coder / normalizeAIProviderType

Function normalizeAIProviderType

site/src/api/queries/chats.ts:1761–1774  ·  view source on GitHub ↗
(provider: string)

Source from the content-addressed store, hash-verified

1759};
1760
1761const 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
1776export const createChatProviderConfig = (queryClient: QueryClient) => ({
1777 mutationFn: (req: TypesGen.CreateChatProviderConfigRequest) => {

Callers 1

createChatProviderConfigFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected