Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelien-sudre committed Nov 2, 2024
1 parent a5ab7d2 commit 47a6208
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
15 changes: 3 additions & 12 deletions app/lib/.server/llm/model.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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);

Expand Down Expand Up @@ -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`;
Expand Down
2 changes: 2 additions & 0 deletions app/lib/stores/workbench.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 0 additions & 2 deletions app/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -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}`;
Expand Down Expand Up @@ -65,7 +64,6 @@ async function getOllamaModels(): Promise<ModelInfo[]> {
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})`,
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 47a6208

Please sign in to comment.