Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AI Citations and Feedback Buttons #1479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 31 additions & 27 deletions samples/bot-conversation/nodejs/bots/teamsConversationBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,35 +211,39 @@ class TeamsConversationBot extends TeamsActivityHandler {
async addCitations(turnContext) {
await turnContext.sendActivity({
type: ActivityTypes.Message,
text: `Hey I'm a friendly AI bot. This message is an example for Citaion - [1]`, // cite with [1]
text: `Hey I'm a friendly AI bot. This message is generated through AI [1]`, // cite with [1],
entities: [
{
type: "https://schema.org/Message",
"@type": "Message",
"@context": "https://schema.org",
"@id": "",
citation: [
{
"@type": "Claim",
position: 1, // Required. Should match the [1] in the text above
appearance: {
"@type": "DigitalDocument",
name: "Some secret citation", // Title
url: "https://example.com/claim-1", // Hyperlink on the title
abstract: "Excerpt", // Excerpt (abstract)
encodingFormat: "docx",
keywords: ["Keyword1 - 1", "Keyword1 - 2", "Keyword1 - 3"], // Keywords
usageInfo: {
"@type": "CreativeWork",
name: "Confidential \\ Contoso FTE", // Sensitivity title
description: "Only accessible to Contoso FTE", // Sensitivity description
},
},
},
],
{
type: "https://schema.org/Message",
"@type": "Message",
"@context": "https://schema.org",
citation: [
{
"@type": "Claim",
position: 1, // Required. Must match the [1] in the text above
appearance: {
"@type": "DigitalDocument",
name: "AI bot", // Title
url: "https://example.com/claim-1", // Hyperlink on the title
abstract: "Excerpt description", // Appears in the citation pop-up window
text: "{\"type\":\"AdaptiveCard\",\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"version\":\"1.6\",\"body\":[{\"type\":\"TextBlock\",\"text\":\"Adaptive Card text\"}]}", // Appears as a stringified Adaptive Card
keywords: ["keyword 1", "keyword 2", "keyword 3"], // Appears in the citation pop-up window
encodingFormat: "application/vnd.microsoft.card.adaptive",
usageInfo: {
"@type": "CreativeWork",
name: "Confidential \\ Contoso FTE", // Sensitivity title
description: "Only accessible to Contoso FTE", // Sensitivity description
},
image: {
"@type": "ImageObject",
name: "Microsoft Word"
},
},
},
],
});
],
},
],
})
}

// Checks the count of members who have read the message sent by MessageAllMembers command.
Expand Down