mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-22 19:06:12 +00:00
Update constants.ts
This commit is contained in:
parent
34ead80f62
commit
f70652305d
@ -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<ModelInfo[]> {
|
||||
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',
|
||||
|
Loading…
Reference in New Issue
Block a user