From c3e540c6f65c919ab9ed53a029a4231e09d10610 Mon Sep 17 00:00:00 2001 From: IBMC265 Date: Wed, 25 Sep 2024 00:04:46 -0700 Subject: [PATCH 1/2] fix replay bug --- litewebagent/utils/replay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litewebagent/utils/replay.py b/litewebagent/utils/replay.py index 89dcec5..0144c1b 100644 --- a/litewebagent/utils/replay.py +++ b/litewebagent/utils/replay.py @@ -132,7 +132,10 @@ def take_action(step, playwright_manager, is_replay, log_folder): _post_extract(page) url = page.url element = find_matching_element(interactive_elements, step) - action = replace_number(step["action"], element['bid']) + if element: + action = replace_number(step["action"], element['bid']) + else: + action = step["action"] code, function_calls = action_set.to_python_code(action) logger.info("Executing action script") if is_replay: From d21283d05cb9e7d4f5e9839968164c8ee8391a78 Mon Sep 17 00:00:00 2001 From: IBMC265 Date: Wed, 25 Sep 2024 00:10:58 -0700 Subject: [PATCH 2/2] add trajectory logging --- litewebagent/agents/SearchAgents/PromptSearchAgent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litewebagent/agents/SearchAgents/PromptSearchAgent.py b/litewebagent/agents/SearchAgents/PromptSearchAgent.py index 3d2577a..0b25ee9 100644 --- a/litewebagent/agents/SearchAgents/PromptSearchAgent.py +++ b/litewebagent/agents/SearchAgents/PromptSearchAgent.py @@ -123,6 +123,7 @@ def bfs(self): "status": "pending", "depth": depth, } + logger.info(trajectory_record) self.trajectories.append(trajectory_record) try: