|
23 | 23 | AgentConfig, |
24 | 24 | AgentExecuteOptions, |
25 | 25 | AgentResult, |
26 | | - FunctionAction, |
27 | 26 | ) |
28 | 27 | from .client import AgentClient |
29 | 28 |
|
@@ -567,34 +566,19 @@ async def run_task( |
567 | 566 | ) |
568 | 567 | current_url = self.handler.page.url |
569 | 568 |
|
570 | | - function_name_called_for_feedback = "" |
571 | | - if agent_action.action_type == "function" and isinstance( |
572 | | - agent_action.action.root, FunctionAction |
573 | | - ): |
574 | | - function_name_called_for_feedback = ( |
575 | | - agent_action.action.root.name |
| 569 | + if not invoked_function_name: |
| 570 | + self.logger.error( |
| 571 | + "Original Google function name not found for feedback loop (was None).", |
| 572 | + category="agent", |
576 | 573 | ) |
577 | | - self._format_action_feedback( |
578 | | - function_name_called=function_name_called_for_feedback, |
579 | | - action_result=action_result, |
580 | | - new_screenshot_base64=current_screenshot_b64, |
581 | | - current_url=current_url, |
582 | | - function_call_args=function_call_args, |
583 | | - ) |
584 | | - else: |
585 | | - if not invoked_function_name: |
586 | | - self.logger.error( |
587 | | - "Original Google function name not found for feedback loop (was None).", |
588 | | - category="agent", |
589 | | - ) |
590 | | - else: |
591 | | - self._format_action_feedback( |
592 | | - function_name_called=invoked_function_name, |
593 | | - action_result=action_result, |
594 | | - new_screenshot_base64=current_screenshot_b64, |
595 | | - current_url=current_url, |
596 | | - function_call_args=function_call_args, |
597 | | - ) |
| 574 | + |
| 575 | + self._format_action_feedback( |
| 576 | + function_name_called=invoked_function_name, |
| 577 | + action_result=action_result, |
| 578 | + new_screenshot_base64=current_screenshot_b64, |
| 579 | + current_url=current_url, |
| 580 | + function_call_args=function_call_args, |
| 581 | + ) |
598 | 582 |
|
599 | 583 | if task_completed: |
600 | 584 | self.logger.info( |
|
0 commit comments