From 1cdcc535119653b72c981cb6f414d720f3ed7611 Mon Sep 17 00:00:00 2001 From: alabulei1 Date: Mon, 30 Dec 2024 20:33:31 +0800 Subject: [PATCH] Create eliza.md --- docs/tutorial/eliza.md | 105 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 docs/tutorial/eliza.md diff --git a/docs/tutorial/eliza.md b/docs/tutorial/eliza.md new file mode 100644 index 00000000..00e02198 --- /dev/null +++ b/docs/tutorial/eliza.md @@ -0,0 +1,105 @@ +--- +sidebar_position: 4 +--- + +# Working with eliza + +eliza is a simple, fast, and lightweight AI agent framework. Recently, eliza has integrated Gaia as one of the [model service provider](https://github.com/elizaOS/eliza/pull/762). This means you can now use Gaia as the LLM service backend for the Eliza framework. + +### Build a Trump agent with eliza and Gaia + +This guide demonstrates how to create an agent with Trump-like characteristics using [the Get Started guide from eliza](https://elizaos.github.io/eliza/docs/quickstart/). + +#### Set up the environment + +> Note: Ensure your Node.js version is above 0.23.0 before proceeding. + +Firstly, clone the Eliza repository: + +``` +git clone https://github.com/elizaos/eliza.git +cd eliza +``` + +Next, install the required dependencies. + +``` +pnpm install +``` + +Then, build the local libraries. + +``` +pnpm build +``` + +#### Choose Gaia as the model service provider + +After that, we will need to configure the environment and use a Gaia node as model service provider. + +``` +cp .env.example .env +``` + +Then, edit the `.env` file to include Gaia-related configuration values: + +``` +# Gaianet Configuration +GAIANET_MODEL=llama3b +GAIANET_SERVER_URL=https://llama3b.gaia.domains/v1 + +SMALL_GAIANET_MODEL= # Default: llama3b +SMALL_GAIANET_SERVER_URL= # Default: https://llama3b.gaia.domains/v1 +MEDIUM_GAIANET_MODEL= # Default: llama +MEDIUM_GAIANET_SERVER_URL= # Default: https://llama8b.gaia.domains/v1 +LARGE_GAIANET_MODEL= # Default: qwen72b +LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1 + +GAIANET_EMBEDDING_MODEL=nomic-embed +USE_GAIANET_EMBEDDING=TRUE # Set to TRUE for GAIANET/768, leave blank for local +``` +By using this configuration, the system will utilize the Llama 3b Gaia domain as the LLM backend. You can replace `GAIANET_SERVER_URL` with a URL for your custom node or domain. + +#### Create the Trump agent + +The default character templates are located in the `characters` folder. + +Update the `modelProvider` for the desired character. For Gaia, the provider name is `gaianet`. + +``` + "name": "trump", + "clients": [], + "modelProvider": "gaianet", + "settings": { + "secrets": {}, + "voice": { + "model": "en_US-male-medium" + } + }, + "plugins": [], +``` + +Then, we can use the following command line to start running the agent. + +``` +pnpm run dev --character="characters/trump.character.json" +``` + +After the service runs successfully, we can launch the client UI to interact with the agent: + +``` +pnpm start:client +``` + +Finally, open `http://localhost:5174/` on your browser to start chatting with the agent. +image + + +### Advanced use case + +For more inspiration, refer to[Nader Fabit's example on building a Twitter AI bot](https://x.com/dabit3/status/1863772029565981144). + + + + +