🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix: exhaustive check for lllm model provider (#1819)
Max Deichmann10c0b18ca03a
diff --git a/packages/shared/src/server/llm/fetchLLMCompletion.ts b/packages/shared/src/server/llm/fetchLLMCompletion.tsindex 234b0168f1..7936348f87 100644--- a/packages/shared/src/server/llm/fetchLLMCompletion.ts+++ b/packages/shared/src/server/llm/fetchLLMCompletion.ts@@ -77,7 +77,7 @@ export async function fetchLLMCompletion(topP: modelParams.top_p,callbacks,});- } else {+ } else if (modelParams.provider === ModelProvider.OpenAI) {chatModel = new ChatOpenAI({openAIApiKey: apiKey,modelName: modelParams.model,@@ -86,6 +86,10 @@ export async function fetchLLMCompletion(topP: modelParams.top_p,callbacks,});+ } else {+ // eslint-disable-next-line no-unused-vars+ const _exhaustiveCheck: never = modelParams;+ throw new Error("This model provider is not supported.");}console.log("Making LLM call with params: ", modelParams);