mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-06 04:48:04 +00:00
More type fixes
This commit is contained in:
parent
b0754e546b
commit
df91d0edc0
@ -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' },
|
||||
|
@ -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',
|
||||
|
@ -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) {
|
||||
|
10
app/types/model.ts
Normal file
10
app/types/model.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import type { ModelInfo } from '~/utils/types';
|
||||
|
||||
export type ProviderInfo = {
|
||||
staticModels: ModelInfo[],
|
||||
name: string,
|
||||
getDynamicModels?: () => Promise<ModelInfo[]>,
|
||||
getApiKeyLink?: string,
|
||||
labelForGetApiKey?: string,
|
||||
icon?:string,
|
||||
};
|
@ -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<ModelInfo[]>,
|
||||
getApiKeyLink?: string,
|
||||
labelForGetApiKey?: string,
|
||||
icon?:string,
|
||||
};
|
||||
|
||||
const PROVIDER_LIST: ProviderInfo[] = [
|
||||
{
|
||||
name: 'Anthropic',
|
||||
|
@ -26,3 +26,12 @@ export interface ModelInfo {
|
||||
label: string;
|
||||
provider: string;
|
||||
}
|
||||
|
||||
export interface ProviderInfo {
|
||||
staticModels: ModelInfo[],
|
||||
name: string,
|
||||
getDynamicModels?: () => Promise<ModelInfo[]>,
|
||||
getApiKeyLink?: string,
|
||||
labelForGetApiKey?: string,
|
||||
icon?:string,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user