export interface Conversation {
  id: string
  title: string
  modelId?: number
  isPinned: boolean
  messageCount?: number
  icon?: string
  iconColor?: string
  updatedAt?: string
}

export interface TokenUsage {
  inputTokens?: number
  outputTokens?: number
  totalTokens?: number
}

export interface ThinkingSegment {
  content: string
  thinkingTime?: number
}

export interface Message {
  id: string
  conversationId: string
  role: 'user' | 'assistant'
  content: string
  createdAt: string
  status?: 'streaming' | 'done' | 'error'
  thinkingContent?: string
  thinkingTime?: number
  thinkingSegments?: ThinkingSegment[]
  toolCalls?: ToolCall[]
  usage?: TokenUsage
  model?: string
  feedbackType?: number
  attachments?: string
}

export interface ToolCall {
  id: string
  name: string
  status: 'calling' | 'done' | 'error'
  arguments?: string
  result?: string
}

export interface ModelInfo {
  id: number
  code: string
  name: string
  provider?: string
  supportThinking?: boolean
  supportFunction?: boolean
  supportVision?: boolean
  supportAudio?: boolean
  supportImage?: boolean
  supportVideo?: boolean
  contextLength?: number
}

export interface Attachment {
  id: number
  name: string
  size: number
  type: 'pdf' | 'image' | 'file'
  previewUrl?: string
}

export interface UserSettings {
  theme: 'light' | 'dark' | 'system'
  language: string
  fontSize: number
  sendShortcut: 'Enter' | 'Ctrl+Enter'
  defaultModel: number
  defaultThinkingMode: number
  contextRounds: number
  nickname: string
  userBackground: string
  responseStyle: number
  systemPrompt: string
  mcpEnabled: boolean
  showToolCalls: boolean
  allowTraining: boolean
  enableLearning: boolean
  defaultSkill?: string
  contentWidth?: number
  thinkingCollapsed?: boolean
}


export interface ProviderItem {
  id: number
  name: string
  protocol: string
  endpoint?: string
  apiKeyMasked?: string
  enable: boolean
  sort: number
  remark?: string
  modelCount?: number
}

export interface ModelManageItem {
  id: number
  providerId: number
  code: string
  name: string
  enable: boolean
  sort: number
  contextLength: number
  supportThinking: boolean
  supportFunction: boolean
  supportVision: boolean
  supportAudio: boolean
  supportImage: boolean
  supportVideo: boolean
  remark?: string
}
