Table of Contents

Class ContentItemFieldsSourceAiProvenanceExtensions

Namespace
CMS.ContentEngine
Assembly
CMS.ContentEngine.dll

Extension methods for reading the AI provenance of a mapped content item's fields by field code name.

public static class ContentItemFieldsSourceAiProvenanceExtensions
Inheritance
object
ContentItemFieldsSourceAiProvenanceExtensions

Remarks

The provenance is populated only when the query opted in via WithAiProvenance() or WithAiProvenance(); otherwise every field reports None.

Methods

GetAiProvenanceOrigin(IContentItemFieldsSource, string)

Gets the AI provenance origin of the field with the given code name. Returns None when the field is not marked, or when the query did not opt in to AI provenance.

public static AiProvenanceOrigin GetAiProvenanceOrigin(this IContentItemFieldsSource source, string fieldCodeName)

Parameters

source IContentItemFieldsSource

Mapped content item model whose system fields carry the provenance.

fieldCodeName string

Code name of the field.

Returns

AiProvenanceOrigin

Exceptions

ArgumentNullException

Thrown when source is null.

ArgumentException

Thrown when fieldCodeName is null or empty.

IsAiGenerated(IContentItemFieldsSource, string)

Indicates whether the content of the field with the given code name was generated by AI (AiGenerated).

public static bool IsAiGenerated(this IContentItemFieldsSource source, string fieldCodeName)

Parameters

source IContentItemFieldsSource

Mapped content item model whose system fields carry the provenance.

fieldCodeName string

Code name of the field.

Returns

bool

Exceptions

ArgumentNullException

Thrown when source is null.

ArgumentException

Thrown when fieldCodeName is null or empty.

IsAiInvolved(IContentItemFieldsSource, string)

Indicates whether AI was involved in the content of the field with the given code name, that is its origin is AiGenerated or AiModified.

public static bool IsAiInvolved(this IContentItemFieldsSource source, string fieldCodeName)

Parameters

source IContentItemFieldsSource

Mapped content item model whose system fields carry the provenance.

fieldCodeName string

Code name of the field.

Returns

bool

Exceptions

ArgumentNullException

Thrown when source is null.

ArgumentException

Thrown when fieldCodeName is null or empty.

IsAiModified(IContentItemFieldsSource, string)

Indicates whether the content of the field with the given code name was modified by AI (AiModified).

public static bool IsAiModified(this IContentItemFieldsSource source, string fieldCodeName)

Parameters

source IContentItemFieldsSource

Mapped content item model whose system fields carry the provenance.

fieldCodeName string

Code name of the field.

Returns

bool

Exceptions

ArgumentNullException

Thrown when source is null.

ArgumentException

Thrown when fieldCodeName is null or empty.