Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to send a message from one agent to another using the basic send method.
Agentic AI
agent.send([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a variable instead of a string literal.
Using receive() instead of send().
Calling connect() which is unrelated here.
✗ Incorrect
The send method requires the message content as a string argument to send it to another agent.
2fill in blank
mediumComplete the code to receive a message from another agent.
Agentic AI
incoming = agent.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using send() instead of receive().
Trying to use connect() which is for establishing connections.
Using listen() which is not a standard method here.
✗ Incorrect
The receive() method is used to get messages sent by other agents.
3fill in blank
hardFix the error in the code to broadcast a message to all connected agents.
Agentic AI
agent.[1]("Broadcast message")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using send() which only sends to one agent.
Using receive() which is for incoming messages.
Using connect() which is for establishing connections.
✗ Incorrect
The broadcast() method sends a message to all connected agents at once.
4fill in blank
hardFill both blanks to check if the agent is connected and then send a message.
Agentic AI
if agent.[1](): agent.[2]("Status update")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using receive() instead of send() to send messages.
Using connect() instead of is_connected() for checking status.
✗ Incorrect
First check if the agent is connected using is_connected(), then send the message with send().
5fill in blank
hardFill all three blanks to create a message dictionary with sender, receiver, and content keys.
Agentic AI
message = {
"sender": [1],
"receiver": [2],
"content": [3]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up sender and receiver values.
Using status instead of a greeting message for content.
✗ Incorrect
The message dictionary needs sender as "agent_1", receiver as "agent_2", and content as "Hello there!".