import type { StructuredProcessOptions, UnstructuredProcessOptions } from './types'

export const DEFAULT_GENERATION_PROMPT = '你是一名专业的数据生成助手。请根据输入内容生成准确、完整、可直接用于模型训练的问答数据。仅输出符合目标格式的内容，答案应事实清晰、语言自然，不要添加分析过程、说明或无关内容。'

export function createDefaultStructuredOptions(): StructuredProcessOptions {
  return {
    preprocessOptions: ['clean_invalid', 'detect_structure', 'deduplicate', 'normalize_format'],
    semanticEnrichment: false,
    qaPairsPerRow: 1,
    datasetSplit: { train: 80, validation: 10, test: 10 },
    generationModelId: '',
    generationPrompt: DEFAULT_GENERATION_PROMPT,
    temperature: 0.7,
    maxTokens: 1024,
    jsonMode: false,
    qualityFilterEnabled: false,
    filterLowQuality: true,
    filterShortContent: true,
    minOutputLength: 20,
  }
}

export function createDefaultUnstructuredOptions(): UnstructuredProcessOptions {
  return {
    preprocessOptions: [
      'clean_invalid_content',
      'detect_document_structure',
      'merge_short_content',
      'filter_low_quality',
      'deduplicate_content',
      'preserve_context',
    ],
    chunkMethod: 'semantic',
    chunkSize: 800,
    chunkOverlap: 100,
    minChunkSize: 100,
    customDelimiter: '',
    preserveTables: true,
    preserveCodeBlocks: true,
    preserveLists: true,
    semanticEnrichment: false,
    qaPairsPerChunk: 1,
    datasetSplit: { train: 80, validation: 10, test: 10 },
    generationModelId: '',
    generationPrompt: DEFAULT_GENERATION_PROMPT,
    temperature: 0.7,
    maxTokens: 1024,
    jsonMode: false,
    qualityFilterEnabled: false,
    filterLowQuality: true,
    filterShortContent: true,
    minOutputLength: 20,
  }
}
