Skip to content

Commit bb5caa5

Browse files
authored
Merge branch 'develop' into patch-2
2 parents b8f9d81 + 21c63c4 commit bb5caa5

File tree

169 files changed

+24300
-18479
lines changed

Some content is hidden

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

169 files changed

+24300
-18479
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

@@ -648,14 +649,15 @@ const startAgents = async () => {
648649
}
649650

650651
// upload some agent functionality into directClient
651-
directClient.startAgent = async character => {
652-
// wrap it so we don't have to inject directClient later
653-
return startAgent(character, directClient)
652+
directClient.startAgent = async (character) => {
653+
// wrap it so we don't have to inject directClient later
654+
return startAgent(character, directClient);
654655
};
655656
directClient.start(serverPort);
656657

657-
elizaLogger.log("Visit the following URL to chat with your agents:");
658-
elizaLogger.log(`http://localhost:5173`);
658+
elizaLogger.log(
659+
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
660+
);
659661
};
660662

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

docs/api/classes/AgentRuntime.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / AgentRuntime
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / AgentRuntime
22

33
# Class: AgentRuntime
44

docs/api/classes/CacheManager.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / CacheManager
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / CacheManager
22

33
# Class: CacheManager\<CacheAdapter\>
44

docs/api/classes/DatabaseAdapter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / DatabaseAdapter
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / DatabaseAdapter
22

33
# Class: `abstract` DatabaseAdapter\<DB\>
44

docs/api/classes/DbCacheAdapter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / DbCacheAdapter
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / DbCacheAdapter
22

33
# Class: DbCacheAdapter
44

docs/api/classes/FsCacheAdapter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / FsCacheAdapter
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / FsCacheAdapter
22

33
# Class: FsCacheAdapter
44

docs/api/classes/MemoryCacheAdapter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / MemoryCacheAdapter
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / MemoryCacheAdapter
22

33
# Class: MemoryCacheAdapter
44

docs/api/classes/MemoryManager.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / MemoryManager
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / MemoryManager
22

33
# Class: MemoryManager
44

docs/api/classes/Service.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / Service
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / Service
22

33
# Class: `abstract` Service
44

@@ -38,7 +38,7 @@
3838

3939
#### Defined in
4040

41-
[packages/core/src/types.ts:998](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L998)
41+
[packages/core/src/types.ts:1005](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1005)
4242

4343
***
4444

@@ -54,7 +54,7 @@
5454

5555
#### Defined in
5656

57-
[packages/core/src/types.ts:1009](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1009)
57+
[packages/core/src/types.ts:1016](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1016)
5858

5959
## Methods
6060

@@ -72,7 +72,7 @@
7272

7373
#### Defined in
7474

75-
[packages/core/src/types.ts:1002](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1002)
75+
[packages/core/src/types.ts:1009](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1009)
7676

7777
***
7878

@@ -92,4 +92,4 @@ Add abstract initialize method that must be implemented by derived classes
9292

9393
#### Defined in
9494

95-
[packages/core/src/types.ts:1014](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1014)
95+
[packages/core/src/types.ts:1021](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1021)

docs/api/enumerations/Clients.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / Clients
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / Clients
22

33
# Enumeration: Clients
44

@@ -12,7 +12,7 @@ Available client platforms
1212
1313
#### Defined in
1414

15-
[packages/core/src/types.ts:610](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L610)
15+
[packages/core/src/types.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L612)
1616

1717
***
1818

@@ -22,7 +22,7 @@ Available client platforms
2222
2323
#### Defined in
2424

25-
[packages/core/src/types.ts:611](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L611)
25+
[packages/core/src/types.ts:613](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L613)
2626

2727
***
2828

@@ -32,7 +32,7 @@ Available client platforms
3232
3333
#### Defined in
3434

35-
[packages/core/src/types.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L612)
35+
[packages/core/src/types.ts:614](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L614)
3636

3737
***
3838

@@ -42,7 +42,7 @@ Available client platforms
4242
4343
#### Defined in
4444

45-
[packages/core/src/types.ts:613](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L613)
45+
[packages/core/src/types.ts:615](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L615)
4646

4747
***
4848

@@ -52,7 +52,7 @@ Available client platforms
5252
5353
#### Defined in
5454

55-
[packages/core/src/types.ts:614](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L614)
55+
[packages/core/src/types.ts:616](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L616)
5656

5757
***
5858

@@ -62,7 +62,7 @@ Available client platforms
6262
6363
#### Defined in
6464

65-
[packages/core/src/types.ts:615](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L615)
65+
[packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617)
6666

6767
***
6868

@@ -72,7 +72,7 @@ Available client platforms
7272
7373
#### Defined in
7474

75-
[packages/core/src/types.ts:616](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L616)
75+
[packages/core/src/types.ts:618](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L618)
7676

7777
***
7878

@@ -82,4 +82,4 @@ Available client platforms
8282
8383
#### Defined in
8484

85-
[packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617)
85+
[packages/core/src/types.ts:619](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L619)

docs/api/enumerations/GoalStatus.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / GoalStatus
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / GoalStatus
22

33
# Enumeration: GoalStatus
44

docs/api/enumerations/LoggingLevel.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / LoggingLevel
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / LoggingLevel
22

33
# Enumeration: LoggingLevel
44

@@ -10,7 +10,7 @@
1010
1111
#### Defined in
1212

13-
[packages/core/src/types.ts:1213](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1213)
13+
[packages/core/src/types.ts:1220](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1220)
1414

1515
***
1616

@@ -20,7 +20,7 @@
2020
2121
#### Defined in
2222

23-
[packages/core/src/types.ts:1214](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1214)
23+
[packages/core/src/types.ts:1221](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1221)
2424

2525
***
2626

@@ -30,4 +30,4 @@
3030
3131
#### Defined in
3232

33-
[packages/core/src/types.ts:1215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1215)
33+
[packages/core/src/types.ts:1222](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1222)

docs/api/enumerations/ModelClass.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / ModelClass
1+
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / ModelClass
22

33
# Enumeration: ModelClass
44

0 commit comments

Comments
 (0)