From f70652305dbe41d8e9bcbe6287acc44ebd02110c Mon Sep 17 00:00:00 2001 From: TarekS93 <37110556+TarekS93@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:19:08 +0200 Subject: [PATCH] Update constants.ts --- app/utils/constants.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 6db860c5..bea5c82a 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -1,4 +1,4 @@ -import type { ModelInfo } from './types'; +import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types'; export const WORK_DIR_NAME = 'project'; export const WORK_DIR = `/home/${WORK_DIR_NAME}`; @@ -37,9 +37,9 @@ export let MODEL_LIST: ModelInfo[] = [...staticModels]; async function getOllamaModels(): Promise { try { const response = await fetch(`http://localhost:11434/api/tags`); - const data = await response.json(); + const data = await response.json() as OllamaApiResponse; - return data.models.map((model: any) => ({ + return data.models.map((model: OllamaModel) => ({ name: model.name, label: `${model.name} (${model.details.parameter_size})`, provider: 'Ollama',