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
-
objectContentItemFieldsSourceAiProvenanceExtensions
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
sourceIContentItemFieldsSourceMapped content item model whose system fields carry the provenance.
fieldCodeNamestringCode name of the field.
Returns
Exceptions
- ArgumentNullException
Thrown when
sourceis null.- ArgumentException
Thrown when
fieldCodeNameis 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
sourceIContentItemFieldsSourceMapped content item model whose system fields carry the provenance.
fieldCodeNamestringCode name of the field.
Returns
- bool
Exceptions
- ArgumentNullException
Thrown when
sourceis null.- ArgumentException
Thrown when
fieldCodeNameis 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
sourceIContentItemFieldsSourceMapped content item model whose system fields carry the provenance.
fieldCodeNamestringCode name of the field.
Returns
- bool
Exceptions
- ArgumentNullException
Thrown when
sourceis null.- ArgumentException
Thrown when
fieldCodeNameis 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
sourceIContentItemFieldsSourceMapped content item model whose system fields carry the provenance.
fieldCodeNamestringCode name of the field.
Returns
- bool
Exceptions
- ArgumentNullException
Thrown when
sourceis null.- ArgumentException
Thrown when
fieldCodeNameis null or empty.