mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-29 19:06:23 +02:00
update path exist judgement
This commit is contained in:
parent
120cce07e5
commit
33e8640f47
4 changed files with 4 additions and 7 deletions
|
|
@ -47,10 +47,8 @@ class ManualRecord(Action):
|
|||
self.screenshot_before_path = Path(task_dir) / "raw_screenshots"
|
||||
self.screenshot_after_path = Path(task_dir) / "labeled_screenshots"
|
||||
self.xml_path = Path(task_dir) / "xml"
|
||||
|
||||
for path in [self.screenshot_before_path, self.screenshot_after_path, self.xml_path]:
|
||||
if not path.exists():
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
self.record_path.write_text("")
|
||||
record_file = open(self.record_path, "w")
|
||||
|
|
|
|||
|
|
@ -36,12 +36,13 @@ class ParseRecord(Action):
|
|||
screenshot_after_path: Path = ""
|
||||
|
||||
async def run(self, app_name: str, task_dir: Path, docs_dir: Path):
|
||||
docs_dir.mkdir(parents=True, exist_ok=True)
|
||||
doc_count = 0
|
||||
self.record_path = Path(task_dir) / "record.txt"
|
||||
self.task_desc_path = Path(task_dir) / "task_desc.txt"
|
||||
self.screenshot_before_path = Path(task_dir) / "raw_screenshots"
|
||||
self.screenshot_after_path = Path(task_dir) / "labeled_screenshots"
|
||||
for path in [self.screenshot_before_path, self.screenshot_after_path]:
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
task_desc = self.task_desc_path.read_text()
|
||||
|
||||
|
|
|
|||
|
|
@ -100,8 +100,7 @@ class ScreenshotParse(Action):
|
|||
env: AndroidEnv,
|
||||
):
|
||||
for path in [task_dir, docs_dir]:
|
||||
if not path.exists():
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
screenshot_path: Path = env.observe(
|
||||
EnvObsParams(obs_type=EnvObsType.GET_SCREENSHOT, ss_name=f"{round_count}_before", local_save_dir=task_dir)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
{'tap': '[CONTENT]\n{\n "Observation": "The first image shows a mobile device\'s home screen with various app icons and a Google search bar at the top. The second image displays an app drawer with a grid of apps and a search bar at the top, indicating that the UI element has been tapped.",\n "Thought": "Tapping the UI element opens the app drawer, which is a common function in mobile operating systems to access a list of all installed apps.",\n "Description": "Tapping this area will open the app drawer, displaying a list of all installed applications."\n}\n[/CONTENT]', 'text': '', 'v_swipe': '', 'h_swipe': '', 'long_press': ''}
|
||||
Loading…
Add table
Add a link
Reference in a new issue