Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Removed som dependency from agent[core], agent[anthropic], and agent[ui]

Dillon DuPont11612b1170ad
diff --git a/libs/agent/agent/core/base.py b/libs/agent/agent/core/base.py
index 53c3aca9b1..fe0f07ad9a 100644
--- a/libs/agent/agent/core/base.py
+++ b/libs/agent/agent/core/base.py
@@ -5,7 +5,6 @@ import asyncio
from abc import ABC, abstractmethod
from typing import Any, AsyncGenerator, Dict, List, Optional
-from agent.providers.omni.parser import ParseResult
from computer import Computer
from .messages import StandardMessageManager, ImageRetentionConfig
from .types import AgentResponse
@@ -207,7 +206,7 @@ class BaseLoop(ABC):
# EVENT HOOKS / CALLBACKS
###########################################
- async def handle_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[ParseResult] = None) -> None:
+ async def handle_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[dict] = None) -> None:
"""Process a screenshot through callback managers
Args:
diff --git a/libs/agent/agent/core/callbacks.py b/libs/agent/agent/core/callbacks.py
index 59cd0e5a2a..0c5a719e80 100644
--- a/libs/agent/agent/core/callbacks.py
+++ b/libs/agent/agent/core/callbacks.py
@@ -6,8 +6,6 @@ from abc import ABC, abstractmethod
from datetime import datetime
from typing import Any, Dict, List, Optional, Protocol
-from agent.providers.omni.parser import ParseResult
-
logger = logging.getLogger(__name__)
class ContentCallback(Protocol):
@@ -117,7 +115,7 @@ class CallbackManager:
for handler in self.handlers:
await handler.on_error(error, **kwargs)
- async def on_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[ParseResult] = None) -> None:
+ async def on_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[dict] = None) -> None:
"""Called when a screenshot is taken.
Args:
@@ -166,7 +164,7 @@ class CallbackHandler(ABC):
pass
@abstractmethod
- async def on_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[ParseResult] = None) -> None:
+ async def on_screenshot(self, screenshot_base64: str, action_type: str = "", parsed_screen: Optional[dict] = None) -> None:
"""Called when a screenshot is taken.
Args:
diff --git a/libs/agent/agent/core/messages.py b/libs/agent/agent/core/messages.py
index a53622a47d..2a582a7a74 100644
--- a/libs/agent/agent/core/messages.py
+++ b/libs/agent/agent/core/messages.py
@@ -5,7 +5,6 @@ import json
from typing import Any, Dict, List, Optional, Union, Tuple
from dataclasses import dataclass
import re
-from ..providers.omni.parser import ParseResult
logger = logging.getLogger(__name__)
diff --git a/libs/agent/agent/providers/anthropic/utils.py b/libs/agent/agent/providers/anthropic/utils.py
index c0afcd0f9a..f57ea8291d 100644
--- a/libs/agent/agent/providers/anthropic/utils.py
+++ b/libs/agent/agent/providers/anthropic/utils.py
@@ -4,7 +4,6 @@ import logging
import re
from typing import Any, Dict, List, Optional, Tuple, cast
from anthropic.types.beta import BetaMessage
-from ..omni.parser import ParseResult
from ...core.types import AgentResponse
from datetime import datetime
@@ -188,7 +187,7 @@ def from_anthropic_format(messages: List[Dict[str, Any]]) -> List[Dict[str, Any]
async def to_agent_response_format(
response: BetaMessage,
messages: List[Dict[str, Any]],
- parsed_screen: Optional[ParseResult] = None,
+ parsed_screen: Optional[dict] = None,
parser: Optional[Any] = None,
model: Optional[str] = None,
) -> AgentResponse:
diff --git a/libs/agent/agent/ui/gradio/app.py b/libs/agent/agent/ui/gradio/app.py
index ed37ca5b22..8d173dd610 100644
--- a/libs/agent/agent/ui/gradio/app.py
+++ b/libs/agent/agent/ui/gradio/app.py
@@ -41,7 +41,6 @@ from typing import cast
# Import from agent package
from agent.core.types import AgentResponse
from agent.core.callbacks import DefaultCallbackHandler
-from agent.providers.omni.parser import ParseResult
from computer import Computer
from agent import ComputerAgent, AgentLoop, LLM, LLMProvider
@@ -103,7 +102,7 @@ class GradioChatScreenshotHandler(DefaultCallbackHandler):
self,
screenshot_base64: str,
action_type: str = "",
- parsed_screen: Optional[ParseResult] = None,
+ parsed_screen: Optional[dict] = None,
) -> None:
"""Add screenshot to chatbot when a screenshot is taken and update the annotated image.