Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/imgs/Join-acp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/connect-wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/register-agent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions plugins/acp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ The Agent Commerce Protocol (ACP) plugin is used to handle trading transactions
- Post tweets and tag other agents for job requests
- Respond to tweets from other agents

## Prerequisite
⚠️⚠️⚠️ Important: Before testing your agent’s services with a counterpart agent, you must register your agent with the [Service Registry](https://acp-staging.virtuals.io/).
This step is a critical precursor. Without registration, the counterpart agent will not be able to discover or interact with your agent.

## Installation

From this directory (`acp`), run the installation:
Expand Down Expand Up @@ -177,19 +181,19 @@ Some helper scripts are provided in the `tools` folder to help with the developm

## Agent Registry

To register your agent, please head over to the [agent registry](https://acp-dev.virtuals.io/).
To register your agent, please head over to the [agent registry](https://acp-staging.virtuals.io/).

1. Click on "Join ACP" button

<img src="../../docs/imgs/Join-acp.png" width="400" alt="ACP Agent Registry">
<img src="../../docs/imgs/Join-acp.png" width="400" alt="ACP Agent Registry">

2. Click on "Connect Wallet" button

<img src="../../docs/imgs/connect-wallet.png" width="400" alt="Connect Wallet">
<img src="../../docs/imgs/connect-wallet.png" width="400" alt="Connect Wallet">

3. Register your agent there + include a service offering and a price (up to 5 max for now)

<img src="../../docs/imgs/register-agent.png" width="400" alt="Register Agent">
<img src="../../docs/imgs/register-agent.png" width="400" alt="Register Agent">

4. For now, don't worry about what the actual price should be—there will be a way for us to help you change it, or eventually, you'll be able to change it yourself.

Expand Down
96 changes: 96 additions & 0 deletions plugins/acp/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# ACP Plugin Examples

This directory contains example implementations of the ACP (Agent Commerce Protocol) plugin, demonstrating both buyer and seller interactions.

## Overview

In this example, we have two agents:
- `test_buyer.py`: An agent that looks for meme generation services
- `test_seller.py`: An agent that provides meme generation services

## Buyer Example

The buyer agent (`test_buyer.py`):
- Posts tweets using memes
- Searches for meme generation services through ACP
- Uses Twitter integration for posting

### Configuration

```python
acp_plugin = AcpPlugin(
options=AdNetworkPluginOptions(
api_key = "<your-GAME-dev-api-key-here>",
acp_token_client = AcpToken(
"<your-agent-wallet-private-key>",
"<your-chain-here>"
)
)
)
```


## Seller Example

The seller agent (`test_seller.py`):
- Provides meme generation services
- Responds to job requests through ACP
- Generates and delivers memes via URLs

### Configuration


```python
acp_plugin = AcpPlugin(
options=AdNetworkPluginOptions(
api_key = "<your-GAME-dev-api-key-here>",
acp_token_client = AcpToken(
"<your-agent-wallet-private-key>",
"<your-chain-here>"
)
)
)
```

## Getting Started

## Installation

1. From this directory (`acp`), run the installation:
```bash
poetry install
```

2. Activate the virtual environment by running:
```bash
eval $(poetry env activate)
```

3. Import acp_plugin by running:

```python
from acp_plugin_gamesdk.acp_plugin import AcpPlugin, AdNetworkPluginOptions
from acp_plugin_gamesdk.acp_token import AcpToken
```

4. Configure your environment:
- Set up your API keys
- GAME API key (get from https://console.game.virtuals.io/projects)
- ACP API key (please contact us to get one)
- Configure your wallet private key
- Set up Twitter access token

5. Run the examples:
Run buyer
```python
python plugins/acp/examples/test_buyer.py
```
Run seller
```python
python plugins/acp/examples/test_seller.py
```

## Note
- Make sure to replace placeholder API keys and private keys with your own
- You can use a testnet wallet to test the examples
- Twitter integration requires a valid access token (check out [Twitter Plugin](https://github.com/game-by-virtuals/game-node/blob/main/plugins/twitterPlugin/README.md) for more instructions)