返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

MacOS 的 AI Agent 新星,本地沙盒驱动,解锁 macOS 操作新体验!

[复制链接]
链载Ai 显示全部楼层 发表于 2 小时前 |阅读模式 打印 上一主题 下一主题

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">随着 AI Agent 在 2025 年的爆发式发展,macOS 用户也迎来了一个令人振奋的开源项目:ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: inherit;color: rgb(66, 166, 100);">Cua

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这款由 trycua 团队打造的计算机使用代理框架,不仅能在 macOS 上开启虚拟机,还能让 AI 在其中操作系统及应用,如浏览器和 VS Code。它支持 OpenAI 和 Anthropic 的 CUA 模型,未来还将兼容 Ollama 本地模型。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: inherit;color: rgb(66, 166, 100);">Cua是一个专为 macOS 设计的开源 AI Agent 框架,它基于 Apple 的 Virtualization.Framework,结合高性能虚拟化与 AI 代理能力,允许用户在 Apple Silicon 上创建并运行 macOS 和 Linux 虚拟机。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">它的核心在于其“计算机使用接口”(CUI)和代理支持,让 AI 能在隔离环境中操作桌面应用。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">无论是浏览网页、编写代码,还是执行复杂任务,Cua 都能让 AI 在 macOS 上如鱼得水。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;color: rgb(66, 166, 100);">核心功能

    ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;color: rgb(63, 63, 63);" class="list-paddingleft-1">
  • ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 15px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);">
    高性能虚拟化:在 Apple Silicon 上运行 macOS/Linux 虚拟机,性能接近原生(90%)。
  • AI 代理操作:支持 AI 在虚拟机中操作 macOS 系统及应用(如浏览器、VS Code)。
  • 安全隔离:所有操作在沙盒化的虚拟环境中运行,保护主机系统。
  • 多应用支持:AI 可操控虚拟机内的多种程序,实现复杂工作流。
  • 兼容多种大模型:目前支持 OpenAI、Anthropic CUA 模型,未来还将支持 Ollama 等本地大模型。

安装与使用

Cua 的安装和使用过程简单,专为 macOS 用户优化。以下是详细步骤:

1、安装 Lume(Cua 的虚拟化基础)

/bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"

2、安装cua相关的Python库

pipinstallcua-computercua-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.",
]

fori, taskinenumerate(tasks):
print(f"\nExecuting task {i}/{len(tasks)}: {task}")
asyncforresultinagent.run(task):
# print(result)
pass

print(f"\n✅ Task {i+1}/{len(tasks)} completed: {task}")

启动虚拟机命令:

lumerunmacos-sequoia-vanilla:latest

更多用法和 Notebook 示例见 GitHub 文档,几分钟即可体验 AI 操作 macOS 的乐趣


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ