Response from AI analysis service containing a high-level summary and categorization
of document changes. This is returned when using NutrientViewer.AIComparisonOperationType.ANALYZE
.
Properties:
Name | Type | Description |
---|---|---|
summary |
string | AI-generated natural language summary describing the overall nature and scope of changes between the compared documents |
categories |
Array.<string> | Array of AI-detected change categories representing the types of modifications (e.g., "Formatting", "Content Addition", "Legal Changes", "Rewording") |
changes |
NutrientViewer.DocumentComparisonResult | The underlying standard document comparison result containing detailed text hunks and change operations |
Example
// After running an ANALYZE operation
if (NutrientViewer.isAIDocumentAnalysisResult(result)) {
console.log(`Summary: ${result.summary}`);
// Example: "The document has undergone significant legal revisions with updated terminology and new clauses."
console.log(`Categories: ${result.categories.join(', ')}`);
// Example: ["Legal Changes", "Terminology Updates", "Content Addition"]
// Access detailed changes
console.log(`Total changes: ${result.changes.changes.size}`);
}