mech-client 0.4.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mech_client-0.4.0 → mech_client-0.7.0}/PKG-INFO +53 -19
- {mech_client-0.4.0 → mech_client-0.7.0}/README.md +51 -18
- mech_client-0.7.0/mech_client/__init__.py +3 -0
- mech_client-0.7.0/mech_client/abis/AgentMech.json +718 -0
- mech_client-0.7.0/mech_client/abis/AgentRegistry.json +1037 -0
- mech_client-0.7.0/mech_client/abis/AgreementStoreManager.base.json +766 -0
- mech_client-0.7.0/mech_client/abis/AgreementStoreManager.gnosis.json +766 -0
- mech_client-0.7.0/mech_client/abis/DIDRegistry.base.json +2476 -0
- mech_client-0.7.0/mech_client/abis/DIDRegistry.gnosis.json +2476 -0
- mech_client-0.7.0/mech_client/abis/EscrowPaymentCondition.base.json +717 -0
- mech_client-0.7.0/mech_client/abis/EscrowPaymentCondition.gnosis.json +717 -0
- mech_client-0.7.0/mech_client/abis/LockPaymentCondition.base.json +874 -0
- mech_client-0.7.0/mech_client/abis/LockPaymentCondition.gnosis.json +874 -0
- mech_client-0.7.0/mech_client/abis/NFTSalesTemplate.base.json +698 -0
- mech_client-0.7.0/mech_client/abis/NFTSalesTemplate.gnosis.json +698 -0
- mech_client-0.7.0/mech_client/abis/NeverminedConfig.base.json +587 -0
- mech_client-0.7.0/mech_client/abis/NeverminedConfig.gnosis.json +587 -0
- mech_client-0.7.0/mech_client/abis/SubscriptionNFT.base.json +300 -0
- mech_client-0.7.0/mech_client/abis/SubscriptionNFT.gnosis.json +300 -0
- mech_client-0.7.0/mech_client/abis/SubscriptionProvider.base.json +294 -0
- mech_client-0.7.0/mech_client/abis/SubscriptionProvider.gnosis.json +294 -0
- mech_client-0.7.0/mech_client/abis/SubscriptionToken.base.json +1393 -0
- mech_client-0.7.0/mech_client/abis/TransferNFTCondition.base.json +1062 -0
- mech_client-0.7.0/mech_client/abis/TransferNFTCondition.gnosis.json +1062 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/cli.py +99 -10
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/configs/mechs.json +1 -7
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/interact.py +14 -39
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/marketplace_interact.py +130 -90
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/mech_tool_management.py +11 -5
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/subgraph.py +21 -35
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/wss.py +7 -6
- {mech_client-0.4.0 → mech_client-0.7.0}/pyproject.toml +2 -1
- mech_client-0.4.0/mech_client/__init__.py +0 -3
- {mech_client-0.4.0 → mech_client-0.7.0}/LICENSE +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/BalanceTrackerFixedPriceNative.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/BalanceTrackerFixedPriceToken.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/BalanceTrackerNvmSubscriptionNative.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/BalanceTrackerNvmSubscriptionToken.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/IERC1155.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/IMech.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/IToken.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/abis/MechMarketplace.json +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/acn.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/fetch_ipfs_hash.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/__init__.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/README.md +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/__init__.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/acn.proto +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/acn_pb2.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/custom_types.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/dialogues.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/message.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/protocol.yaml +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/serialization.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/tests/__init__.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/tests/test_acn.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/tests/test_acn_dialogues.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn/tests/test_acn_messages.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/README.md +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/__init__.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/acn_data_share.proto +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/acn_data_share_pb2.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/dialogues.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/message.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/protocol.yaml +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/serialization.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_dialogues.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_messages.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/p2p_libp2p_client/README.md +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/p2p_libp2p_client/__init__.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/p2p_libp2p_client/connection.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/helpers/p2p_libp2p_client/connection.yaml +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/prompt_to_ipfs.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/push_to_ipfs.py +0 -0
- {mech_client-0.4.0 → mech_client-0.7.0}/mech_client/to_png.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mech-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Basic client to interact with a mech
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: David Minarsch
|
|
@@ -16,6 +16,7 @@ Requires-Dist: open-aea-cli-ipfs (>=1.53.0,<2.0.0)
|
|
|
16
16
|
Requires-Dist: open-aea-ledger-cosmos (>=1.53.0,<2.0.0)
|
|
17
17
|
Requires-Dist: open-aea-ledger-ethereum (>=1.53.0,<2.0.0)
|
|
18
18
|
Requires-Dist: open-aea[cli] (>=1.53.0,<2.0.0)
|
|
19
|
+
Requires-Dist: setuptools (>=77.0.3,<78.0.0)
|
|
19
20
|
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
|
20
21
|
Requires-Dist: websocket-client (>=0.32.0,<1)
|
|
21
22
|
Description-Content-Type: text/markdown
|
|
@@ -115,12 +116,6 @@ The EOA you use must have enough funds to pay for the Mech requests, or alternat
|
|
|
115
116
|
> echo ethereum_private_key.txt >> .gitignore
|
|
116
117
|
> ```
|
|
117
118
|
|
|
118
|
-
### Select the mech you are going to send requests to
|
|
119
|
-
|
|
120
|
-
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_.
|
|
121
|
-
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).
|
|
122
|
-
|
|
123
|
-
|
|
124
119
|
### API Keys
|
|
125
120
|
|
|
126
121
|
In order to fetch on-chain data for Gnosis and Base, mech client requires an API key from a blockchain data provider. You can find them here for [GnosisScan](https://gnosisscan.io/) and [BaseScan](https://basescan.org/). Follow these steps to generate your API key if you are planning to use mech client for gnosis and base:
|
|
@@ -138,20 +133,27 @@ export MECHX_API_KEY=<your api key>
|
|
|
138
133
|
|
|
139
134
|
### Generate Mech requests
|
|
140
135
|
|
|
136
|
+
#### Select the mech you are going to send requests to
|
|
137
|
+
|
|
138
|
+
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_.
|
|
139
|
+
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, you can find more available Mechs [here](https://mech.olas.network/) (click on the tab "Legacy Mech" in order to see Legacy Mech (available only on Gnosis) and "Mech Marketplace" for the ones which receive requests via the Mech Marketplace).
|
|
140
|
+
|
|
141
141
|
#### Legacy Mechs
|
|
142
142
|
|
|
143
143
|
The basic usage of the Mech Client is as follows:
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
|
-
mechx interact <prompt> --agent_id <agent_id>
|
|
146
|
+
mechx interact --prompts <prompt> --tools <tool> --agent_id <agent_id>
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
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).
|
|
149
|
+
where agent with `<agent_id>` will process `<prompt>` with the `<tool>` and 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).
|
|
150
|
+
|
|
151
|
+
⚠️ Batch requests and tools are not supported for legacy mechs
|
|
150
152
|
|
|
151
153
|
Some useful options:
|
|
152
154
|
|
|
153
155
|
- `--key <private_key_path>`: Specifies the path of the private key. The default value is `./ethereum_private_key.txt`.
|
|
154
|
-
- `--
|
|
156
|
+
- `--tools <name>`: Name of the tool to process the prompt. If you are aware about the tools that are provided by an agent you can directly provide its name using this option. If not provided, it will show a list of available tools for the agent so that you can select which one you want to use:
|
|
155
157
|
|
|
156
158
|
```text
|
|
157
159
|
Select prompting tool
|
|
@@ -177,12 +179,12 @@ Some useful options:
|
|
|
177
179
|
- `on-chain`: Wait for the result using the Subgraph and the Websocket subscription (whichever arrives first).
|
|
178
180
|
- `wait-for-both` (Default): Wait for the result using both `off-chain` and `on-chain` (whichever arrives first).
|
|
179
181
|
|
|
180
|
-
|
|
182
|
+
##### Example
|
|
181
183
|
|
|
182
184
|
Example of a request specifying a key file and tool:
|
|
183
185
|
|
|
184
186
|
```bash
|
|
185
|
-
mechx interact "write a short poem" --agent_id 6 --key ~/ethereum_private_key.txt --
|
|
187
|
+
mechx interact --prompts "write a short poem" --agent_id 6 --key ~/ethereum_private_key.txt --tools openai-gpt-3.5-turbo --chain-config gnosis --confirm on-chain
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
You will see an output like this:
|
|
@@ -199,23 +201,56 @@ Data from agent: {'requestId': 1004074058566339663950817114309409628095686850319
|
|
|
199
201
|
|
|
200
202
|
#### With the Mech Marketplace
|
|
201
203
|
|
|
202
|
-
With the Mech Marketplace,
|
|
204
|
+
With the Mech Marketplace, in order to pay for the Mech fees, you can make a deposit before sending requests. The deposit depends on the
|
|
205
|
+
payment model of the Mech. For a fixed price Mech receiving payments in native token, use the following:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
mechx deposit-native --chain-config <chain_config> <amount>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
For a fixed price Mech receiving payments in OLAS, use the following (the amount is in ether):
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
mechx deposit-token --chain-config <chain_config> <amount>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
For a Mech using Nevermined subscriptions, to make requests, it is necessary to buy a subscription. To do that you can use the following command:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
mechx purchase-nvm-subscription --chain-config <chain_config>
|
|
221
|
+
```
|
|
203
222
|
|
|
223
|
+
⚠️ To ensure optimal performance and reliability when using `purchase-nvm-subscription`, it is advisable to use a custom RPC provider as public RPC endpoints may be rate-limited or unreliable under high usage. You can configure your custom RPC URL in your environment variables using
|
|
204
224
|
```bash
|
|
205
|
-
|
|
225
|
+
export MECHX_CHAIN_RPC=
|
|
206
226
|
```
|
|
207
227
|
|
|
208
|
-
|
|
228
|
+
You can use the option `--key <private_key_file_path>` in order to customize the path to the private key file.
|
|
229
|
+
|
|
230
|
+
The basic usage of the Mech Client is then as follows.
|
|
209
231
|
|
|
210
232
|
```bash
|
|
211
|
-
mechx interact <prompt> --priority-mech <priority mech address> --
|
|
233
|
+
mechx interact --prompts <prompt> --priority-mech <priority mech address> --tools openai-gpt-3.5-turbo --chain-config <chain_config>
|
|
212
234
|
```
|
|
213
235
|
|
|
214
236
|
Additionally to other options which are the same as for legacy Mechs, this usage has the following option:
|
|
215
237
|
|
|
216
|
-
`--use-prepaid <bool>`: use the prepaid method to send requests to a Mech via the Mech Marketplace. Defaults to False.
|
|
238
|
+
`--use-prepaid <bool>`: use the prepaid method to send requests to a Mech via the Mech Marketplace. Defaults to False. <br>
|
|
217
239
|
`--use-offchain <bool>`: use the off-chain method to send requests to a Mech via the Mech Marketplace. Defaults to False.
|
|
218
240
|
|
|
241
|
+
The Mech Client can also be used to send batch requests. There are couple of different ways to achieve this:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
mechx interact --prompts={<prompt-1>,<prompt-2>} --priority-mech <priority mech address> --tools={<tool-1>,<tool-2>} --chain-config <chain_config>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
or <br>
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
mechx interact --prompts <prompt-1> --prompts <prompt-2> --priority-mech <priority mech address> --tools <tool-1> --tools <tool-2> --chain-config <chain_config>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
|
|
219
254
|
### List tools available for agents
|
|
220
255
|
|
|
221
256
|
To list the tools available for a specific agent or for all agents, use the `tools-for-agents` command. You can specify an agent ID to get tools for a specific agent, or omit it to list tools for all agents.
|
|
@@ -336,7 +371,6 @@ Additionally, you can override any configuration parameter by exporting any of t
|
|
|
336
371
|
MECHX_CHAIN_RPC
|
|
337
372
|
MECHX_WSS_ENDPOINT
|
|
338
373
|
MECHX_GAS_LIMIT
|
|
339
|
-
MECHX_CONTRACT_ABI_URL
|
|
340
374
|
MECHX_TRANSACTION_URL
|
|
341
375
|
MECHX_SUBGRAPH_URL
|
|
342
376
|
|
|
@@ -476,7 +510,7 @@ You can find the agent IDs for each chain on the [Mech Hub](https://aimechs.auto
|
|
|
476
510
|
Use the `--chain-config <name>` parameter together with a valid `<agent_id>`, for example:
|
|
477
511
|
|
|
478
512
|
```bash
|
|
479
|
-
mechx interact "write a short poem" 2 --key ./ethereum_private_key.txt --
|
|
513
|
+
mechx interact --prompts "write a short poem" --agent_id 2 --key ./ethereum_private_key.txt --tools openai-gpt-4 --chain-config celo --confirm on-chain
|
|
480
514
|
```
|
|
481
515
|
|
|
482
516
|
</details>
|
|
@@ -93,12 +93,6 @@ The EOA you use must have enough funds to pay for the Mech requests, or alternat
|
|
|
93
93
|
> echo ethereum_private_key.txt >> .gitignore
|
|
94
94
|
> ```
|
|
95
95
|
|
|
96
|
-
### Select the mech you are going to send requests to
|
|
97
|
-
|
|
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).
|
|
100
|
-
|
|
101
|
-
|
|
102
96
|
### API Keys
|
|
103
97
|
|
|
104
98
|
In order to fetch on-chain data for Gnosis and Base, mech client requires an API key from a blockchain data provider. You can find them here for [GnosisScan](https://gnosisscan.io/) and [BaseScan](https://basescan.org/). Follow these steps to generate your API key if you are planning to use mech client for gnosis and base:
|
|
@@ -116,20 +110,27 @@ export MECHX_API_KEY=<your api key>
|
|
|
116
110
|
|
|
117
111
|
### Generate Mech requests
|
|
118
112
|
|
|
113
|
+
#### Select the mech you are going to send requests to
|
|
114
|
+
|
|
115
|
+
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_.
|
|
116
|
+
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, you can find more available Mechs [here](https://mech.olas.network/) (click on the tab "Legacy Mech" in order to see Legacy Mech (available only on Gnosis) and "Mech Marketplace" for the ones which receive requests via the Mech Marketplace).
|
|
117
|
+
|
|
119
118
|
#### Legacy Mechs
|
|
120
119
|
|
|
121
120
|
The basic usage of the Mech Client is as follows:
|
|
122
121
|
|
|
123
122
|
```bash
|
|
124
|
-
mechx interact <prompt> --agent_id <agent_id>
|
|
123
|
+
mechx interact --prompts <prompt> --tools <tool> --agent_id <agent_id>
|
|
125
124
|
```
|
|
126
125
|
|
|
127
|
-
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).
|
|
126
|
+
where agent with `<agent_id>` will process `<prompt>` with the `<tool>` and 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).
|
|
127
|
+
|
|
128
|
+
⚠️ Batch requests and tools are not supported for legacy mechs
|
|
128
129
|
|
|
129
130
|
Some useful options:
|
|
130
131
|
|
|
131
132
|
- `--key <private_key_path>`: Specifies the path of the private key. The default value is `./ethereum_private_key.txt`.
|
|
132
|
-
- `--
|
|
133
|
+
- `--tools <name>`: Name of the tool to process the prompt. If you are aware about the tools that are provided by an agent you can directly provide its name using this option. If not provided, it will show a list of available tools for the agent so that you can select which one you want to use:
|
|
133
134
|
|
|
134
135
|
```text
|
|
135
136
|
Select prompting tool
|
|
@@ -155,12 +156,12 @@ Some useful options:
|
|
|
155
156
|
- `on-chain`: Wait for the result using the Subgraph and the Websocket subscription (whichever arrives first).
|
|
156
157
|
- `wait-for-both` (Default): Wait for the result using both `off-chain` and `on-chain` (whichever arrives first).
|
|
157
158
|
|
|
158
|
-
|
|
159
|
+
##### Example
|
|
159
160
|
|
|
160
161
|
Example of a request specifying a key file and tool:
|
|
161
162
|
|
|
162
163
|
```bash
|
|
163
|
-
mechx interact "write a short poem" --agent_id 6 --key ~/ethereum_private_key.txt --
|
|
164
|
+
mechx interact --prompts "write a short poem" --agent_id 6 --key ~/ethereum_private_key.txt --tools openai-gpt-3.5-turbo --chain-config gnosis --confirm on-chain
|
|
164
165
|
```
|
|
165
166
|
|
|
166
167
|
You will see an output like this:
|
|
@@ -177,23 +178,56 @@ Data from agent: {'requestId': 1004074058566339663950817114309409628095686850319
|
|
|
177
178
|
|
|
178
179
|
#### With the Mech Marketplace
|
|
179
180
|
|
|
180
|
-
With the Mech Marketplace,
|
|
181
|
+
With the Mech Marketplace, in order to pay for the Mech fees, you can make a deposit before sending requests. The deposit depends on the
|
|
182
|
+
payment model of the Mech. For a fixed price Mech receiving payments in native token, use the following:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
mechx deposit-native --chain-config <chain_config> <amount>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
For a fixed price Mech receiving payments in OLAS, use the following (the amount is in ether):
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
mechx deposit-token --chain-config <chain_config> <amount>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
For a Mech using Nevermined subscriptions, to make requests, it is necessary to buy a subscription. To do that you can use the following command:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
mechx purchase-nvm-subscription --chain-config <chain_config>
|
|
198
|
+
```
|
|
181
199
|
|
|
200
|
+
⚠️ To ensure optimal performance and reliability when using `purchase-nvm-subscription`, it is advisable to use a custom RPC provider as public RPC endpoints may be rate-limited or unreliable under high usage. You can configure your custom RPC URL in your environment variables using
|
|
182
201
|
```bash
|
|
183
|
-
|
|
202
|
+
export MECHX_CHAIN_RPC=
|
|
184
203
|
```
|
|
185
204
|
|
|
186
|
-
|
|
205
|
+
You can use the option `--key <private_key_file_path>` in order to customize the path to the private key file.
|
|
206
|
+
|
|
207
|
+
The basic usage of the Mech Client is then as follows.
|
|
187
208
|
|
|
188
209
|
```bash
|
|
189
|
-
mechx interact <prompt> --priority-mech <priority mech address> --
|
|
210
|
+
mechx interact --prompts <prompt> --priority-mech <priority mech address> --tools openai-gpt-3.5-turbo --chain-config <chain_config>
|
|
190
211
|
```
|
|
191
212
|
|
|
192
213
|
Additionally to other options which are the same as for legacy Mechs, this usage has the following option:
|
|
193
214
|
|
|
194
|
-
`--use-prepaid <bool>`: use the prepaid method to send requests to a Mech via the Mech Marketplace. Defaults to False.
|
|
215
|
+
`--use-prepaid <bool>`: use the prepaid method to send requests to a Mech via the Mech Marketplace. Defaults to False. <br>
|
|
195
216
|
`--use-offchain <bool>`: use the off-chain method to send requests to a Mech via the Mech Marketplace. Defaults to False.
|
|
196
217
|
|
|
218
|
+
The Mech Client can also be used to send batch requests. There are couple of different ways to achieve this:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
mechx interact --prompts={<prompt-1>,<prompt-2>} --priority-mech <priority mech address> --tools={<tool-1>,<tool-2>} --chain-config <chain_config>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
or <br>
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
mechx interact --prompts <prompt-1> --prompts <prompt-2> --priority-mech <priority mech address> --tools <tool-1> --tools <tool-2> --chain-config <chain_config>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
|
|
197
231
|
### List tools available for agents
|
|
198
232
|
|
|
199
233
|
To list the tools available for a specific agent or for all agents, use the `tools-for-agents` command. You can specify an agent ID to get tools for a specific agent, or omit it to list tools for all agents.
|
|
@@ -314,7 +348,6 @@ Additionally, you can override any configuration parameter by exporting any of t
|
|
|
314
348
|
MECHX_CHAIN_RPC
|
|
315
349
|
MECHX_WSS_ENDPOINT
|
|
316
350
|
MECHX_GAS_LIMIT
|
|
317
|
-
MECHX_CONTRACT_ABI_URL
|
|
318
351
|
MECHX_TRANSACTION_URL
|
|
319
352
|
MECHX_SUBGRAPH_URL
|
|
320
353
|
|
|
@@ -454,7 +487,7 @@ You can find the agent IDs for each chain on the [Mech Hub](https://aimechs.auto
|
|
|
454
487
|
Use the `--chain-config <name>` parameter together with a valid `<agent_id>`, for example:
|
|
455
488
|
|
|
456
489
|
```bash
|
|
457
|
-
mechx interact "write a short poem" 2 --key ./ethereum_private_key.txt --
|
|
490
|
+
mechx interact --prompts "write a short poem" --agent_id 2 --key ./ethereum_private_key.txt --tools openai-gpt-4 --chain-config celo --confirm on-chain
|
|
458
491
|
```
|
|
459
492
|
|
|
460
493
|
</details>
|