// Chunk configuration service - Used to fetch and validate chunk configuration limits

export interface ChunkConfigLimits {
  maxChunkSize: number;        // Max chunk size (tokens)
  maxOverlapSize: number;      // Max overlap size (tokens)
  minOverlapSize: number;      // Min overlap size (tokens)
  defaultChunkSize: number;    // Default chunk size
  defaultOverlapSize: number;  // Default overlap size
  modelInfo: EmbeddingModelLimit; // Model info
}

export interface EmbeddingModelLimit {
  name: string;              // Model name
  maxInputTokens: number;    // Model input limit
  maxBatchSize: number;      // Model batch limit
  expectedDimensions: number; // Expected vector dimensions
}

export const chunkConfigService = {
  
  formatLimits(limits: ChunkConfigLimits): string {
    return [
      `Model: ${limits.modelInfo.name}`,
      `Max Chunk: ${limits.maxChunkSize} tokens`,
      `Max Overlap: ${limits.maxOverlapSize} tokens`,
      `Batch Limit: ${limits.modelInfo.maxBatchSize}`,
      `Vector Dimensions: ${limits.modelInfo.expectedDimensions}`,
    ].join(' | ');
  },
};
