Fix GIMP bug; Speedup the environment, when there is not a11y tree needed, we can do no controller.get

This commit is contained in:
Timothyxxx
2024-03-20 22:22:59 +08:00
parent 21e3ce5cba
commit d1e2b12b41
4 changed files with 16 additions and 5 deletions

View File

@@ -350,7 +350,7 @@ class PromptAgent:
# {{{1
if self.observation_type in ["screenshot", "screenshot_a11y_tree"]:
base64_image = encode_image(obs["screenshot"])
linearized_accessibility_tree = linearize_accessibility_tree(accessibility_tree=obs["accessibility_tree"])
linearized_accessibility_tree = linearize_accessibility_tree(accessibility_tree=obs["accessibility_tree"]) if self.observation_type == "screenshot_a11y_tree" else None
logger.debug("LINEAR AT: %s", linearized_accessibility_tree)
if self.observation_type == "screenshot_a11y_tree":