Share via

How to configure custom AI labels in bot turn context activity entity

lakshmi 821 Reputation points
2024-07-18T18:16:00.3566667+00:00

Hi Team,

We have referred the MS document for adding AI label in turn context activity, https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage

var aiGeneratedContent = new JObject
{
    { "type", "https://schema.org/Message" },
    { "@type", "Message" },
    { "@context", "https://schema.org" },
    { "additionalType", new JArray("AIGeneratedContent") }, 
};  

var entity = new Entity { Properties = aiGeneratedContent };
var messageActivity = MessageFactory.Text(openAiResponse); 
messageActivity.Entities.Add(entity);
await stepContext.Context.SendActivityAsync(messageActivity, cancellationToken);

We were able to get the AI label in the bot as below

User's image

Is it possible to customize the message 'AI-generated content may be incorrect'. We wanted to make the message to be configurable so that we can change if its needed.

We tried to add the below property in the entity to just check whether it will update the ai label message but it didnt worked,

"customGeneratedBy", "This answer is generated by AI" }

Is that possible using ai label entity feature

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs


1 answer

Sort by: Most helpful
  1. Prasad-MSFT 10,391 Reputation points Microsoft External Staff Moderator
    2024-07-30T10:30:06.82+00:00

    Currently it is not possible to customize the AI label added to your bot message which specifies that the message is generated by AI.

    To achieve your requirements, we recommend you give your feedback in Teams Feedback Portal.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.