You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+143-4
Original file line number
Diff line number
Diff line change
@@ -48,10 +48,14 @@ Options:
48
48
--help Show this message and exit.
49
49
50
50
Commands:
51
-
interact Interact with a mech specifying a prompt and tool.
52
-
prompt-to-ipfs Upload a prompt and tool to IPFS as metadata.
53
-
push-to-ipfs Upload a file to IPFS.
54
-
to-png Convert a stability AI API's diffusion model output...
51
+
interact Interact with a mech specifying a prompt and tool.
52
+
prompt-to-ipfs Upload a prompt and tool to IPFS as metadata.
53
+
push-to-ipfs Upload a file to IPFS.
54
+
to-png Convert a stability AI API's diffusion model output.
55
+
tools-for-agents List tools available for all agents or a specific agent.
56
+
tool-description Get the description of a specific tool.
57
+
tool_io_schema Get the input/output schema of a specific tool.
58
+
55
59
```
56
60
57
61
### Set up the EOA and private key
@@ -152,6 +156,102 @@ Data arrived: https://gateway.autonolas.tech/ipfs/f01701220a462120d5bb03f406fa5e
152
156
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'}}
153
157
```
154
158
159
+
160
+
### List tools available for agents
161
+
162
+
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.
>**If you encounter an "Out of gas" error when executing the Mech Client, you will need to increase the gas limit, e.g.,**
157
257
>
@@ -214,6 +314,45 @@ You can also use the Mech Client as a library on your Python project.
214
314
print(result)
215
315
```
216
316
317
+
You can also use the Mech Client to programmatically fetch tools foragentsin your Python project, as well as retrieve descriptions and input/output schemas for specific tools given their unique identifier.
318
+
319
+
1. Set up the private key as specified [above](#set-up-the-private-key). Store the resulting key file (e.g., `ethereum_private_key.txt`) in a convenient and secure location.
320
+
321
+
2. Create a Python script `fetch_tools_script.py`:
322
+
323
+
```bash
324
+
touch fetch_tools_script.py
325
+
```
326
+
327
+
3. Edit `fetch_tools_script.py` as follows:
328
+
329
+
```python
330
+
from mech_client.mech_tool_management import get_tools_for_agents, get_tool_description, get_tool_io_schema
331
+
332
+
# Fetching tools for a specific agent or all agents
333
+
agent_id = 6 # Specify the agent ID or set to None to fetch tools for all agents
334
+
chain_config = "gnosis" # Specify the chain configuration
0 commit comments