Skip to content

Commit e65f6e9

Browse files
committed
Merge branch 'main' into twitter-profile
2 parents 066e129 + 86c4ab2 commit e65f6e9

File tree

408 files changed

+40755
-7269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+40755
-7269
lines changed

core/.env.example .env.example

+19-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
DISCORD_APPLICATION_ID=
33
DISCORD_API_TOKEN= # Bot token
44
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
5+
REDPILL_API_KEY= # REDPILL API Key
6+
GROQ_API_KEY=gsk_*
7+
58
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
69

710
# ELEVENLABS SETTINGS
@@ -25,10 +28,23 @@ XAI_API_KEY=
2528
XAI_MODEL=
2629

2730

31+
#Set to Use for New OLLAMA provider
32+
OLLAMA_SERVER_URL= #Leave blank for default localhost:11434
33+
OLLAMA_MODEL=
34+
OLLAMA_EMBEDDING_MODEL= #default mxbai-embed-large
35+
#To use custom model types for different tasks set these
36+
SMALL_OLLAMA_MODEL= #default llama3.2
37+
MEDIUM_OLLAMA_MODEL= #default herems3
38+
LARGE_OLLAMA_MODEL= #default hermes3:70b
39+
40+
#to still use the original LOCALLLAMA provider but with ollama
41+
LOCAL_LLAMA_PROVIDER= #"OLLAMA" #Leave blank for LLAMA-CPP or add OLLAMA
42+
43+
2844
# For asking Claude stuff
2945
ANTHROPIC_API_KEY=
3046

31-
WALLET_SECRET_KEY=EXAMPLE_WALLET_SECRET_KEY
47+
WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
3248
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
3349

3450
BIRDEYE_API_KEY=
@@ -42,4 +58,5 @@ HELIUS_API_KEY=
4258
## Telegram
4359
TELEGRAM_BOT_TOKEN=
4460

45-
TOGETHER_API_KEY=
61+
TOGETHER_API_KEY=
62+
SERVER_PORT=3000

.env.test

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TEST_DATABASE_CLIENT=sqlite
2+
NODE_ENV=test

.github/workflows/ci.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,13 @@ jobs:
2525
- name: Run Prettier
2626
run: pnpm run prettier --check .
2727

28+
- name: Create test env file
29+
run: |
30+
echo "TEST_DATABASE_CLIENT=sqlite" > core/.env.test
31+
echo "NODE_ENV=test" >> core/.env.test
32+
33+
- name: Run tests
34+
run: cd core && pnpm test
35+
2836
- name: Build packages
2937
run: pnpm run build
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Generate Changelog
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
changelog:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: main
15+
token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
16+
- name: Generate Changelog
17+
run: |
18+
export PATH="$PATH:/home/runner/.local/share/gem/ruby/3.0.0/bin"
19+
gem install --user-install github_changelog_generator
20+
github_changelog_generator \
21+
-u ${{ github.repository_owner }} \
22+
-p ${{ github.event.repository.name }} \
23+
--token ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
24+
- name: Commit Changelog
25+
uses: stefanzweifel/git-auto-commit-action@v5
26+
with:
27+
commit_message: "chore: update changelog"
28+
branch: main
29+
file_pattern: "CHANGELOG.md"
30+
commit_author: "GitHub Action <actions@github.com>"

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ embedding-cache.json
88
.DS_Store
99

1010
dist/
11+
# Allow models directory but ignore model files
12+
models/*.gguf
1113

1214
cookies.json
1315

@@ -31,4 +33,8 @@ twitter_cookies.json
3133
timeline_cache.json
3234

3335
*.sqlite
34-
characters/
36+
characters/
37+
38+
packages/core/src/providers/cache
39+
packages/core/src/providers/cache/*
40+
cache/*

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-linker=hoisted

CHANGELOG.md

+199
Large diffs are not rendered by default.

README.md

+46-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,24 @@
22

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

5-
_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_
6-
7-
- Multi-agent simulation framework
8-
- Add as many unique characters as you want with [characterfile](https://github.com/lalalune/characterfile/)
9-
- Full-featured Discord and Twitter connectors, with Discord voice channel support
10-
- Full conversational and document RAG memory
11-
- Can read links and PDFs, transcribe audio and videos, summarize conversations, and more
12-
- Highly extensible - create your own actions and clients to extend Eliza's capabilities
13-
- Supports open source and local models (default configured with Nous Hermes Llama 3.1B)
14-
- Supports OpenAI for cloud inference on a light-weight device
15-
- "Ask Claude" mode for calling Claude on more complex queries
16-
- 100% Typescript
5+
### [For Chinese Version: 中文说明](./README_CN.md)
6+
7+
## Features
8+
9+
- 🛠 Full-featured Discord, Twitter and Telegram connectors
10+
- 👥 Multi-agent and room support
11+
- 📚 Easily ingest and interact with your documents
12+
- 💾 Retrievable memory and document store
13+
- 🚀 Highly extensible - create your own actions and clients to extend capabilities
14+
- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more
15+
- 📦 Just works!
16+
17+
## What can I use it for?
18+
19+
- 🤖 Chatbots
20+
- 🕵️ Autonomous Agents
21+
- 📈 Business process handling
22+
- 🎮 Video game NPCs
1723

1824
# Getting Started
1925

@@ -102,7 +108,7 @@ XAI_MODEL=
102108
# For asking Claude stuff
103109
ANTHROPIC_API_KEY=
104110
105-
WALLET_SECRET_KEY=EXAMPLE_WALLET_SECRET_KEY
111+
WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
106112
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
107113
108114
BIRDEYE_API_KEY=
@@ -143,3 +149,30 @@ downloads the model from huggingface and queries it locally
143149
## Discord Bot
144150

145151
For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html
152+
153+
# Development
154+
155+
## Testing
156+
157+
To run the test suite:
158+
159+
```bash
160+
pnpm test # Run tests once
161+
pnpm test:watch # Run tests in watch mode
162+
```
163+
164+
For database-specific tests:
165+
166+
```bash
167+
pnpm test:sqlite # Run tests with SQLite
168+
pnpm test:sqljs # Run tests with SQL.js
169+
```
170+
171+
Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to:
172+
173+
- Load environment variables from `.env.test`
174+
- Use a 2-minute timeout for long-running tests
175+
- Support ESM modules
176+
- Run tests in sequence (--runInBand)
177+
178+
To create new tests, add a `.test.ts` file adjacent to the code you're testing.

README_CN.md

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Eliza
2+
3+
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
4+
5+
## 功能
6+
7+
- 🛠 支持discord/推特/telegram连接
8+
- 👥 支持多模态agent
9+
- 📚 简单的导入文档并与文档交互
10+
- 💾 可检索的内存和文档存储
11+
- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展
12+
- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等
13+
- 📦 简单好用
14+
15+
你可以用Eliza做什么?
16+
17+
- 🤖 聊天机器人
18+
- 🕵️ 自主Agents
19+
- 📈 业务流程自动化处理
20+
- 🎮 游戏NPC
21+
22+
# 开始使用
23+
24+
**前置要求(必须):**
25+
26+
- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
27+
- Nodejs安装
28+
- [pnpm](https://pnpm.io/installation)
29+
- 使用pnpm
30+
31+
### 编辑.env文件
32+
33+
- - 将 .env.example 复制为 .env 并填写适当的值
34+
- 编辑推特环境并输入你的推特账号和密码
35+
36+
### 编辑角色文件
37+
38+
- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它
39+
- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。
40+
41+
在完成账号和角色文件的配置后,输入以下命令行启动你的bot:
42+
43+
```
44+
pnpm i
45+
pnpm start
46+
```
47+
48+
# 自定义Eliza
49+
50+
### 添加常规行为
51+
52+
为避免在核心目录中的 Git 冲突,我们建议将自定义操作添加到 custom_actions 目录中,并在 elizaConfig.yaml 文件中配置这些操作。可以参考 elizaConfig.example.yaml 文件中的示例。
53+
54+
## 配置不同的大模型
55+
56+
### 配置Llama
57+
58+
您可以通过设置 `XAI_MODEL` 环境变量为 `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo``meta-llama/Meta-Llama-3.1-405B-Instruct` 来运行 Llama 70B 或 405B 模型
59+
60+
### 配置OpenAI
61+
62+
您可以通过设置 `XAI_MODEL` 环境变量为 `gpt-4o-mini``gpt-4o` 来运行 OpenAI 模型
63+
64+
## 其他要求
65+
66+
您可能需要安装 Sharp。如果在启动时看到错误,请尝试使用以下命令安装:
67+
68+
```
69+
pnpm install --include=optional sharp
70+
```
71+
72+
# 环境设置
73+
74+
您需要在 .env 文件中添加环境变量以连接到各种平台:
75+
76+
```
77+
# Required environment variables
78+
DISCORD_APPLICATION_ID=
79+
DISCORD_API_TOKEN= # Bot token
80+
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
81+
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
82+
83+
# ELEVENLABS SETTINGS
84+
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
85+
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
86+
ELEVENLABS_VOICE_STABILITY=0.5
87+
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
88+
ELEVENLABS_VOICE_STYLE=0.66
89+
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
90+
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
91+
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
92+
93+
TWITTER_DRY_RUN=false
94+
TWITTER_USERNAME= # Account username
95+
TWITTER_PASSWORD= # Account password
96+
TWITTER_EMAIL= # Account email
97+
TWITTER_COOKIES= # Account cookies
98+
99+
X_SERVER_URL=
100+
XAI_API_KEY=
101+
XAI_MODEL=
102+
103+
104+
# For asking Claude stuff
105+
ANTHROPIC_API_KEY=
106+
107+
WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
108+
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
109+
110+
BIRDEYE_API_KEY=
111+
112+
SOL_ADDRESS=So11111111111111111111111111111111111111112
113+
SLIPPAGE=1
114+
RPC_URL=https://api.mainnet-beta.solana.com
115+
HELIUS_API_KEY=
116+
117+
118+
## Telegram
119+
TELEGRAM_BOT_TOKEN=
120+
121+
TOGETHER_API_KEY=
122+
```
123+
124+
# 本地设置
125+
126+
### CUDA设置
127+
128+
如果你有高性能的英伟达显卡,你可以以下命令行通过CUDA来做本地加速
129+
130+
```
131+
pnpm install
132+
npx --no node-llama-cpp source download --gpu cuda
133+
```
134+
135+
确保你安装了完整的CUDA工具包,包括cuDNN和cuBLAS
136+
137+
### 本地运行
138+
139+
添加 XAI_MODEL 并将其设置为上述 [使用 Llama 运行](#run-with-llama) 中的选项之一
140+
您可以将 X_SERVER_URL 和 XAI_API_KEY 留空,它会从 huggingface 下载模型并在本地查询
141+
142+
# 客户端
143+
144+
关于怎么设置discord bot,可以查看discord的官方文档
145+
146+
# 开发
147+
148+
## 测试
149+
150+
几种测试方法的命令行:
151+
152+
```bash
153+
pnpm test # Run tests once
154+
pnpm test:watch # Run tests in watch mode
155+
```
156+
157+
对于数据库特定的测试:
158+
159+
```bash
160+
pnpm test:sqlite # Run tests with SQLite
161+
pnpm test:sqljs # Run tests with SQL.js
162+
```
163+
164+
测试使用 Jest 编写,位于 src/\*_/_.test.ts 文件中。测试环境配置如下:
165+
166+
- 从 .env.test 加载环境变量
167+
- 使用 2 分钟的超时时间来运行长时间运行的测试
168+
- 支持 ESM 模块
169+
- 按顺序运行测试 (--runInBand)
170+
171+
要创建新测试,请在要测试的代码旁边添加一个 .test.ts 文件。

characters/tate.character.json

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
{
22
"name": "tate",
3-
"clients": ["discord", "twitter", "telegram"],
3+
"clients": [],
4+
"modelProvider": "anthropic",
45
"settings": {
56
"secrets": {},
67
"voice": {
78
"model": "en_US-male-medium"
89
}
910
},
1011
"bio": [
11-
""
12+
"Andrew Tate is a former kickboxer, entrepreneur, and self-proclaimed misogynist.",
13+
"He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.",
14+
"He is a self-proclaimed misogynist and believes that women should be submissive to men.",
15+
"People call him the 'King of Men' and he believes that he is the best at everything he does."
1216
],
1317
"lore": [
14-
""
15-
],
16-
"knowledge": [
17-
""
18+
"Andrew once was a kickboxer, but now he's a self-proclaimed misogynist entrepreneur.",
19+
"He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.",
20+
"He is a self-proclaimed misogynist and believes that women should be submissive to men.",
21+
"People call him the 'King of Men' and he believes that he is the best at everything he does."
1822
],
23+
"knowledge": [],
1924
"messageExamples": [
2025
[
2126
{

0 commit comments

Comments
 (0)