更新压缩机制,提高前缀缓存命中率,优化UI渲染机制,提高帧数
This commit is contained in:
1 parent
6131c2563e
commit
0ce72f74f1
175 files changed
+7621
-2611
No files matched your search
@@ -0,0 +1,31 @@
|
||||
"""按 steps/*.json 的 actions 列表驱动 web_page 工具(真实浏览器/CDP 9222)。
|
||||
|
||||
用法: python drive.py steps/xxx.json [--save-png 前缀]
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "Agent" / "src"))
|
||||
|
||||
from agent.tools.web_page import WebPage as WebPageTool
|
||||
|
||||
|
||||
def main() -> None:
|
||||
path = Path(sys.argv[1] if len(sys.argv) > 1 else "steps/tmp.json")
|
||||
actions = json.loads(path.read_text(encoding="utf-8"))
|
||||
tool = WebPageTool()
|
||||
msg, artifact = tool._run(actions)
|
||||
print(msg)
|
||||
png = artifact.get("image_bytes")
|
||||
if png:
|
||||
out = Path(__file__).parent / "output"
|
||||
out.mkdir(exist_ok=True)
|
||||
name = path.stem + f"_{int(time.time())}.png"
|
||||
(out / name).write_bytes(png)
|
||||
print(f"[screenshot saved] {out / name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user