mirror of
https://github.com/simular-ai/Agent-S.git
synced 2026-09-01 15:02:27 +08:00
update cli apps
This commit is contained in:
+14
-15
@@ -9,20 +9,19 @@ import time
|
||||
|
||||
import pyautogui
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
current_platform = "macos"
|
||||
from gui_agents.s1.aci.MacOSACI import MacOSACI, UIElement
|
||||
elif platform.system() == "Windows":
|
||||
current_platform = "windows"
|
||||
from gui_agents.s1.aci.WindowsOSACI import WindowsACI, UIElement
|
||||
elif platform.system() == "Linux":
|
||||
current_platform = "ubuntu"
|
||||
from gui_agents.s1.aci.LinuxOSACI import LinuxACI, UIElement
|
||||
else:
|
||||
raise ValueError("Unsupported platform")
|
||||
|
||||
from gui_agents.s1.core.AgentS import GraphSearchAgent, UIAgent
|
||||
|
||||
current_platform = platform.system().lower()
|
||||
|
||||
if current_platform == "darwin":
|
||||
from gui_agents.s1.aci.MacOSACI import MacOSACI, UIElement
|
||||
elif current_platform == "linux":
|
||||
from gui_agents.s1.aci.LinuxOSACI import LinuxACI, UIElement
|
||||
elif current_platform == "windows":
|
||||
from gui_agents.s1.aci.WindowsOSACI import WindowsACI, UIElement
|
||||
else:
|
||||
raise ValueError(f"Unsupported platform: {current_platform}")
|
||||
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
@@ -154,11 +153,11 @@ def main():
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
if current_platform == "Darwin":
|
||||
grounding_agent = MacOSACI()
|
||||
elif platform.system() == "Windows":
|
||||
elif current_platform == "Windows":
|
||||
grounding_agent = WindowsACI()
|
||||
elif platform.system() == "Linux":
|
||||
elif current_platform == "Linux":
|
||||
grounding_agent = LinuxACI()
|
||||
else:
|
||||
raise ValueError("Unsupported platform")
|
||||
|
||||
@@ -10,18 +10,11 @@ import time
|
||||
|
||||
from PIL import Image
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
current_platform = "macos"
|
||||
elif platform.system() == "Linux":
|
||||
current_platform = "ubuntu"
|
||||
elif platform.system() == "Windows":
|
||||
current_platform = "windows"
|
||||
else:
|
||||
raise ValueError("Unsupported platform")
|
||||
|
||||
from gui_agents.s2.agents.grounding import OSWorldACI
|
||||
from gui_agents.s2.agents.agent_s import GraphSearchAgent
|
||||
|
||||
current_platform = platform.system().lower()
|
||||
|
||||
logger = logging.getLogger()
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
@@ -11,24 +11,21 @@ import time
|
||||
from threading import Event, Lock
|
||||
|
||||
# Determine the operating system and select appropriate ACI
|
||||
os_name = platform.system().lower()
|
||||
if os_name == "linux":
|
||||
current_platform = platform.system().lower()
|
||||
if current_platform == "linux":
|
||||
from gui_agents.s1.aci.LinuxOSACI import LinuxACI, UIElement
|
||||
|
||||
grounding_agent = LinuxACI()
|
||||
platform_name = "ubuntu"
|
||||
elif os_name == "darwin":
|
||||
elif current_platform == "darwin":
|
||||
from gui_agents.s1.aci.MacOSACI import MacOSACI, UIElement
|
||||
|
||||
grounding_agent = MacOSACI()
|
||||
platform_name = "macos"
|
||||
elif os_name == "windows":
|
||||
elif current_platform == "windows":
|
||||
from gui_agents.s1.aci.WindowsOSACI import WindowsACI, UIElement
|
||||
|
||||
grounding_agent = WindowsACI()
|
||||
platform_name = "windows"
|
||||
else:
|
||||
raise ValueError(f"Unsupported operating system: {os_name}")
|
||||
raise ValueError(f"Unsupported operating system: {current_platform}")
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@@ -167,7 +164,7 @@ async def run(request: RunRequest):
|
||||
agent = GraphSearchAgent(
|
||||
engine_params,
|
||||
grounding_agent,
|
||||
platform=platform_name,
|
||||
platform=current_platform,
|
||||
action_space="pyautogui",
|
||||
observation_type="mixed",
|
||||
)
|
||||
@@ -210,7 +207,7 @@ async def execute_command_stream(cmd: CommandRequest):
|
||||
agent = GraphSearchAgent(
|
||||
engine_params,
|
||||
grounding_agent,
|
||||
platform=platform_name,
|
||||
platform=current_platform,
|
||||
action_space="pyautogui",
|
||||
observation_type="mixed",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user