forked from elizaOS/eliza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
180 changed files
with
24,351 additions
and
18,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ on: | |
push: | ||
branches: | ||
- "*" | ||
pull_request_target: | ||
pull_request: | ||
branches: | ||
- "*" | ||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,30 +21,81 @@ | |
|
||
# 开始使用 | ||
|
||
**前置要求(必须):** | ||
**前置要求(必须):** | ||
|
||
- [Python 2.7+](https://www.python.org/downloads/) | ||
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) | ||
- Nodejs安装 | ||
- [pnpm](https://pnpm.io/installation) | ||
- 使用pnpm | ||
|
||
### 编辑.env文件 | ||
以下是两种基础的Eliza下载方案, 请根据情况自行选择。 | ||
|
||
- - 将 .env.example 复制为 .env 并填写适当的值 | ||
## (A) 使用启动器(Starter): 推荐 | ||
|
||
``` | ||
git clone https://github.com/ai16z/eliza-starter.git | ||
cd eliza-starter | ||
cp .env.example .env | ||
``` | ||
|
||
## (B) 手动启动Eliza: 仅在您知道自己在做什么时才推荐 | ||
|
||
``` | ||
git clone https://github.com/ai16z/eliza.git | ||
cd eliza | ||
# 切换最新发布的版本(Checkout the latest release) | ||
# Eliza的迭代速度非常快, 所以我们建议经常性的切换到最新的发布版本以免出现问题(This project iterates fast, so we recommend checking out the latest release) | ||
git checkout $(git describe --tags --abbrev=0) | ||
``` | ||
|
||
在将代码下载到本地后, 我们要做两件事: | ||
|
||
### 1. 编辑.env文件(环境变量) | ||
|
||
- 将 `.env.example` 复制为 `.env` 并在其中填写适当的值 | ||
- 编辑推特环境并输入你的推特账号和密码 | ||
|
||
### 编辑角色文件 | ||
**最简化配置方案**: | ||
``` | ||
OPENAI_API_KEY=sk-xxx # 配置OpenAI 的API, sk-开头, 注意, 目前不支持AzureOpenAI! | ||
- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 | ||
## 如配置Twitter/X, 则需配置 | ||
# Twitter/X Configuration | ||
TWITTER_DRY_RUN=false | ||
TWITTER_USERNAME=abc # Your Twitter/X account username | ||
TWITTER_PASSWORD=abc # Your Twitter/X account password | ||
TWITTER_EMAIL= [email protected] # Your Twitter/X account email | ||
TWITTER_COOKIES= '' # Your Twitter/X cookies, copy from broswer | ||
TWITTER_2FA_SECRET= # Two-factor authentication | ||
``` | ||
|
||
### 2. 编辑角色文件 | ||
|
||
- 标准的角色个性定义在文件 `characters/*.character.json`中, 您可以修改它或者直接使用它。 | ||
- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 | ||
- 需要说明的是, 在`characters/*.character.json`中, `clients字段对应**服务**, 默认可选`"twitter", "discord", "telegram"`等, 如果在`clients`中填入了如"twitter"等内容, 则需要在 | ||
上面的`env`配置对应的环境变量。对`discord`和`telegram`同理。 | ||
|
||
``` | ||
{ | ||
"name": "trump", | ||
"clients": ["twitter"], | ||
"modelProvider": "openai", | ||
``` | ||
|
||
在完成账号和角色文件的配置后,输入以下命令行启动你的bot: | ||
在完成环境变量和角色文件的配置后,输入以下命令行启动你的bot: | ||
|
||
``` | ||
(A) 使用启动器(Starter) | ||
sh scripts/start.sh | ||
(B) 手动启动Eliza | ||
pnpm i | ||
pnpm build | ||
pnpm start | ||
``` | ||
|
||
|
||
# 自定义Eliza | ||
|
||
### 添加常规行为 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.