diff --git a/src/data/mock.ts b/src/data/mock.ts new file mode 100644 index 0000000..b7da85a --- /dev/null +++ b/src/data/mock.ts @@ -0,0 +1,82 @@ +import type { Model, Tool, ChatHistory, Message, User, QuickAction } from '@/types'; + +// 模型列表 +export const models: Model[] = [ + { id: 'haiku', name: 'Haiku 4.5', tag: 'Fast' }, + { id: 'sonnet', name: 'Sonnet 4.5', tag: 'Balanced' }, + { id: 'opus', name: 'Opus 4.5', tag: 'Powerful' }, +]; + +// 工具列表 +export const tools: Tool[] = [ + { id: 'web-search', name: 'Web Search', icon: 'Search', enabled: true }, + { id: 'code-execution', name: 'Code Execution', icon: 'Terminal', enabled: false }, + { id: 'web-fetch', name: 'Web Fetch', icon: 'Globe', enabled: true }, +]; + +// 聊天历史 +export const chatHistories: ChatHistory[] = [ + { id: '1', title: '你好', createdAt: new Date(), updatedAt: new Date() }, + { id: '2', title: 'React组件开发', createdAt: new Date(), updatedAt: new Date() }, + { id: '3', title: 'TypeScript类型问题', createdAt: new Date(), updatedAt: new Date() }, +]; + +// 示例消息 +export const sampleMessages: Message[] = [ + { + id: '1', + role: 'user', + content: '你的模型id', + timestamp: new Date(), + }, + { + id: '2', + role: 'assistant', + content: `我是 **Claude 4.5 Sonnet**,由 Anthropic 制作。 + +不过需要说明的是,我目前运行在 cchcode (openclaude.me) 这个平台上,而不是 Anthropic 的官方平台。具体的模型 ID(如 API 调用时使用的标识符)可能是: + +- \`claude-4.5-sonnet\`(如果这是实际的模型版本) +- 或类似的标识符 + +但我需要诚实地说:根据我的知识(截至 2024 年底),Anthropic 官方发布的最新版本是 **Claude 3.5 Sonnet**(模型 ID 通常是 \`claude-3-5-sonnet-20241022\` 或类似格式)。"Claude 4.5 Sonnet" 这个名称可能是: + +1. cchcode 平台的内部命名 +2. 我被告知的身份信息 +3. 或者是在我知识截止日期之后发布的新版本 + +如果你想确认具体使用的是哪个模型版本,建议查看 cchcode 平台的设置或文档说明。你想了解这个信息是为了什么目的呢?也许我可以帮你解决实际问题。`, + timestamp: new Date(), + }, +]; + +// 当前用户 +export const currentUser: User = { + id: '1', + email: 'cisyamgao@gmail.com', + name: 'cisyamgao', + plan: 'free', +}; + +// 快捷操作 +export const quickActions: QuickAction[] = [ + { id: 'code', label: 'Code', icon: 'Code', prompt: '帮我写一段代码...' }, + { id: 'write', label: 'Write', icon: 'PenTool', prompt: '帮我写一篇...' }, + { id: 'learn', label: 'Learn', icon: 'GraduationCap', prompt: '帮我学习...' }, + { id: 'life', label: 'Life stuff', icon: 'Home', prompt: '帮我处理生活中的事情...' }, + { id: 'surprise', label: 'Surprise me', icon: 'Sparkles', prompt: '给我一些惊喜...' }, +]; + +// 获取问候语 +export function getGreeting(name: string): string { + const hour = new Date().getHours(); + let greeting = 'Good morning'; + + if (hour >= 12 && hour < 18) { + greeting = 'Good afternoon'; + } else if (hour >= 18) { + greeting = 'Good evening'; + } + + return `${greeting}, ${name}`; +}