From 25490c4faf78e9b045a4027f4295e67f6112ff0c Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Sat, 21 Dec 2024 19:39:22 +0200 Subject: [PATCH] PR review fixes --- apps/web/utils/condition.ts | 7 ++++++- apps/web/utils/llms/config.ts | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/utils/condition.ts b/apps/web/utils/condition.ts index ae2e2e23..eaeab695 100644 --- a/apps/web/utils/condition.ts +++ b/apps/web/utils/condition.ts @@ -128,7 +128,7 @@ export function getEmptyConditions(): ZodCondition[] { } export function getEmptyCondition( - type: string, + type: RuleType, groupId?: string, ): ZodCondition { switch (type) { @@ -180,6 +180,11 @@ export const flattenConditions = ( acc.categoryFilterType = condition.categoryFilterType; acc.categoryFilters = condition.categoryFilters; break; + default: + console.log(`Unhandled condition type: ${condition.type}`); + // biome-ignore lint/correctness/noSwitchDeclarations: intentional exhaustive check + const exhaustiveCheck: never = condition.type; + return exhaustiveCheck; } return acc; }, {} as FlattenedConditions); diff --git a/apps/web/utils/llms/config.ts b/apps/web/utils/llms/config.ts index 4c584477..9ea69566 100644 --- a/apps/web/utils/llms/config.ts +++ b/apps/web/utils/llms/config.ts @@ -19,7 +19,9 @@ export const Model = { export const providerOptions: { label: string; value: string }[] = [ { label: "OpenAI", value: Provider.OPEN_AI }, { label: "Anthropic", value: Provider.ANTHROPIC }, - ...(supportsOllama ? [{ label: "Ollama", value: Provider.OLLAMA! }] : []), + ...(supportsOllama && Provider.OLLAMA + ? [{ label: "Ollama", value: Provider.OLLAMA }] + : []), ]; export const modelOptions: Record =