Skip to content

Commit

Permalink
Merge branch 'develop' into fix/akash
Browse files Browse the repository at this point in the history
  • Loading branch information
shakkernerd authored Dec 19, 2024
2 parents 97b5d15 + 76960dd commit 31b2b25
Show file tree
Hide file tree
Showing 173 changed files with 24,317 additions and 18,719 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- "*"
pull_request_target:
pull_request:
branches:
- "*"
jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ tasks:
- name: "init eliza env"
init: |
nvm install v23.3.0
git fetch --tags
git checkout $(git describe --tags --abbrev=0)
command: pnpm install && pnpm run build
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/characters ./characters

# Set the command to run the application
CMD ["pnpm", "start", "--non-interactive"]
CMD ["pnpm", "start"]
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@

```bash
git clone https://github.com/ai16z/eliza-starter.git

cd eliza-starter
cp .env.example .env

pnpm i && pnpm build && pnpm start
```

Expand Down
67 changes: 59 additions & 8 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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= xxx@gmail.com # 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

### 添加常规行为
Expand Down
14 changes: 8 additions & 6 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export const wait = (minTime: number = 1000, maxTime: number = 3000) => {

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

Expand Down Expand Up @@ -652,14 +653,15 @@ const startAgents = async () => {
}

// upload some agent functionality into directClient
directClient.startAgent = async character => {
// wrap it so we don't have to inject directClient later
return startAgent(character, directClient)
directClient.startAgent = async (character) => {
// wrap it so we don't have to inject directClient later
return startAgent(character, directClient);
};
directClient.start(serverPort);

elizaLogger.log("Visit the following URL to chat with your agents:");
elizaLogger.log(`http://localhost:5173`);
elizaLogger.log(
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
);
};

startAgents().catch((error) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/AgentRuntime.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / AgentRuntime
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / AgentRuntime

# Class: AgentRuntime

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/CacheManager.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / CacheManager
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / CacheManager

# Class: CacheManager\<CacheAdapter\>

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/DatabaseAdapter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / DatabaseAdapter
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / DatabaseAdapter

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

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/DbCacheAdapter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / DbCacheAdapter
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / DbCacheAdapter

# Class: DbCacheAdapter

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/FsCacheAdapter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / FsCacheAdapter
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / FsCacheAdapter

# Class: FsCacheAdapter

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/MemoryCacheAdapter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / MemoryCacheAdapter
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / MemoryCacheAdapter

# Class: MemoryCacheAdapter

Expand Down
2 changes: 1 addition & 1 deletion docs/api/classes/MemoryManager.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / MemoryManager
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / MemoryManager

# Class: MemoryManager

Expand Down
10 changes: 5 additions & 5 deletions docs/api/classes/Service.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / Service
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / Service

# Class: `abstract` Service

Expand Down Expand Up @@ -38,7 +38,7 @@

#### Defined in

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

***

Expand All @@ -54,7 +54,7 @@

#### Defined in

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

## Methods

Expand All @@ -72,7 +72,7 @@

#### Defined in

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

***

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

#### Defined in

[packages/core/src/types.ts:1014](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1014)
[packages/core/src/types.ts:1021](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1021)
18 changes: 9 additions & 9 deletions docs/api/enumerations/Clients.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / Clients
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / Clients

# Enumeration: Clients

Expand All @@ -12,7 +12,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -22,7 +22,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -32,7 +32,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -42,7 +42,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -52,7 +52,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -62,7 +62,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -72,7 +72,7 @@ Available client platforms
#### Defined in

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

***

Expand All @@ -82,4 +82,4 @@ Available client platforms
#### Defined in

[packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617)
[packages/core/src/types.ts:619](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L619)
2 changes: 1 addition & 1 deletion docs/api/enumerations/GoalStatus.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / GoalStatus
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / GoalStatus

# Enumeration: GoalStatus

Expand Down
8 changes: 4 additions & 4 deletions docs/api/enumerations/LoggingLevel.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / LoggingLevel
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / LoggingLevel

# Enumeration: LoggingLevel

Expand All @@ -10,7 +10,7 @@
#### Defined in

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

***

Expand All @@ -20,7 +20,7 @@
#### Defined in

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

***

Expand All @@ -30,4 +30,4 @@
#### Defined in

[packages/core/src/types.ts:1215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1215)
[packages/core/src/types.ts:1222](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L1222)
2 changes: 1 addition & 1 deletion docs/api/enumerations/ModelClass.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[@ai16z/eliza v0.1.5-alpha.5](../index.md) / ModelClass
[@ai16z/eliza v0.1.6-alpha.4](../index.md) / ModelClass

# Enumeration: ModelClass

Expand Down
Loading

0 comments on commit 31b2b25

Please sign in to comment.