MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / getProvider

Function getProvider

packages/baseai/src/utils/to-old-pipe-format.ts:96–115  ·  view source on GitHub ↗

* Retrieves the provider based on the given provider string. * * @param providerString - The provider string. * @returns The corresponding provider object. * @throws Error if the provider is unknown.

(providerString: string)

Source from the content-addressed store, hash-verified

94 * @throws Error if the provider is unknown.
95 */
96function getProvider(providerString: string): Provider {
97 const providerMap: { [key: string]: Provider } = {
98 openai: OPEN_AI,
99 anthropic: ANTHROPIC,
100 together: TOGETHER_AI,
101 google: GOOGLE,
102 groq: GROQ,
103 cohere: COHERE,
104 fireworks: FIREWORKS_AI,
105 perplexity: PERPLEXITY,
106 ollama: OLLAMA,
107 xai: X_AI
108 };
109
110 const provider = providerMap[providerString.toLowerCase()];
111 if (!provider) {
112 throw new Error(`Unknown provider: ${providerString}`);
113 }
114 return provider;
115}

Callers 1

toOldPipeFormatFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected