( code: string, options: GenerateOptions )
| 63 | } |
| 64 | |
| 65 | export function isPredictionCompatible( |
| 66 | code: string, |
| 67 | options: GenerateOptions |
| 68 | ): boolean { |
| 69 | if (!options.avoidSimilarPrevious || !options.previousCode) return true |
| 70 | if (options.previousCode.length !== code.length) return true |
| 71 | |
| 72 | const prediction = predictCodeQuality(code, options) |
| 73 | |
| 74 | if (prediction.confusionScore > 0.5) return false |
| 75 | return true |
| 76 | } |
no test coverage detected