From 47a620847e0a764d306b9cef88585e589ee3b8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Sudre?= Date: Sat, 2 Nov 2024 16:32:47 +0100 Subject: [PATCH] Fix merge --- app/lib/.server/llm/model.ts | 15 +++------------ app/lib/stores/workbench.ts | 2 ++ app/utils/constants.ts | 2 -- package.json | 3 --- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/app/lib/.server/llm/model.ts b/app/lib/.server/llm/model.ts index 3b88872fa..1e364f158 100644 --- a/app/lib/.server/llm/model.ts +++ b/app/lib/.server/llm/model.ts @@ -1,13 +1,11 @@ // @ts-nocheck // Preventing TS checks with files presented in the video for a better presentation. import { getAPIKey, getBaseURL } from '~/lib/.server/llm/api-key'; -import { getAPIKey, getBaseURL } from '~/lib/.server/llm/api-key'; import { createAnthropic } from '@ai-sdk/anthropic'; import { createOpenAI } from '@ai-sdk/openai'; import { createGoogleGenerativeAI } from '@ai-sdk/google'; import { ollama } from 'ollama-ai-provider'; import { createOpenRouter } from '@openrouter/ai-sdk-provider'; -import { mistral } from '@ai-sdk/mistral'; import { createMistral } from '@ai-sdk/mistral'; export function getAnthropicModel(apiKey: string, model: string) { @@ -17,6 +15,7 @@ export function getAnthropicModel(apiKey: string, model: string) { return anthropic(model); } + export function getOpenAILikeModel(baseURL: string, apiKey: string, model: string) { const openai = createOpenAI({ baseURL, @@ -25,8 +24,7 @@ export function getOpenAILikeModel(baseURL: string, apiKey: string, model: strin return openai(model); } - return openai(model); -} + export function getOpenAIModel(apiKey: string, model: string) { const openai = createOpenAI({ apiKey, @@ -35,14 +33,6 @@ export function getOpenAIModel(apiKey: string, model: string) { return openai(model); } -export function getMistralModel(apiKey: string, model: string) { - const mistral = createMistral({ - apiKey - }); - - return mistral(model); -} - export function getGoogleModel(apiKey: string, model: string) { const google = createGoogleGenerativeAI(apiKey); @@ -72,6 +62,7 @@ export function getDeepseekModel(apiKey: string, model: string) { return openai(model); } + export function getOllamaModel(baseURL: string, model: string) { let Ollama = ollama(model); Ollama.config.baseURL = `${baseURL}/api`; diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index 43bfeb6bd..99c5686d8 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -1,3 +1,5 @@ +// @ts-nocheck + import { atom, map, type MapStore, type ReadableAtom, type WritableAtom } from 'nanostores'; import type { EditorDocument, ScrollPosition } from '~/components/editor/codemirror/CodeMirrorEditor'; import { ActionRunner } from '~/lib/runtime/action-runner'; diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 4c7c278ad..25900d6db 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -1,5 +1,4 @@ import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types'; -import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types'; export const WORK_DIR_NAME = 'project'; export const WORK_DIR = `/home/${WORK_DIR_NAME}`; @@ -65,7 +64,6 @@ async function getOllamaModels(): Promise { const response = await fetch(`${url}api/tags`); const data = (await response.json()) as OllamaApiResponse; - return data.models.map((model: OllamaModel) => ({ return data.models.map((model: OllamaModel) => ({ name: model.name, label: `${model.name} (${model.details.parameter_size})`, diff --git a/package.json b/package.json index 79ab6e9bf..70d6d877f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@ai-sdk/google": "^0.0.52", "@ai-sdk/mistral": "^0.0.44", "@ai-sdk/openai": "^0.0.66", - "@ai-sdk/mistral": "^0.0.43", "@codemirror/autocomplete": "^6.17.0", "@codemirror/commands": "^6.6.0", "@codemirror/lang-cpp": "^6.0.2", @@ -53,8 +52,6 @@ "@nanostores/react": "^0.7.2", "@octokit/rest": "^21.0.2", "@octokit/types": "^13.6.1", - "@octokit/rest": "^21.0.2", - "@octokit/types": "^13.6.1", "@openrouter/ai-sdk-provider": "^0.0.5", "@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1",