Skip to content

Commit 08a5aad

Browse files
authored
Merge branch 'develop' into tcm-twitter-character-template-issue
2 parents 80a1b83 + 2f157b6 commit 08a5aad

File tree

181 files changed

+24352
-18740
lines changed

Some content is hidden

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

181 files changed

+24352
-18740
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ TWITTER_COOKIES= # Account cookies
5555
TWITTER_POLL_INTERVAL=120 # How often (in seconds) the bot should check for interactions
5656
TWITTER_SEARCH_ENABLE=FALSE # Enable timeline search, WARNING this greatly increases your chance of getting banned
5757
TWITTER_TARGET_USERS= # Comma separated list of Twitter user names to interact with
58+
TWITTER_RETRY_LIMIT= # Maximum retry attempts for Twitter login
5859

5960
X_SERVER_URL=
6061
XAI_API_KEY=

.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
### 添加常规行为

README_ES.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- 📚 Ingestión e interacción sencilla con documentos
1010
- 💾 Memoria recuperable y almacenamiento de documentos
1111
- 🚀 Altamente extensible - cree sus propias acciones y clientes para expandir capacidades
12-
- ☁️ Soporta múltiples modelos, incluyendo Llama local, OpenAI, Anthropic, Groq y más
12+
- ☁️ Soporta múltiples modelos, incluidos Llama local, OpenAI, Anthropic, Groq y más
1313
- 📦 Funciona perfectamente
1414

1515
## Usos
@@ -29,8 +29,8 @@
2929

3030
### Edite el archivo .env
3131

32-
- Copie .env.example a .env y complete los valores apropiados
33-
- Edite las variables de ambiente de TWITTER para agregar nombre de usuario y contraseña del bot
32+
- Copie el archivo .env.example a .env y complete los valores apropiados
33+
- Edite las variables de entorno de TWITTER para agregar nombre de usuario y contraseña del bot
3434

3535
### Edite el archivo de personaje
3636

README_FR.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
- 🛠 Support des connecteurs Discord/ Twitter / Telegram
88
- 🔗 Support des différents modèles d'IA (Llama, Grok, OpenAI, Anthropic, etc.)
99
- 👥 Gestion de plusieurs agents et assistance
10-
- 📚 Import et intéractions avec différents types de documents simplifiés
10+
- 📚 Import et interactions avec différents types de documents simplifiés
1111
- 💾 Accès aux données en mémoire et aux documents stockés
1212
- 🚀 Grande personnalisation possible : création de nouveaux clients et de nouvelles actions
1313
- 📦 Simplicité d'utilisation
1414

1515
Que pouvez-vous faire avec Eliza?
1616

1717
- 🤖 Chatbot
18-
- 🕵 ️Agents autonomes
18+
- 🕵 Agents autonomes
1919
- 📈 Processus automatisés
20-
- 🎮 PNJ intéractifs
20+
- 🎮 PNJ interactifs
2121
- 🧠 Trading automatisé
2222

2323
# Premiers pas
@@ -32,7 +32,7 @@ Que pouvez-vous faire avec Eliza?
3232
3333
### Editer le fichier .env
3434

35-
- Copier le fichier d'example et le remplir le avec les valeurs adéquates
35+
- Copier le fichier d'exemple .env.example et le remplir avec les valeurs adéquates
3636

3737
```
3838
cp .env.example .env
@@ -59,10 +59,10 @@ pnpm start
5959
pnpm clean
6060
```
6161

62-
#### Ressources additionelles
62+
#### Ressources additionnelles
6363

6464
Il vous faudra peut-être installer Sharp.
65-
Si il y a une erreur lors du lancement du bot, essayez d'installer Sharp comme ceci :
65+
S'il y a une erreur lors du lancement du bot, essayez d'installer Sharp comme ceci :
6666

6767
```
6868
pnpm install --include=optional sharp

README_IT.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
- 🛠️ Connettori completi per Discord, Twitter e Telegram
1010
- 🔗 Supporto per tutti i modelli (Llama, Grok, OpenAI, Anthropic, ecc.)
1111
- 👥 Supporto multi-agente e per stanze
12-
- 📚 Acquisisci ed interagisci facilmente con i tuoi documenti
12+
- 📚 Acquisisci e interagisci facilmente con i tuoi documenti
1313
- 💾 Memoria recuperabile e archivio documenti
1414
- 🚀 Altamente estensibile - crea le tue azioni e clients personalizzati
1515
- ☁️ Supporto di numerosi modelli (Llama locale, OpenAI, Anthropic, Groq, ecc.)
1616
- 📦 Funziona e basta!
1717

18-
## 🎯 Casi d'Uso
18+
## 🎯 Casi d'uso
1919

2020
- 🤖 Chatbot
2121
- 🕵️ Agenti Autonomi
22-
- 📈 Gestione Processi Aziendali
22+
- 📈 Gestione dei processi aziendali
2323
- 🎮 NPC per Videogiochi
2424
- 🧠 Trading
2525

@@ -51,7 +51,7 @@ sh scripts/start.sh
5151

5252
### Modifica il file del personaggio
5353

54-
1. Apri `packages/agent/src/character.ts` per modificare il personaggio predefinito. Decommentare e modificare.
54+
1. Apri `packages/agent/src/character.ts` per modificare il personaggio predefinito. Decommenta e modifica.
5555

5656
2. Per caricare personaggi personalizzati:
5757
- Usa `pnpm start --characters="percorso/del/tuo/personaggio.json"`
@@ -76,10 +76,10 @@ Potrebbe essere necessario installare Sharp. Se vedi un errore all'avvio, prova
7676
pnpm install --include=optional sharp
7777
```
7878

79-
### Community e contatti
79+
### Comunità e contatti
8080

81-
- [GitHub Issues](https://github.com/ai16z/eliza/issues). Ideale per: bug riscontrati utilizzando Eliza e proposte di funzionalità.
82-
- [Discord](https://discord.gg/ai16z). Ideale per: condividere le tue applicazioni e interagire con la community.
81+
- [GitHub Issues](https://github.com/ai16z/eliza/issues). Ideale per segnalare bug riscontrati durante l’utilizzo di Eliza e proporre nuove funzionalità.
82+
- [Discord](https://discord.gg/ai16z). Ideale per condividere le tue applicazioni e interagire con la comunità.
8383

8484
## Contributori
8585

agent/src/index.ts

+13-7
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

@@ -304,6 +305,10 @@ export function getTokenForProvider(
304305
character.settings?.secrets?.AKASH_CHAT_API_KEY ||
305306
settings.AKASH_CHAT_API_KEY
306307
);
308+
default:
309+
const errorMessage = `Failed to get token - unsupported model provider: ${provider}`
310+
elizaLogger.error(errorMessage)
311+
throw new Error(errorMessage)
307312
}
308313
}
309314

@@ -573,7 +578,7 @@ function initializeDbCache(character: Character, db: IDatabaseCacheAdapter) {
573578

574579
async function startAgent(
575580
character: Character,
576-
directClient
581+
directClient: DirectClient
577582
): Promise<AgentRuntime> {
578583
let db: IDatabaseAdapter & IDatabaseCacheAdapter;
579584
try {
@@ -648,14 +653,15 @@ const startAgents = async () => {
648653
}
649654

650655
// 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)
656+
directClient.startAgent = async (character: Character) => {
657+
// wrap it so we don't have to inject directClient later
658+
return startAgent(character, directClient);
654659
};
655660
directClient.start(serverPort);
656661

657-
elizaLogger.log("Visit the following URL to chat with your agents:");
658-
elizaLogger.log(`http://localhost:5173`);
662+
elizaLogger.log(
663+
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
664+
);
659665
};
660666

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

characters/trump.character.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"plugins": [],
1212
"bio": [
13-
"SAVED America from the China Virus (while they let cities burn)",
13+
"SAVED America from COVID-19 (while they let cities burn)",
1414
"secured the Southern Border COMPLETELY (until they DESTROYED it)",
1515
"protected WOMEN'S SPORTS (while Democrats let MEN compete)",
1616
"ended INFLATION and made America AFFORDABLE (until Kamala ruined it)",

client/vite.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { defineConfig } from "vite";
33
import topLevelAwait from "vite-plugin-top-level-await";
44
import react from "@vitejs/plugin-react";
55
import wasm from "vite-plugin-wasm";
6+
import { config } from "dotenv";
7+
8+
config({ path: path.resolve(__dirname, "../.env") });
69

710
// https://vite.dev/config/
811
export default defineConfig({
@@ -26,7 +29,7 @@ export default defineConfig({
2629
server: {
2730
proxy: {
2831
"/api": {
29-
target: "http://localhost:3000",
32+
target: `http://localhost:${process.env.SERVER_PORT || 3000}`,
3033
changeOrigin: true,
3134
rewrite: (path) => path.replace(/^\/api/, ""),
3235
},

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)

0 commit comments

Comments
 (0)