Skip to content

Commit 6adb0f9

Browse files
authored
Merge pull request #69 from valory-xyz/update-doc
Update doc
2 parents b6c1461 + dcb0596 commit 6adb0f9

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

README.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@ The EOA you use must have enough funds to pay for the Mech requests, or alternat
9595

9696
### Select the mech you are going to send requests to
9797

98-
Mechs are deployed to several networks. Find the list of supported networks and corresponging mech addresses [here](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
98+
Mechs can receive requests via the [Mech Marketplace](https://github.com/valory-xyz/ai-registry-mech/) or directly. We call the last ones _Legacy Mechs_.
99+
Mechs are deployed on several networks. Find the list of supported networks and corresponding mech addresses [here](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs). Additionally, on Gnosis you can find more available Mechs [here](https://mech.olas.network/) (click on the tab "Legacy Mech" in order to see Legacy Mech and "Mech Marketplace" for the ones which receive requests via the Mech Marketplace).
99100

100101
### Generate Mech requests
101102

103+
#### Legacy Mechs
104+
102105
The basic usage of the Mech Client is as follows:
103106

104107
```bash
105-
mechx interact <prompt> <agent_id>
108+
mechx interact <prompt> --agent_id <agent_id>
106109
```
107110

108111
where agent with `<agent_id>` will process `<prompt>` with the default options. Each chain has its own set of Mech agents. You can find the agent IDs for each chain on the [Mech Hub](https://aimechs.autonolas.network/registry) or on the [Mech repository](https://github.com/valory-xyz/mech?tab=readme-ov-file#examples-of-deployed-mechs).
@@ -141,7 +144,7 @@ Some useful options:
141144
Example of a request specifying a key file and tool:
142145

143146
```bash
144-
mechx interact "write a short poem" 6 --key ~/ethereum_private_key.txt --tool openai-gpt-3.5-turbo --chain-config gnosis --confirm on-chain
147+
mechx interact "write a short poem" --agent_id 6 --key ~/ethereum_private_key.txt --tool openai-gpt-3.5-turbo --chain-config gnosis --confirm on-chain
145148
```
146149

147150
You will see an output like this:
@@ -156,6 +159,17 @@ Data arrived: https://gateway.autonolas.tech/ipfs/f01701220a462120d5bb03f406fa5e
156159
Data from agent: {'requestId': 100407405856633966395081711430940962809568685031934329025999216833965518452765, 'result': "In a world of chaos and strife,\nThere's beauty in the simplest of life.\nA gentle breeze whispers through the trees,\nAnd birds sing melodies with ease.\n\nThe sun sets in a fiery hue,\nPainting the sky in shades of blue.\nStars twinkle in the darkness above,\nGuiding us with their light and love.\n\nSo take a moment to pause and see,\nThe wonders of this world so free.\nEmbrace the joy that each day brings,\nAnd let your heart soar on gentle wings.", 'prompt': 'write a short poem', 'cost_dict': {}, 'metadata': {'model': None, 'tool': 'openai-gpt-3.5-turbo'}}
157160
```
158161

162+
#### With the Mech Marketplace
163+
164+
With the Mech Marketplace, the basic usage of the Mech Client is as follows.
165+
166+
```bash
167+
mechx interact <prompt> --chain-config <chain_config>
168+
```
169+
170+
The Mech agent which corresponds to the `priority_mech_address` in `<chain_config>` will process `<prompt>` with the default options. Additionally to other options which are the same as for legacy Mechs, this usage has the following option:
171+
172+
`--use-offchain <bool>`: use the off-chain method to send requests to a Mech via the Mech Marketplace. Set to False in order to use the on-chain method.
159173

160174
### List tools available for agents
161175

@@ -267,6 +281,8 @@ Output Schema:
267281

268282
### Chain configuration
269283

284+
#### For legacy Mechs
285+
270286
Default configurations for different chains are stored in the file [configs/mechs.json](./mech_client/configs/mechs.json). If `--chain-config` parameter is not specified, the Mech Client will choose the first configuration on the JSON.
271287

272288
Additionally, you can override any configuration parameter by exporting any of the following environment variables:
@@ -359,6 +375,11 @@ This script will:
359375
- Retrieve and display the description of a specific tool using its unique identifier.
360376
- Retrieve and display the input and output schema of a specific tool using its unique identifier.
361377

378+
#### For Mechs receiving requests via the Mech Marketplace
379+
380+
In this case, the script is the same, except for the function result. When this function has no argument agent_id,
381+
the request is sent to the Mech Marketplace. The target Mech to which the request is relayed should be in the chain_config file (key `priority_mech_address`).
382+
362383
## Developer installation
363384

364385
To setup the development environment for this project, clone the repository and run the following commands:

0 commit comments

Comments
 (0)