// server/src/types.ts

export enum ModelType {
  LLM = 'llm',
  EMBEDDING = 'embedding',
  RERANK = 'rerank',
  VISION = 'vision',
}

// 1. Model Definition (The "Provider" setup)
export interface ModelConfig {
  id: string;
  name: string; // Display name, e.g. "My DeepSeek"
  modelId: string; // The actual string ID sent to API, e.g., "deepseek-chat"
  baseUrl?: string; // Base URL for OpenAI compatible API
  apiKey?: string; // API key for the service
  type: ModelType;
  dimensions?: number;
  supportsVision?: boolean;
  maxInputTokens?: number;
  maxBatchSize?: number;
  isVectorModel?: boolean;
  providerName?: string;
  isEnabled?: boolean;
  isDefault?: boolean;
}

// 2. Application Logic Settings (The "App" setup)
export interface AppSettings {
  // References to ModelConfig IDs
  selectedLLMId: string;
  selectedEmbeddingId: string; // Default for new uploads, and used for query encoding
  selectedRerankId: string;

  // Model Hyperparameters
  temperature: number;
  maxTokens: number;

  // Retrieval
  enableRerank: boolean;
  topK: number;
  similarityThreshold: number;
  rerankSimilarityThreshold: number;
  enableFullTextSearch: boolean;
  hybridVectorWeight: number;

  // Search Enhancement
  enableQueryExpansion: boolean;
  enableHyDE: boolean;

  chunkSize: number;
  chunkOverlap: number;

  // Language
  language: string;
}
