安装 SDK
将最新发布的 Go 模块加入应用。
Go 工具链要求以所选发布版本的 go.mod 为准。
go get github.com/caelis-labs/acp-go-sdk@latest使用 acp 作为根包别名:
import acp "github.com/caelis-labs/acp-go-sdk"Go 模块版本、schema 版本与协商的 wire protocol 版本是不同的标识。上面的指令获取最新模块版本,并将实际选中的版本记录到项目的 go.mod。
运行完整示例
Section titled “运行完整示例”下面单独检出的示例使用已审核的文档提交,便于复现;它与上面安装到应用中的最新模块分开。
git clone https://github.com/caelis-labs/acp-go-sdk.gitcd acp-go-sdkgit checkout ed838d76cc0bca458732e15a457235c55a4d6642go build -o .artifacts/minimal-agent ./example/minimal-agentgo run ./example/client -agent ./.artifacts/minimal-agent预期输出包含 Hello from the minimal Go ACP agent.,并以 end_turn 结束。
Windows 上请构建 .artifacts/minimal-agent.exe,并将该路径传给 -agent。
依据公开项目文档整理acp-go-sdk · ed838d7 ↗