马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
随着 AI Agent 在 2025 年的发作式发展,macOS 用户也迎来了一个令人奋发的开源项目:Cua。
这款由 trycua 团队打造的盘算机利用署理框架,不光能在 macOS 上开启捏造机,还能让 AI 在此中操纵体系及应用,如欣赏器和 VS Code。它支持 OpenAI 和 Anthropic 的 CUA 模子,将来还将兼容 Ollama 当地模子。
Cua 是一个专为 macOS 计划的开源 AI Agent 框架,它基于 Apple 的 Virtualization.Framework,联合高性能捏造化与 AI 署理本领,允许用户在 Apple Silicon 上创建并运行 macOS 和 Linux 捏造机。
它的核心在于其“盘算机利用接口”(CUI)和署理支持,让 AI 能在隔离情况中操纵桌面应用。
无论是欣赏网页、编写代码,照旧实行复杂使命,Cua 都能让 AI 在 macOS 上如鱼得水。
核心功能
- • 高性能捏造化:在 Apple Silicon 上运行 macOS/Linux 捏造机,性能靠近原生(90%)。
- • AI 署理操纵:支持 AI 在捏造机中操纵 macOS 体系及应用(如欣赏器、VS Code)。
- • 安全隔离:全部操纵在沙盒化的捏造情况中运行,掩护主机体系。
- • 多应用支持:AI 可操控捏造机内的多种步调,实现复杂工作流。
- • 兼容多种大模子:如今支持 OpenAI、Anthropic CUA 模子,将来还将支持 Ollama 等当地大模子。
安装与利用
Cua 的安装和利用过程简朴,专为 macOS 用户优化。以下是具体步调:
1、安装 Lume(Cua 的捏造化根本)- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
复制代码 2、安装cua相干的Python库- pip install cua-computer cua-agent
复制代码 3、利用调用示例- import logging
- from pathlib import Path
- from agent import ComputerAgent, LLM, AgentLoop
- computer = Computer(verbosity=logging.INFO)
- # Create agent with Anthropic loop and provider
- agent = ComputerAgent(
- computer=computer,
- loop=AgentLoop.OMNI,
- model=LLM(provider=LLMProvider.ANTHROPIC, name="claude-3-7-sonnet-20250219"),
- # model=LLM(provider=LLMProvider.OPENAI, name="gpt-4.5-preview"),
- save_trajectory=True,
- trajectory_dir=str(Path("trajectories")),
- only_n_most_recent_images=3,
- verbosity=logging.INFO
- )
- tasks = [
- "Look for a repository named trycua/cua on GitHub.",
- "Check the open issues, open the most recent one and read it.",
- "Clone the repository in users/lume/projects if it doesn't exist yet.",
- "Open the repository with an app named Cursor (on the dock, black background and white cube icon).",
- "From Cursor, open Composer if not already open.",
- "Focus on the Composer text area, then write and submit a task to help resolve the GitHub issue.",
- ]
- for i, task in enumerate(tasks):
- print(f"\nExecuting task {i}/{len(tasks)}: {task}")
- async for result in agent.run(task):
- # print(result)
- pass
- print(f"\n✅ Task {i+1}/{len(tasks)} completed: {task}")
复制代码 启动捏造机下令:- lume run macos-sequoia-vanilla:latest
复制代码 更多用法和 Notebook 示例见 GitHub 文档,几分钟即可体验 AI 操纵 macOS 的爱好。
写在末了
Cua 让 AI 不再只是“谈天呆板人”,而是能直接动手操纵你的 Mac!具备当地捏造机隔离、性能良好、模子机动设置等长处,无论是开发、自动化办公、智能助手,都能极大提拔服从。
|