Skip to content

Commit 2c432a3

Browse files
Merge branch 'develop'
2 parents f79c9cd + 46e34be commit 2c432a3

File tree

17 files changed

+3967
-19396
lines changed

17 files changed

+3967
-19396
lines changed

.github/workflows/integrationTests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- "*"
6-
pull_request_target:
6+
pull_request:
77
branches:
88
- "*"
99
jobs:

.gitpod.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ tasks:
33
- name: "init eliza env"
44
init: |
55
nvm install v23.3.0
6+
git fetch --tags
67
git checkout $(git describe --tags --abbrev=0)
78
command: pnpm install && pnpm run build

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ COPY --from=builder /app/scripts ./scripts
5252
COPY --from=builder /app/characters ./characters
5353

5454
# Set the command to run the application
55-
CMD ["pnpm", "start", "--non-interactive"]
55+
CMD ["pnpm", "start"]

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050

5151
```bash
5252
git clone https://github.com/ai16z/eliza-starter.git
53-
53+
cd eliza-starter
5454
cp .env.example .env
55-
5655
pnpm i && pnpm build && pnpm start
5756
```
5857

README_CN.md

+59-8
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,81 @@
2121

2222
# 开始使用
2323

24-
**前置要求(必须):**
24+
**前置要求(必须):**
2525

26+
- [Python 2.7+](https://www.python.org/downloads/)
2627
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
27-
- Nodejs安装
2828
- [pnpm](https://pnpm.io/installation)
29-
- 使用pnpm
3029

31-
### 编辑.env文件
30+
以下是两种基础的Eliza下载方案, 请根据情况自行选择。
3231

33-
- - 将 .env.example 复制为 .env 并填写适当的值
32+
## (A) 使用启动器(Starter): 推荐
33+
34+
```
35+
git clone https://github.com/ai16z/eliza-starter.git
36+
cd eliza-starter
37+
cp .env.example .env
38+
```
39+
40+
## (B) 手动启动Eliza: 仅在您知道自己在做什么时才推荐
41+
42+
```
43+
git clone https://github.com/ai16z/eliza.git
44+
cd eliza
45+
# 切换最新发布的版本(Checkout the latest release)
46+
# Eliza的迭代速度非常快, 所以我们建议经常性的切换到最新的发布版本以免出现问题(This project iterates fast, so we recommend checking out the latest release)
47+
git checkout $(git describe --tags --abbrev=0)
48+
```
49+
50+
在将代码下载到本地后, 我们要做两件事:
51+
52+
### 1. 编辑.env文件(环境变量)
53+
54+
-`.env.example` 复制为 `.env` 并在其中填写适当的值
3455
- 编辑推特环境并输入你的推特账号和密码
3556

36-
### 编辑角色文件
57+
**最简化配置方案**:
58+
```
59+
OPENAI_API_KEY=sk-xxx # 配置OpenAI 的API, sk-开头, 注意, 目前不支持AzureOpenAI!
3760
38-
- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它
61+
## 如配置Twitter/X, 则需配置
62+
# Twitter/X Configuration
63+
TWITTER_DRY_RUN=false
64+
TWITTER_USERNAME=abc # Your Twitter/X account username
65+
TWITTER_PASSWORD=abc # Your Twitter/X account password
66+
TWITTER_EMAIL= xxx@gmail.com # Your Twitter/X account email
67+
TWITTER_COOKIES= '' # Your Twitter/X cookies, copy from broswer
68+
TWITTER_2FA_SECRET= # Two-factor authentication
69+
```
70+
71+
### 2. 编辑角色文件
72+
73+
- 标准的角色个性定义在文件 `characters/*.character.json`中, 您可以修改它或者直接使用它。
3974
- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。
75+
- 需要说明的是, 在`characters/*.character.json`中, `clients字段对应**服务**, 默认可选`"twitter", "discord", "telegram"`等, 如果在`clients`中填入了如"twitter"等内容, 则需要在
76+
上面的`env`配置对应的环境变量。对`discord``telegram`同理。
77+
78+
```
79+
{
80+
"name": "trump",
81+
"clients": ["twitter"],
82+
"modelProvider": "openai",
83+
```
4084

41-
在完成账号和角色文件的配置后,输入以下命令行启动你的bot:
85+
在完成环境变量和角色文件的配置后,输入以下命令行启动你的bot:
4286

4387
```
88+
(A) 使用启动器(Starter)
89+
sh scripts/start.sh
90+
91+
92+
(B) 手动启动Eliza
4493
pnpm i
94+
pnpm build
4595
pnpm start
4696
```
4797

98+
4899
# 自定义Eliza
49100

50101
### 添加常规行为

agent/src/index.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export const wait = (minTime: number = 1000, maxTime: number = 3000) => {
7070

7171
const logFetch = async (url: string, options: any) => {
7272
elizaLogger.debug(`Fetching ${url}`);
73-
elizaLogger.debug(JSON.stringify(options, null, 2));
73+
// Disabled to avoid disclosure of sensitive information such as API keys
74+
// elizaLogger.debug(JSON.stringify(options, null, 2));
7475
return fetch(url, options);
7576
};
7677

@@ -651,14 +652,15 @@ const startAgents = async () => {
651652
}
652653

653654
// upload some agent functionality into directClient
654-
directClient.startAgent = async character => {
655-
// wrap it so we don't have to inject directClient later
656-
return startAgent(character, directClient)
655+
directClient.startAgent = async (character) => {
656+
// wrap it so we don't have to inject directClient later
657+
return startAgent(character, directClient);
657658
};
658659
directClient.start(serverPort);
659660

660-
elizaLogger.log("Visit the following URL to chat with your agents:");
661-
elizaLogger.log(`http://localhost:5173`);
661+
elizaLogger.log(
662+
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
663+
);
662664
};
663665

664666
startAgents().catch((error) => {

0 commit comments

Comments
 (0)