Skip to content

Commit 2629806

Browse files
committed
Merge branch 'main' of https://github.com/ai16z/eliza into HEAD
2 parents 04c62f0 + 6f88148 commit 2629806

15 files changed

+1092
-1036
lines changed

README.md

+64-45
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Eliza
22

3-
<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
3+
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
44

55
_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_
66

@@ -17,24 +17,35 @@ _As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAInd
1717

1818
# Getting Started
1919

20-
## Install Node.js
20+
**Prerequisites (MUST):**
2121

22-
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
22+
- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
23+
- [pnpm](https://pnpm.io/installation)
2324

24-
## Using pnpm
25-
26-
We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces.
27-
https://pnpm.io/installation
28-
29-
## Edit the .env file
25+
### Edit the .env file
3026

3127
- Copy .env.example to .env and fill in the appropriate values
3228
- Edit the TWITTER environment variables to add your bot's username and password
3329

34-
## Edit the character file
30+
### Edit the character file
3531

3632
- Check out the file `src/core/defaultCharacter.ts` - you can modify this
37-
- You can also load characters with the `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` and run multiple bots at the same time.
33+
- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time.
34+
35+
After setting up the .env file and character file, you can start the bot with the following command:
36+
37+
```
38+
pnpm i
39+
pnpm start
40+
```
41+
42+
# Customising Eliza
43+
44+
### Adding custom actions
45+
46+
To avoid git clashes in the core directory, we recommend adding custom actions to a `custom_actions` directory and then adding them to the `elizaConfig.yaml` file. See the `elizaConfig.example.yaml` file for an example.
47+
48+
## Running with different models
3849

3950
### Run with Llama
4051

@@ -48,10 +59,6 @@ You can run Grok models by setting the `XAI_MODEL` environment variable to `grok
4859

4960
You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o`
5061

51-
# Requires Node 20+
52-
53-
If you are getting strange issues when starting up, make sure you're using Node 20+. Some APIs are not compatible with previous versions. You can check your node version with `node -v`. If you need to install a new version of node, we recommend using [nvm](https://github.com/nvm-sh/nvm).
54-
5562
## Additional Requirements
5663

5764
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
@@ -66,20 +73,55 @@ You will need to add environment variables to your .env file to connect to vario
6673

6774
```
6875
# Required environment variables
69-
# Start Discord
7076
DISCORD_APPLICATION_ID=
7177
DISCORD_API_TOKEN= # Bot token
78+
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
79+
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
7280
73-
# Start Twitter
81+
# ELEVENLABS SETTINGS
82+
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
83+
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
84+
ELEVENLABS_VOICE_STABILITY=0.5
85+
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
86+
ELEVENLABS_VOICE_STYLE=0.66
87+
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
88+
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
89+
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
90+
91+
TWITTER_DRY_RUN=false
7492
TWITTER_USERNAME= # Account username
7593
TWITTER_PASSWORD= # Account password
7694
TWITTER_EMAIL= # Account email
7795
TWITTER_COOKIES= # Account cookies
96+
97+
X_SERVER_URL=
98+
XAI_API_KEY=
99+
XAI_MODEL=
100+
101+
102+
# For asking Claude stuff
103+
ANTHROPIC_API_KEY=
104+
105+
WALLET_SECRET_KEY=EXAMPLE_WALLET_SECRET_KEY
106+
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
107+
108+
BIRDEYE_API_KEY=
109+
110+
SOL_ADDRESS=So11111111111111111111111111111111111111112
111+
SLIPPAGE=1
112+
RPC_URL=https://api.mainnet-beta.solana.com
113+
HELIUS_API_KEY=
114+
115+
116+
## Telegram
117+
TELEGRAM_BOT_TOKEN=
118+
119+
TOGETHER_API_KEY=
78120
```
79121

80-
# Local Setup
122+
# Local Inference Setup
81123

82-
## CUDA Setup
124+
### CUDA Setup
83125

84126
If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically.
85127

@@ -90,37 +132,14 @@ npx --no node-llama-cpp source download --gpu cuda
90132

91133
Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS.
92134

93-
## Running locally
135+
### Running locally
94136

95137
Add XAI_MODEL and set it to one of the above options from [Run with
96138
Llama](#run-with-llama) - you can leave X_SERVER_URL and XAI_API_KEY blank, it
97139
downloads the model from huggingface and queries it locally
98140

99-
# Cloud Setup (with OpenAI)
100-
101-
In addition to the environment variables above, you will need to add the following:
102-
103-
```
104-
# OpenAI handles the bulk of the work with chat, TTS, image recognition, etc.
105-
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
106-
107-
# The agent can also ask Claude for help if you have an API key
108-
ANTHROPIC_API_KEY=
109-
110-
# For Elevenlabs voice generation on Discord voice
111-
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
112-
113-
# ELEVENLABS SETTINGS
114-
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
115-
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
116-
ELEVENLABS_VOICE_STABILITY=0.5
117-
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
118-
ELEVENLABS_VOICE_STYLE=0.66
119-
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
120-
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
121-
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
122-
```
141+
# Clients
123142

124-
# Discord Bot
143+
## Discord Bot
125144

126145
For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html

core/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
dist
3+
elizaConfig.yaml
4+
custom_actions/

core/elizaConfig.example.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Load custom actions from the actions directory
2+
3+
# Close this into a elizaConfig.yaml file that is ignored by git
4+
5+
# Paths are relative to the core/src directory
6+
7+
actions:
8+
- name: askClaude
9+
path: ./actions/askClaude.ts
10+
- name: epicAction
11+
path: ./custom_actions/epicAction.ts

core/package.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@
125125
"html-escaper": "3.0.3",
126126
"html-to-text": "9.0.5",
127127
"import-meta-resolve": "4.1.0",
128+
"install": "^0.13.0",
128129
"jieba-wasm": "2.2.0",
129130
"js-sha1": "0.7.0",
131+
"js-yaml": "^4.1.0",
130132
"json5": "2.2.3",
131133
"kuromoji": "0.1.2",
132134
"libsodium-wrappers": "0.7.15",
@@ -169,14 +171,5 @@
169171
"onnxruntime-node": "1.19.0",
170172
"@discordjs/opus": "github:discordjs/opus",
171173
"sharp": "^0.33.5"
172-
},
173-
"optionalDependencies": {
174-
"sharp": "0.33.5",
175-
"sqlite-vss-darwin-arm64": "0.1.2",
176-
"sqlite-vss-darwin-x64": "0.1.2",
177-
"sqlite-vss-linux-arm64": "^0.1.2",
178-
"sqlite-vss-linux-x64": "0.1.2",
179-
"sqlite-vss-win32-arm64": "^0.1.2",
180-
"sqlite-vss-win32-x64": "^0.1.2"
181174
}
182175
}

core/src/actions/swapUtils.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ import {
77
RpcResponseAndContext,
88
SimulatedTransactionResponse,
99
TokenAmount,
10-
VersionedTransaction
10+
VersionedTransaction,
1111
} from "@solana/web3.js";
1212
import settings from "../core/settings.ts";
1313

1414
const solAddress = settings.SOL_ADDRESS;
1515
const SLIPPAGE = settings.SLIPPAGE;
16-
const connection = new Connection(settings.RPC_URL || "https://api.mainnet-beta.solana.com");
16+
const connection = new Connection(
17+
settings.RPC_URL || "https://api.mainnet-beta.solana.com"
18+
);
1719
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
1820

1921
export async function delayedCall<T>(

0 commit comments

Comments
 (0)