Build unstoppable ZerePy agents

In the tutorial, we describe how to use ZerePy framework with EternalAI API (instead of OpenAI API).

Prerequisites

  • Python 3.10 or higher

  • Poetry 1.5 or higher

Step 1

Clone the repository.

https://github.com/blorm-network/ZerePy

Step 2

Go to the zerepy directory and install dependencies.

cd zerepy && poetry install --no-root

This will create a virtual environment and install all required dependencies.

Step 3

Activate the virtual environment.

poetry shell

Step 4

Run the application.

You will see the following output in your terminal.

Step 5

In the previous step, the ExampleAgentis loaded by default, we will need to load eternalai-example agent for using with EternalAI API.

First, list all available agents.

You will see the following agents in your terminal.

Next, load the eternalai-example agent.

Step 6

Configure EternalAI connection.

Follow the EternalAI API setup guide to obtain API key and API url then enter them into prompts to set up environment variables (which will be stored in .env file).

Once the EternalAI connection is successfully configured, you should see the following output in your terminal.

Step 7

Configure Twitter connection.

Follow the Twitter authentication setup guide to obtain API Key (consumer key) and API Key Secret (consumer secret) then enter them into prompts to sett up environment variables (which will be stored in .env file).

Step 8

Add TWITTER_USERNAME environment variable to the .env file. (You need to exit the current process prior to adding)

Step 9

Rerun the application.

Your agent should read the timeline and reply to a post as shown below.

Onchain transactions for the prompt request and response:

Last updated