DiffStrategy.ts 758 B

12345678910111213141516
  1. import type { DiffStrategy } from './types'
  2. import { UnifiedDiffStrategy } from './strategies/unified'
  3. import { SearchReplaceDiffStrategy } from './strategies/search-replace'
  4. /**
  5. * Get the appropriate diff strategy for the given model
  6. * @param model The name of the model being used (e.g., 'gpt-4', 'claude-3-opus')
  7. * @returns The appropriate diff strategy for the model
  8. */
  9. export function getDiffStrategy(model: string): DiffStrategy {
  10. // For now, return SearchReplaceDiffStrategy for all models (with a fuzzy threshold of 0.9)
  11. // This architecture allows for future optimizations based on model capabilities
  12. return new SearchReplaceDiffStrategy(0.9)
  13. }
  14. export type { DiffStrategy }
  15. export { UnifiedDiffStrategy, SearchReplaceDiffStrategy }