mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00

* update: Add type * fix: update import statement for NextApiRequest type * fix: update imports to use type for LexicalEditor and EditorState * Refactor imports to use 'import type' for type-only imports across multiple files - Updated imports in various components and API files to use 'import type' for better clarity and to optimize TypeScript's type checking. - Ensured consistent usage of type imports in files related to chat, dataset, workflow, and user management. - Improved code readability and maintainability by distinguishing between value and type imports. * refactor: remove old ESLint configuration and add new rules - Deleted the old ESLint configuration file from the app project. - Added a new ESLint configuration file with updated rules and settings. - Changed imports to use type-only imports in various files for better clarity and performance. - Updated TypeScript configuration to remove unnecessary options. - Added an ESLint ignore file to exclude build and dependency directories from linting. * fix: update imports to use 'import type' for type-only imports in schema files
90 lines
2.4 KiB
TypeScript
90 lines
2.4 KiB
TypeScript
import type { ModelTypeEnum } from './model';
|
|
import type { ModelProviderIdType } from './provider';
|
|
|
|
type PriceType = {
|
|
charsPointsPrice?: number; // 1k chars=n points; 60s=n points;
|
|
|
|
// If inputPrice is set, the input-output charging scheme is adopted
|
|
inputPrice?: number; // 1k tokens=n points
|
|
outputPrice?: number; // 1k tokens=n points
|
|
};
|
|
type BaseModelItemType = {
|
|
provider: ModelProviderIdType;
|
|
model: string;
|
|
name: string;
|
|
avatar?: string; // model icon, from provider
|
|
|
|
isActive?: boolean;
|
|
isCustom?: boolean;
|
|
isDefault?: boolean;
|
|
isDefaultDatasetTextModel?: boolean;
|
|
isDefaultDatasetImageModel?: boolean;
|
|
|
|
// If has requestUrl, it will request the model directly
|
|
requestUrl?: string;
|
|
requestAuth?: string;
|
|
};
|
|
|
|
export type LLMModelItemType = PriceType &
|
|
BaseModelItemType & {
|
|
type: ModelTypeEnum.llm;
|
|
// Model params
|
|
maxContext: number;
|
|
maxResponse: number;
|
|
quoteMaxToken: number;
|
|
maxTemperature?: number;
|
|
|
|
showTopP?: boolean;
|
|
responseFormatList?: string[];
|
|
showStopSign?: boolean;
|
|
|
|
censor?: boolean;
|
|
vision?: boolean;
|
|
reasoning?: boolean;
|
|
|
|
// diff function model
|
|
datasetProcess?: boolean; // dataset
|
|
usedInClassify?: boolean; // classify
|
|
usedInExtractFields?: boolean; // extract fields
|
|
usedInToolCall?: boolean; // tool call
|
|
|
|
functionCall: boolean;
|
|
toolChoice: boolean;
|
|
|
|
customCQPrompt: string;
|
|
customExtractPrompt: string;
|
|
|
|
defaultSystemChatPrompt?: string;
|
|
defaultConfig?: Record<string, any>;
|
|
fieldMap?: Record<string, string>;
|
|
};
|
|
|
|
export type EmbeddingModelItemType = PriceType &
|
|
BaseModelItemType & {
|
|
type: ModelTypeEnum.embedding;
|
|
defaultToken: number; // split text default token
|
|
maxToken: number; // model max token
|
|
weight: number; // training weight
|
|
hidden?: boolean; // Disallow creation
|
|
normalization?: boolean; // normalization processing
|
|
defaultConfig?: Record<string, any>; // post request config
|
|
dbConfig?: Record<string, any>; // Custom parameters for storage
|
|
queryConfig?: Record<string, any>; // Custom parameters for query
|
|
};
|
|
|
|
export type RerankModelItemType = PriceType &
|
|
BaseModelItemType & {
|
|
type: ModelTypeEnum.rerank;
|
|
};
|
|
|
|
export type TTSModelType = PriceType &
|
|
BaseModelItemType & {
|
|
type: ModelTypeEnum.tts;
|
|
voices: { label: string; value: string }[];
|
|
};
|
|
|
|
export type STTModelType = PriceType &
|
|
BaseModelItemType & {
|
|
type: ModelTypeEnum.stt;
|
|
};
|