diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 9a34f5bf2..80183bafd 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -7,7 +7,7 @@ import { Menu } from '~/components/sidebar/Menu.client'; import { IconButton } from '~/components/ui/IconButton'; import { Workbench } from '~/components/workbench/Workbench.client'; import { classNames } from '~/utils/classNames'; -import { MODEL_LIST, DEFAULT_PROVIDER, PROVIDER_LIST, ProviderInfo, initializeModelList } from '~/utils/constants'; +import { MODEL_LIST, DEFAULT_PROVIDER, PROVIDER_LIST, initializeModelList } from '~/utils/constants'; import { Messages } from './Messages.client'; import { SendButton } from './SendButton.client'; import { useState } from 'react'; @@ -15,6 +15,7 @@ import { APIKeyManager } from './APIKeyManager'; import Cookies from 'js-cookie'; import styles from './BaseChat.module.scss'; +import type { ProviderInfo } from '~/utils/types'; const EXAMPLE_PROMPTS = [ { text: 'Build a todo app in React using Tailwind' }, diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index 2407e86a4..31748b3c2 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -11,11 +11,12 @@ import { useChatHistory } from '~/lib/persistence'; import { chatStore } from '~/lib/stores/chat'; import { workbenchStore } from '~/lib/stores/workbench'; import { fileModificationsToHTML } from '~/utils/diff'; -import { DEFAULT_MODEL, DEFAULT_PROVIDER, PROVIDER_LIST, ProviderInfo } from '~/utils/constants'; +import { DEFAULT_MODEL, DEFAULT_PROVIDER, PROVIDER_LIST } from '~/utils/constants'; import { cubicEasingFn } from '~/utils/easings'; import { createScopedLogger, renderLogger } from '~/utils/logger'; import { BaseChat } from './BaseChat'; import Cookies from 'js-cookie'; +import type { ProviderInfo } from '~/utils/types'; const toastAnimation = cssTransition({ enter: 'animated fadeInRight', diff --git a/app/lib/.server/llm/model.ts b/app/lib/.server/llm/model.ts index 13f3555e9..6be9d1170 100644 --- a/app/lib/.server/llm/model.ts +++ b/app/lib/.server/llm/model.ts @@ -6,7 +6,6 @@ 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) { diff --git a/app/types/model.ts b/app/types/model.ts new file mode 100644 index 000000000..12b6929c5 --- /dev/null +++ b/app/types/model.ts @@ -0,0 +1,10 @@ +import type { ModelInfo } from '~/utils/types'; + +export type ProviderInfo = { + staticModels: ModelInfo[], + name: string, + getDynamicModels?: () => Promise, + getApiKeyLink?: string, + labelForGetApiKey?: string, + icon?:string, +}; diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 75c8d0069..2aca237e4 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -1,4 +1,4 @@ -import type { ModelInfo, OllamaApiResponse, OllamaModel } from './types'; +import type { ModelInfo, OllamaApiResponse, OllamaModel, ProviderInfo } from './types'; export const WORK_DIR_NAME = 'project'; export const WORK_DIR = `/home/${WORK_DIR_NAME}`; @@ -7,16 +7,6 @@ export const MODEL_REGEX = /^\[Model: (.*?)\]\n\n/; export const PROVIDER_REGEX = /\[Provider: (.*?)\]\n\n/; export const DEFAULT_MODEL = 'claude-3-5-sonnet-latest'; - -export type ProviderInfo = { - staticModels: ModelInfo[], - name: string, - getDynamicModels?: () => Promise, - getApiKeyLink?: string, - labelForGetApiKey?: string, - icon?:string, -}; - const PROVIDER_LIST: ProviderInfo[] = [ { name: 'Anthropic', diff --git a/app/utils/types.ts b/app/utils/types.ts index 5fcd2de25..a5f9fc18b 100644 --- a/app/utils/types.ts +++ b/app/utils/types.ts @@ -26,3 +26,12 @@ export interface ModelInfo { label: string; provider: string; } + +export interface ProviderInfo { + staticModels: ModelInfo[], + name: string, + getDynamicModels?: () => Promise, + getApiKeyLink?: string, + labelForGetApiKey?: string, + icon?:string, +};