diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b92d80c..7d8a47c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ default_install_hook_types: - pre-commit - commit-msg - +exclude: '^phone_agent/config/apps\.py$' default_stages: - pre-commit # Run locally repos: @@ -19,4 +19,4 @@ repos: rev: v0.9.29 hooks: - id: pymarkdown - args: [fix] \ No newline at end of file + args: [fix] diff --git a/phone_agent/actions/handler.py b/phone_agent/actions/handler.py index b8293f6..32ab4ff 100644 --- a/phone_agent/actions/handler.py +++ b/phone_agent/actions/handler.py @@ -283,7 +283,13 @@ def parse_action(response: str) -> dict[str, Any]: """ try: response = response.strip() - if response.startswith("do"): + if response.startswith('do(action="Type"') or response.startswith( + 'do(action="Type_Name"' + ): + text = response.split("text=", 1)[1][1:-2] + action = {"_metadata": "do", "action": "Type", "text": text} + return action + elif response.startswith("do"): # Use AST parsing instead of eval for safety try: tree = ast.parse(response, mode="eval")