Skip to content

NapthaAI/hello_world_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello World Agent

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.

Pre-Requisites

Install the Naptha SDK and create .env

Install the Naptha SDK using the instructions here.

(Optional) Run your own Naptha Node

You can run your own Naptha node using the instructions here (still private, please reach out if you'd like access).

Set the environment variables

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.

Install Poetry

From the official poetry docs:

curl -sSL https://install.python-poetry.org | python3 -
export PATH="/home/$(whoami)/.local/bin:$PATH"

Running the Module on a Naptha Node

Using the Naptha SDK:

naptha run agent:module_template -p "func_name='func', func_input_data='gm...'" 

Making Changes to the Module

Before deploying a new or updated module to a Naptha node, you should iterate on improvements with the module locally.

Clone and Install the Module

Clone the repo using:

git clone https://github.com/NapthaAI/<module_name>
cd <module_name>

You can install the module using:

poetry install

Running the Module Locally

You can run the module using:

poetry run python <module_name>/run.py

Now you can iterate on the module and commit your changes.

Register the new or updated Module on the Naptha Hub

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.

About

Agent for printing hello world.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages