- Implement `Content` model for converting Tiptap raw data into HTML and plain text. - Add `Model` for storing and managing AI model configurations with pricing and metadata. - Introduce `Story` model to handle verbal styles and linguistic properties for diverse narrative structures. - Update `book.repository.ts` to refine `updateBookBasicInformation` and `insertNewPlotPoint` methods, removing unused parameters and optimizing queries.
253 lines
7.0 KiB
TypeScript
253 lines
7.0 KiB
TypeScript
export type GPTModel = "gpt-4o-mini" | "gpt-4o-turbo" | "gpt-3.5-turbo" | "gpt-4o" | "gpt-4.1" | "gpt-4.1-nano";
|
|
export type AnthropicModel =
|
|
"claude-3-7-sonnet-20250219"
|
|
| "claude-sonnet-4-20250514"
|
|
| "claude-sonnet-4-5-20250929"
|
|
| "claude-3-5-haiku-20241022"
|
|
| "claude-3-5-sonnet-20241022"
|
|
| "claude-3-5-sonnet-20240620"
|
|
| "claude-3-opus-20240229";
|
|
export type GeminiModel =
|
|
| "gemini-2.0-flash-001"
|
|
| "gemini-2.0-flash-lite-001"
|
|
| "gemini-2.5-flash"
|
|
| "gemini-2.5-flash-lite"
|
|
| "gemini-2.5-pro";
|
|
|
|
export interface AIModelConfig {
|
|
model_id: string;
|
|
model_name: string;
|
|
brand: string;
|
|
price_token_in: number;
|
|
per_quantity_in: number;
|
|
price_token_out: number;
|
|
per_quantity_out: number;
|
|
}
|
|
|
|
export const AIModels: AIModelConfig[] = [
|
|
{
|
|
"model_id": "claude-3-5-haiku-20241022",
|
|
"model_name": "Claude Haiku 3.5",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 0.8,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 4,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-3-5-sonnet-20241022",
|
|
"model_name": "Claude Sonnet 3.5",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 3,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 15,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-3-7-sonnet-20250219",
|
|
"model_name": "Claude Sonnet 3.7",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 3,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 15,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-3-haiku-20240307",
|
|
"model_name": "Claude Haiku 3",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 0.25,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 1.25,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-3-opus-20240229",
|
|
"model_name": "Claude Opus 3",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 15,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 75,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-opus-4-20250514",
|
|
"model_name": "Claude Opus 4",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 15,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 75,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-sonnet-4-20250514",
|
|
"model_name": "Claude Sonnet 4",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 3,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 15,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "claude-sonnet-4-5-20250929",
|
|
"model_name": "Claude Sonnet 4.5",
|
|
"brand": "Anthropic",
|
|
"price_token_in": 3,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 15,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gemini-2.0-flash-001",
|
|
"model_name": "Gemini 2.0 Flash",
|
|
"brand": "Google",
|
|
"price_token_in": 0.1,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.4,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gemini-2.0-flash-lite-001",
|
|
"model_name": "Gemini 2.0 Flash-Lite",
|
|
"brand": "Google",
|
|
"price_token_in": 0.075,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.3,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gemini-2.5-flash",
|
|
"model_name": "Gemini 2.5 Flash",
|
|
"brand": "Google",
|
|
"price_token_in": 0.3,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 2.5,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gemini-2.5-flash-lite",
|
|
"model_name": "Gemini 2.5 Flash-Lite",
|
|
"brand": "Google",
|
|
"price_token_in": 0.1,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.4,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gemini-2.5-pro",
|
|
"model_name": "Gemini 2.5 Pro",
|
|
"brand": "Google",
|
|
"price_token_in": 1.25,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 10,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-3.5-turbo",
|
|
"model_name": "GPT-3.5 Turbo",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.5,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 1.5,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4",
|
|
"model_name": "GPT-4",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 30,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 60,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4-turbo",
|
|
"model_name": "GPT-4 Turbo",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 10,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 30,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4.1",
|
|
"model_name": "GPT-4.1",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 2,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 8,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4.1-mini",
|
|
"model_name": "GPT-4.1 Mini",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.4,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.6,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4.1-nano",
|
|
"model_name": "GPT-4.1 Nano",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.1,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.4,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4o",
|
|
"model_name": "GPT-4o",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 5,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 20,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4o-2024-11-20",
|
|
"model_name": "GPT-4o (2024-11-20)",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 5,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 15,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-4o-mini",
|
|
"model_name": "GPT-4o Mini",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.6,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 2.4,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-5",
|
|
"model_name": "GPT 5",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 1.25,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 10,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-5-mini",
|
|
"model_name": "GPT 5 Mini",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.25,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 2,
|
|
"per_quantity_out": 1000000
|
|
},
|
|
{
|
|
"model_id": "gpt-5-nano",
|
|
"model_name": "GPT 5 Nano",
|
|
"brand": "OpenAI",
|
|
"price_token_in": 0.05,
|
|
"per_quantity_in": 1000000,
|
|
"price_token_out": 0.4,
|
|
"per_quantity_out": 1000000
|
|
}
|
|
] |