AI-102 Exam QuestionsBrowse all questions from this exam

AI-102 Exam - Question 233


HOTSPOT -

You are building a chatbot for a Microsoft Teams channel by using the Microsoft Bot Framework SDK. The chatbot will use the following code.

Exam AI-102 Question 233

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NOTE: Each correct selection is worth one point.

Hot Area:

Exam AI-102 Question 233
Show Answer
Correct Answer:
Exam AI-102 Question 233

Discussion

17 comments
Sign in to comment
guruaws2021
Aug 24, 2021

2nd one should ne no, when a new member will join the chatbot will only great the new member and not all existing member in the chat

Viktur
Sep 1, 2021

I feel the answer is correct. The members are all in a "group". So when a new member is added, the old members will see the chatbot greet the new member ("Hello ${new.member}), and not every other existing members.

Labani1987
Jul 28, 2024

It will greet the only new user who is added, but other users will be able to see that greeting ( someone new is added, this feature is sometimes used to welcome a new member in a group chat or Teams channel )

rdemontis
Nov 7, 2023

Agree with you. "In the context of the OnMembersAddedAsync method, the membersAdded list contains information about the members who have just been added to a conversation. Here's how this iteration process works: Method Parameters: membersAdded: This is a list of ChannelAccount objects, each of which represents a member who has just been added to the conversation. ChannelAccount objects contain information about the member, such as their Id, Name, Role, and so on. turnContext: The current context of the conversation and activity. cancellationToken: A cancellation token, which can be used to cancel the request if necessary. Iterating through Added Members: The code block starts with an iteration through the membersAdded list. This iteration is performed using a foreach loop. For each member in the list, the code within the loop will be executed." (ChatGPT)

rdemontis
Nov 7, 2023

if you look the code you can see that the method sends a Welcome message for each member added: "Hi there - {member.Name}". It would be very strange to give a welcome message to everyone in the chat, even member already joined, every time a new one is added. So I think ChatGPT is right and the second answer is wrong. It should be "NO". Here another similar example: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events?tabs=dotnet#members-added

rdemontis
Nov 7, 2023

if you look the code you can see that the method sends a Welcome message for each member added: "Hi there - {member.Name}". It would be very strange to give a welcome message to everyone in the chat, even member already joined, every time a new one is added. So I think ChatGPT is right and the second answer is wrong. It should be "NO". Here another similar example: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/subscribe-to-conversation-events?tabs=dotnet#members-added

Labani1987
Jul 28, 2024

It will greet the only new user who is added, but other users will be able to see that greeting ( someone new is added, this feature is sometimes used to welcome a new member in a group chat or Teams channel )

Happiman
Dec 31, 2024

OnMembersAddedAsync will be triggered when a user joins the conversation. Answer: Yes The OnMembersAddedAsync method is specifically triggered when a new member is added to the conversation in a Microsoft Teams channel. This is indicated by the membersAdded parameter, which contains the list of newly added members. When a new user joins the conversation, the existing users in the conversation will see the chatbot greeting. Answer: No The code is written to send a welcome message only to the newly added user (member.Id != turnContext.Activity.Recipient.Id ensures this). Existing users will not see this greeting. OnMembersAddedAsync will be initialized when a user sends a message. Answer: No The OnMembersAddedAsync method is only triggered when a new member is added to the conversation. It is not triggered by regular messages sent by users.

reachmymind
Mar 2, 2022

A1. Yes https://docs.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.activityhandler.onmembersaddedasync?view=botbuilder-dotnet-stable ActivityHandler.OnMembersAddedAsync(IList<ChannelAccount>, ITurnContext<IConversationUpdateActivity>, CancellationToken) Method invoked when members other than the bot join the conversation A2. No https://docs.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.turncontext.sendactivityasync?view=botbuilder-dotnet-stable Sends a message activity to the sender of the incoming activity in turncontext A3: No https://docs.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.activityhandler.onconversationupdateactivityasync?view=botbuilder-dotnet-stable ActivityHandler.OnConversationUpdateActivityAsync(ITurnContext<IConversationUpdateActivity>, CancellationToken) Method invoked when a conversation update activity that indicates one or more users other than the bot are joining the conversation

ninjapunk
Dec 26, 2022

This is correct, as per the docs SendActivityAsync "sends an activity to the sender of the incoming activity", thus not a public message to be seen by everyone in the group.

TheB
Jul 4, 2021

The answer looks correct.

zellck
Jul 2, 2023

YYN is the answer. https://learn.microsoft.com/en-us/azure/bot-service/bot-activity-handler-concept?view=azure-bot-service-4.0&tabs=csharp#activity-handling - OnMembersAddedAsync Non-bot members joined the conversation

dimsok
Jan 7, 2024

YYN - for the second one, everyone will see that the bot said hi to a new user , the message sent by the bot is not private, its posted in the channel

Adedoyin_Simeon
Oct 28, 2021

The answer is correct.

AzureJobsTillRetire
Feb 20, 2023

The given answers are correct. On the second question:- The sender is the Microsoft Teams channel. "from" Identifies the sender of the message. example: from: ChannelAccount The recipients are the members According to the code, If new member <> existing member, then send out welcome message if (member.Id != turnContext.Activity.Recipient.Id)

saadashraf
Apr 6, 2023

Thanks, spent quite a time on this question. Your answer is absolutely correct

sl_mslconsulting
Oct 19, 2023

The answer to the second question is no. The membersAdded will have two guys : you and the bot. The OnMembersAddedAsync will only be triggered when non bot member joined the conversation which is you. The logic coded here will not send the welcome message to the bot which is also a existing user. You and the bot are both members. I think we are reading to much to this - it’s not a chat room where a new guy joined everyone will be notified.

sl_mslconsulting
Oct 19, 2023

You can actually write the code to verify this yourself and comment out the statement that check if a member is a bot to see what would happen.

idcanymore
Feb 8, 2024

Discord sends this exact message to people joining groups and everyone in the chat sees it. don't let chatgpt do your thinking for you.

nanaw770
Jun 1, 2024

Will this question still be asked on June 2, 2024?

Mattt
Mar 17, 2025

No, that's outside the scope of the exam.

takaimomoGcup
Jun 15, 2024

Yes No No

evangelist
Feb 4, 2024

given answer is NOT Correct! why: Enable Active Learning: LUIS's Active Learning feature automatically identifies vague or low-confidence user inputs that may require further training. Review and Add Utterances Logged for Review: Utterances collected through Active Learning are marked for review. Regularly reviewing and categorizing these utterances into the relevant intents is a crucial step in enhancing model performance. Train and Republish the Language Understanding Model: After adding new utterances and potentially adjusting intents and entities, you need to retrain the LUIS model to incorporate these updates.

PCRamirez
Feb 8, 2024

YNN: Asking Windows Copilot about second answer: No, the existing users in the conversation will not see the chatbot greeting. The code snippet provided shows a method `OnMembersAddedAsync` that is triggered when new members are added to the conversation. Inside this method, there is a conditional statement `if (member.Id != turnContext.Activity.Recipient.Id)` which ensures that the welcome message is sent only to the new member who has joined, and not to the existing users or the bot itself. The welcome message is personalized with the new member's name and is sent directly to them.

Murtuza
Mar 31, 2024

Yes, the OnMembersAddedAsync method is triggered when a new user joins the conversation. Yes, when a new user joins the conversation, the existing users in the conversation will see the chatbot greeting. This is because the OnMembersAddedAsync method sends a welcome message to each new member. No, the OnMembersAddedAsync method is not initialized when a user sends a message. It is only triggered when a new user joins the conversation. The method that handles incoming messages is typically OnMessageActivityAsyn

HaraTadahisa
Jun 21, 2024

My answer is that Yes No No

krzkrzkra
Jul 12, 2024

YNN is the answer.

anto69
Aug 13, 2024

I read many comments. No reason why the second should be N. Y-Y-N

JakeCallham
Aug 31, 2024

Are you a .net developer? I guess not. its no