0
0
Agentic AIml~10 mins

AutoGen for conversational agents in Agentic AI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a simple conversational agent that replies with a greeting.

Agentic AI
agent = AutoGenAgent(name='ChatBot')
response = agent.[1]('Hello!')
Drag options to blanks, or click blank then click option'
Areply
Btalk
Csend
Drespond
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'respond' instead of 'reply' causes an AttributeError.
Using 'send' or 'talk' are not valid methods for this agent.
2fill in blank
medium

Complete the code to initialize the agent with a system message that sets its role.

Agentic AI
agent = AutoGenAgent(name='HelperBot', system_message=[1])
Drag options to blanks, or click blank then click option'
A'You are a helpful assistant.'
B'Hello, I am your friend.'
C'Goodbye and take care.'
D'Random chat agent.'
Attempts:
3 left
💡 Hint
Common Mistakes
Using greetings or farewells as system messages confuses the agent's role.
Using vague descriptions does not set a clear role.
3fill in blank
hard

Fix the error in the code to correctly generate a conversation turn with the agent.

Agentic AI
conversation = Conversation()
conversation.add_user_message('Hi')
response = conversation.[1]()
Drag options to blanks, or click blank then click option'
Asend_message
Bstart_conversation
Cget_reply
Dgenerate_response
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get_reply' causes an AttributeError.
Using 'send_message' or 'start_conversation' are incorrect method calls.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps user messages to their lengths if length is greater than 5.

Agentic AI
lengths = {msg: [1] for msg in messages if len(msg) [2] 5}
Drag options to blanks, or click blank then click option'
Alen(msg)
B>
C<
Dmsg
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'msg' as value instead of 'len(msg)' gives the message text, not length.
Using '<' instead of '>' filters the wrong messages.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary of agent replies longer than 10 characters.

Agentic AI
filtered_replies = [1]: [2] for [3], reply in replies.items() if len(reply) > 10}
Drag options to blanks, or click blank then click option'
Auser
Breply
Dagent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'agent' as key or variable name causes confusion.
Mixing up keys and values in the comprehension.