Documentation - v1.2.0-alpha.3
    Preparing search index...
    • Adds an AI entity to an activity to indicate that the content was generated by AI.

      Parameters

      • activity: Activity

        The activity to which the AI entity will be added. The activity's entities array will be initialized if it doesn't exist.

      • Optionalcitations: ClientCitation[]

        Optional array of client citations to include with the AI-generated content. Citations provide references to sources used in generating the content and are displayed in Teams.

      • OptionalusageInfo: SensitivityUsageInfo

        Optional sensitivity usage information that provides context about the content's sensitivity level. This helps users understand any special handling requirements for the content.

      Returns void

      This function enhances the activity with metadata that helps clients (like Microsoft Teams) understand that the content is AI-generated and optionally includes citations and sensitivity information.

      import { Activity } from '../activity';
      import { addAIToActivity, ClientCitation } from './AIEntity';

      const activity: Activity = {
      type: 'message',
      text: 'Based on the documents, here are the key findings...'
      };

      const citations: ClientCitation[] = [{
      '@type': 'Claim',
      position: 1,
      appearance: {
      '@type': 'DigitalDocument',
      name: 'Research Report 2024',
      abstract: 'Key findings from the annual research report',
      url: 'https://example.com/report.pdf',
      image: {
      '@type': 'ImageObject',
      name: 'PDF'
      }
      }
      }];

      // Add AI entity with citations
      addAIToActivity(activity, citations);