Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to send a request for human approval.
Agentic_ai
approval_request = HumanApprovalRequest([1]='Please review this action')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to check if the human approved the request.
Agentic_ai
if approval_response.[1](): print('Approved') else: print('Denied')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to wait for human approval asynchronously.
Agentic_ai
approval_response = await approval_request.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary of approval status for each task.
Agentic_ai
approval_status = {task: response.[1]() for task, response in responses.items() if not response.[2]()} Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to build a summary report of human approvals.
Agentic_ai
summary = [1]([2] for [3] in approval_responses if [3].is_approved())
Drag options to blanks, or click blank then click option'
Attempts:
3 left
