Improve on agent codes; add auto-running experiments code; Fix some examples
This commit is contained in:
@@ -63,6 +63,8 @@ def tag_screenshot(screenshot, accessibility_tree):
|
||||
|
||||
|
||||
def parse_actions_from_string(input_string):
|
||||
if input_string.strip() in ['WAIT', 'DONE', 'FAIL']:
|
||||
return [input_string.strip()]
|
||||
# Search for a JSON string within the input string
|
||||
actions = []
|
||||
matches = re.findall(r'```json\s+(.*?)\s+```', input_string, re.DOTALL)
|
||||
@@ -95,6 +97,9 @@ def parse_actions_from_string(input_string):
|
||||
|
||||
|
||||
def parse_code_from_string(input_string):
|
||||
if input_string.strip() in ['WAIT', 'DONE', 'FAIL']:
|
||||
return [input_string.strip()]
|
||||
|
||||
# This regular expression will match both ```code``` and ```python code```
|
||||
# and capture the `code` part. It uses a non-greedy match for the content inside.
|
||||
pattern = r"```(?:\w+\s+)?(.*?)```"
|
||||
|
||||
Reference in New Issue
Block a user