MCPcopy Create free account
hub / github.com/microsoft/Webwright / parse_log

Function parse_log

assets/task_showcase/app.py:68–82  ·  view source on GitHub ↗

Return ({step_num: action_text}, final_response).

(log_path: Path)

Source from the content-addressed store, hash-verified

66
67
68def parse_log(log_path: Path) -> tuple[dict[int, str], str]:
69 """Return ({step_num: action_text}, final_response)."""
70 steps: dict[int, str] = {}
71 final = ""
72 if not log_path.exists():
73 return steps, final
74 for raw in log_path.read_text(encoding="utf-8").splitlines():
75 m = _STEP_LINE.match(raw.strip())
76 if m:
77 steps[int(m.group(1))] = m.group(2).strip()
78 continue
79 f = _FINAL_LINE.match(raw.strip())
80 if f:
81 final = f.group(1).strip()
82 return steps, final
83
84
85def parse_steps_jsonl(path: Path) -> list[dict]:

Callers 1

build_stepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected