Amp 发布自定义 Agent 功能,支持插件与线程交互
Custom Agents - Amp
Amp 推出自定义 Agent 功能,用户可通过插件创建自定义 Agent,用作主 Agent、子 Agent 或工具管道的一部分。每个自定义 Agent 配有自定义 orb 颜色,并可通过 Thread 对象进行消息发送和响应等待。
正文
当前显示原文,中文全文译文尚未就绪。
You can now create custom agents in Amp with plugins.
You can use these custom agents as your main Amp agent, or as subagents. You can use them as a small part of a tool pipeline that you invoke with amp -x. Or you can spawn 25 custom worker agents, then switch between them.
Each custom agent comes with a custom orb color.
Here is how you define a custom agent in an Amp plugin:
Threads
Once you have defined an agent, you can create threads:
The Thread object lets you interact with a thread in many different ways, and is where the real power comes in.
Send a message to a Thread
Add a new user message to a thread by calling thread.appendUserMessage(). The call returns as soon as Amp has accepted the message; it does not wait for inference to complete before returning.
Wait for the Agent's response
When you do want to wait, call waitForResponse() on the thread. It resolves with the next assistant message after the agent finishes its turn.
Example: Spawn an async thread that responds to the main thread
These are just a few primitives provided by the Plugin API. Together, they compose into unique workflows. An example used on the Amp team: spawn an agent in an asynchronous thread, and give it the tools it needs to respond to the parent when it needs to.
Full documentation is in the manual. Happy Hacking.
Plugins, Everywhere
Plugin UI is now available on the web and synced with your TUI