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.

Fix import omni types

f-trycua36fccfde8771
diff --git a/libs/agent/agent/core/agent.py b/libs/agent/agent/core/agent.py
index 3d533f53a8..6f2c627817 100644
--- a/libs/agent/agent/core/agent.py
+++ b/libs/agent/agent/core/agent.py
@@ -6,8 +6,7 @@ import os
from typing import AsyncGenerator, Optional
from computer import Computer
-from ..providers.omni.types import LLM
-from ..core.types import AgentLoop
+from .types import LLM, AgentLoop
from .types import AgentResponse
from .factory import LoopFactory
from .provider_config import DEFAULT_MODELS, ENV_VARS
diff --git a/libs/agent/agent/core/factory.py b/libs/agent/agent/core/factory.py
index cf15158f3d..091f6c345f 100644
--- a/libs/agent/agent/core/factory.py
+++ b/libs/agent/agent/core/factory.py
@@ -8,10 +8,6 @@ from computer import Computer
from .types import AgentLoop
from .base import BaseLoop
-# For type checking only
-if TYPE_CHECKING:
- from ..providers.omni.types import LLMProvider
-
logger = logging.getLogger(__name__)
@@ -78,7 +74,7 @@ class LoopFactory:
try:
from ..providers.omni.loop import OmniLoop
from ..providers.omni.parser import OmniParser
- from ..providers.omni.types import LLMProvider
+ from .types import LLMProvider
except ImportError:
raise ImportError(
"The 'omni' provider is not installed. "
@@ -91,9 +87,6 @@ class LoopFactory:
# We know provider is the correct type at this point, so cast it
provider_instance = cast(LLMProvider, provider)
- # Get provider_base_url from the LLM object if it exists
- provider_base_url = getattr(provider, "provider_base_url", None)
-
return OmniLoop(
provider=provider_instance,
api_key=api_key,
diff --git a/libs/agent/agent/core/provider_config.py b/libs/agent/agent/core/provider_config.py
index a2b37c696e..7fae13d07b 100644
--- a/libs/agent/agent/core/provider_config.py
+++ b/libs/agent/agent/core/provider_config.py
@@ -1,6 +1,6 @@
"""Provider-specific configurations and constants."""
-from ..providers.omni.types import LLMProvider
+from .types import LLMProvider
# Default models for different providers
DEFAULT_MODELS = {
diff --git a/libs/agent/agent/providers/omni/__init__.py b/libs/agent/agent/providers/omni/__init__.py
index c09fb386e1..a93b85770c 100644
--- a/libs/agent/agent/providers/omni/__init__.py
+++ b/libs/agent/agent/providers/omni/__init__.py
@@ -1,6 +1,6 @@
"""Omni provider implementation."""
-from .types import LLMProvider
+from ...core.types import LLMProvider
from .image_utils import (
decode_base64_image,
)
diff --git a/libs/agent/agent/providers/omni/loop.py b/libs/agent/agent/providers/omni/loop.py
index 948622a4b6..33124b25ad 100644
--- a/libs/agent/agent/providers/omni/loop.py
+++ b/libs/agent/agent/providers/omni/loop.py
@@ -16,7 +16,7 @@ from ...core.messages import StandardMessageManager, ImageRetentionConfig
from .utils import to_openai_agent_response_format
from ...core.types import AgentResponse
from computer import Computer
-from .types import LLMProvider
+from ...core.types import LLMProvider
from .clients.openai import OpenAIClient
from .clients.anthropic import AnthropicClient
from .clients.ollama import OllamaClient
diff --git a/libs/agent/agent/providers/omni/tools/manager.py b/libs/agent/agent/providers/omni/tools/manager.py
index 9e8deafefd..bce3a4ad55 100644
--- a/libs/agent/agent/providers/omni/tools/manager.py
+++ b/libs/agent/agent/providers/omni/tools/manager.py
@@ -7,7 +7,7 @@ from ....core.tools import BaseToolManager, ToolResult
from ....core.tools.collection import ToolCollection
from .computer import ComputerTool
from .bash import BashTool
-from ..types import LLMProvider
+from ....core.types import LLMProvider
class ToolManager(BaseToolManager):