From cd745856cac962259200e76909cb7170a7377202 Mon Sep 17 00:00:00 2001 From: punitda Date: Sun, 3 Nov 2024 15:38:09 +0530 Subject: [PATCH] Add azure to list of model in ModelSelector --- src/components/chat-interface/model-selector.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/chat-interface/model-selector.tsx b/src/components/chat-interface/model-selector.tsx index c5656948..aed03093 100644 --- a/src/components/chat-interface/model-selector.tsx +++ b/src/components/chat-interface/model-selector.tsx @@ -17,6 +17,7 @@ import { FIREWORKS_MODELS, GEMINI_MODELS, LS_HAS_SEEN_MODEL_DROPDOWN_ALERT, + AZURE_MODELS, } from "@/constants"; import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; @@ -29,6 +30,7 @@ const allModels = [ ...OPENAI_MODELS, ...FIREWORKS_MODELS, ...GEMINI_MODELS, + ...AZURE_MODELS, ]; const modelNameToLabel = (modelName: ALL_MODEL_NAMES) => { @@ -176,6 +178,12 @@ export default function ModelSelector(props: ModelSelectorProps) { ) { return false; } + if ( + model.name.includes("azure") && + process.env.NEXT_PUBLIC_AZURE_ENABLED === "false" + ) { + return false; + } if ( model.name.includes("gemini-") && process.env.NEXT_PUBLIC_GEMINI_ENABLED === "false"