0
0
Agentic_aiml~10 mins

Agent-to-agent communication standards in Agentic Ai - Interactive Code Practice

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

Complete the code to define a basic message format for agent communication.

Agentic_ai
message = {"sender": "AgentA", "receiver": "AgentB", "content": [1]
Drag options to blanks, or click blank then click option'
ATrue
B"Hello, AgentB!"
C12345
DNone
Attempts:
3 left
2fill in blank
medium

Complete the code to send a message using a standard send function.

Agentic_ai
def send_message(agent, message):
    agent.[1](message)
Drag options to blanks, or click blank then click option'
Asend
Breceive
Cprocess
Dstore
Attempts:
3 left
3fill in blank
hard

Fix the error in the message parsing code to extract the sender correctly.

Agentic_ai
def parse_message(msg):
    sender = msg[[1]]
    return sender
Drag options to blanks, or click blank then click option'
A"sender"
B0
C1
D'receiver'
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a filter that selects messages sent by 'AgentX' and containing 'urgent'.

Agentic_ai
filtered = [msg for msg in messages if msg[[1]] == 'AgentX' and 'urgent' [2] msg["content"]]
Drag options to blanks, or click blank then click option'
A"sender"
Bin
Cnot in
D"receiver"
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to build a dictionary comprehension mapping agent names to their last received message content.

Agentic_ai
last_messages = {agent: messages[-1][[1]] for agent, messages in [2].items() if messages and messages[-1][[3]] == agent}
Drag options to blanks, or click blank then click option'
A"content"
Binbox
C"receiver"
D"sender"
Attempts:
3 left