exam questions

Exam AI-102 All Questions

View all questions & answers for the AI-102 exam

Exam AI-102 topic 5 question 8 discussion

Actual exam question from Microsoft's AI-102
Question #: 8
Topic #: 5
[All AI-102 Questions]

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.

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:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
guruaws2021
Highly Voted 3 years, 8 months ago
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
upvoted 26 times
Happiman
4 months ago
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.
upvoted 1 times
...
rdemontis
1 year, 5 months ago
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)
upvoted 2 times
rdemontis
1 year, 5 months ago
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
upvoted 3 times
...
...
Viktur
3 years, 8 months ago
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.
upvoted 26 times
Labani1987
9 months, 1 week ago
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 )
upvoted 2 times
...
...
...
reachmymind
Highly Voted 3 years, 2 months ago
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
upvoted 20 times
ninjapunk
2 years, 4 months ago
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.
upvoted 3 times
...
...
anto69
Most Recent 8 months, 3 weeks ago
I read many comments. No reason why the second should be N. Y-Y-N
upvoted 1 times
JakeCallham
8 months ago
Are you a .net developer? I guess not. its no
upvoted 1 times
...
...
krzkrzkra
9 months, 3 weeks ago
YNN is the answer.
upvoted 1 times
...
HaraTadahisa
10 months, 2 weeks ago
My answer is that Yes No No
upvoted 1 times
...
takaimomoGcup
10 months, 3 weeks ago
Yes No No
upvoted 2 times
...
nanaw770
11 months ago
Will this question still be asked on June 2, 2024?
upvoted 2 times
Mattt
1 month, 2 weeks ago
No, that's outside the scope of the exam.
upvoted 1 times
...
...
Murtuza
1 year, 1 month ago
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
upvoted 1 times
...
idcanymore
1 year, 2 months ago
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.
upvoted 2 times
...
PCRamirez
1 year, 2 months ago
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.
upvoted 1 times
...
evangelist
1 year, 3 months ago
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.
upvoted 1 times
...
dimsok
1 year, 3 months ago
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
upvoted 4 times
...
sl_mslconsulting
1 year, 6 months ago
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.
upvoted 3 times
sl_mslconsulting
1 year, 6 months ago
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.
upvoted 1 times
...
...
zellck
1 year, 10 months ago
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
upvoted 5 times
...
AzureJobsTillRetire
2 years, 2 months ago
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)
upvoted 3 times
saadashraf
2 years ago
Thanks, spent quite a time on this question. Your answer is absolutely correct
upvoted 2 times
...
...
Adedoyin_Simeon
3 years, 6 months ago
The answer is correct.
upvoted 3 times
...
TheB
3 years, 10 months ago
The answer looks correct.
upvoted 7 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago