This is a simple agent that says "Hello World" when executed. You can check out other examples of agent, orchestrator and environment modules using the CLI commands with the Naptha SDK.
Install the Naptha SDK using the instructions here.
You can run your own Naptha node using the instructions here (still private, please reach out if you'd like access).
Create a copy of the .env file:
cp .env.example .env
Choose whether you want to interact with a local Naptha node or a hosted Naptha node. For a local node, set NODE_URL=http://localhost:7001
in the .env file. To use a hosted node, set NODE_URL=http://node.naptha.ai:7001
or NODE_URL=http://node1.naptha.ai:7001
. If using OpenAI, make sure to set the OPENAI_API_KEY
environment variable.
From the official poetry docs:
curl -sSL https://install.python-poetry.org | python3 -
export PATH="/home/$(whoami)/.local/bin:$PATH"
Using the Naptha SDK:
naptha run agent:module_template -p "func_name='func', func_input_data='gm...'"
Before deploying a new or updated module to a Naptha node, you should iterate on improvements with the module locally.
Clone the repo using:
git clone https://github.com/NapthaAI/<module_name>
cd <module_name>
You can install the module using:
poetry install
You can run the module using:
poetry run python <module_name>/run.py
Now you can iterate on the module and commit your changes.
When ready, you can push to your GitHub account or IPFS (or both). Make sure to change the remote origin. Also add a new version number using e.g.:
git tag v0.1
git push --tags
If creating an agent module, you can register it on the Naptha Hub using:
naptha agents agent_name -p "description='Agent description' url='ipfs://QmNer9SRKmJPv4Ae3vdVYo6eFjPcyJ8uZ2rRSYd3koT6jg' type='package' version='0.1'"
If creating an orchestrator module, you can register it on the Naptha Hub using:
naptha orchestrators orchestrator_name -p "description='Orchestrator description' url='ipfs://QmNer9SRKmJPv4Ae3vdVYo6eFjPcyJ8uZ2rRSYd3koT6jg' type='package' version='0.1'"
If creating an environment module, you can register it on the Naptha Hub using:
naptha environments environment_name -p "description='Environment description' url='ipfs://QmNer9SRKmJPv4Ae3vdVYo6eFjPcyJ8uZ2rRSYd3koT6jg' type='package' version='0.1'"
Make sure to replace the placeholder descriptions and URLs with your own.