Skip to content

Commit b06b302

Browse files
Merge pull request #1 from ai16z/shaw/plugins
Shaw/plugins
2 parents f330fc1 + 84f2da0 commit b06b302

File tree

233 files changed

+11008
-5092
lines changed

Some content is hidden

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

233 files changed

+11008
-5092
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727

2828
- name: Create test env file
2929
run: |
30-
echo "TEST_DATABASE_CLIENT=sqlite" > core/.env.test
31-
echo "NODE_ENV=test" >> core/.env.test
30+
echo "TEST_DATABASE_CLIENT=sqlite" > core/.env.test
31+
echo "NODE_ENV=test" >> core/.env.test
3232
3333
- name: Run tests
3434
run: cd core && pnpm test
+27-27
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
name: Generate Changelog
22
on:
3-
push:
4-
tags:
5-
- '*'
3+
push:
4+
tags:
5+
- "*"
66
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>"
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>"

README.md

+25-17
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

@@ -156,15 +162,17 @@ pnpm test:watch # Run tests in watch mode
156162
```
157163

158164
For database-specific tests:
165+
159166
```bash
160167
pnpm test:sqlite # Run tests with SQLite
161168
pnpm test:sqljs # Run tests with SQL.js
162169
```
163170

164171
Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to:
165-
- Load environment variables from `.env.test`
166-
- Use a 2-minute timeout for long-running tests
167-
- Support ESM modules
168-
- Run tests in sequence (--runInBand)
169172

170-
To create new tests, add a `.test.ts` file adjacent to the code you're testing.
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 文件。

agent/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
*.ts
22
!index.ts
33
!character.ts
4+
.env
5+
*.env
6+
.env*

agent/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"build": "tsup --format esm --dts",
8-
"start": "node --loader ts-node/esm src/index.ts"
8+
"start": "node --loader ts-node/esm src/index.ts",
9+
"dev": "node --loader ts-node/esm src/index.ts"
910
},
1011
"dependencies": {
1112
"@eliza/core": "workspace:*",

0 commit comments

Comments
 (0)