Displays the result of accessing the resource.
(node_input: dict)
| 116 | |
| 117 | |
| 118 | def display_result(node_input: dict): |
| 119 | """Displays the result of accessing the resource.""" |
| 120 | if node_input["status"] == "Success": |
| 121 | repos_str = ", ".join(node_input["repos"]) |
| 122 | yield Event(message=f"Successfully fetched repositories: {repos_str}") |
| 123 | else: |
| 124 | yield Event( |
| 125 | message=( |
| 126 | "Failed to fetch repositories. Error:" |
| 127 | f" {node_input.get('message', 'Unknown error')}" |
| 128 | ) |
| 129 | ) |
| 130 | |
| 131 | |
| 132 | root_agent = Workflow( |