Skip to content

Commit a2a41fd

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feat/live-monorepo-types
2 parents 047d33c + 20090bf commit a2a41fd

File tree

61 files changed

+7659
-1226
lines changed

Some content is hidden

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

61 files changed

+7659
-1226
lines changed

.env.example

+8
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1
162162
GAIANET_EMBEDDING_MODEL=
163163
USE_GAIANET_EMBEDDING= # Set to TRUE for GAIANET/768, leave blank for local
164164

165+
# Volcengine Configuration
166+
VOLENGINE_API_URL= # Volcengine API Endpoint, Default: https://open.volcengineapi.com/api/v3/
167+
VOLENGINE_MODEL=
168+
SMALL_VOLENGINE_MODEL= # Default: doubao-lite-128k
169+
MEDIUM_VOLENGINE_MODEL= # Default: doubao-pro-128k
170+
LARGE_VOLENGINE_MODEL= # Default: doubao-pro-256k
171+
VOLENGINE_EMBEDDING_MODEL= # Default: doubao-embedding
172+
165173
# EVM
166174
EVM_PRIVATE_KEY=
167175
EVM_PROVIDER_URL=

docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Eliza - Multi-agent simulation framework
22

3-
# https://github.com/elizaos/eliza
3+
# https://github.com/elizaOS/eliza
44

55
# Visit https://eliza.builders for support
66

77
## 🌍 README Translations
88

9-
[中文说明](./README_CN.md) | [Deutsch](./README_DE.md) | [Français](./README_FR.md) | [ไทย](./README_TH.md)
9+
[中文说明](./README_CN.md) | [Deutsch](./README_DE.md) | [Français](./README_FR.md) | [ไทย](./README_TH.md) | [Español](README_ES.md)
1010

1111
# dev branch
1212

13-
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
13+
<img src="static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
1414

1515
_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_
1616

docs/README_ES.md

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Eliza - Framework de simulación multi-agente
2+
3+
# https://github.com/elizaOS/eliza
4+
5+
# Visita https://eliza.builders para ayuda
6+
7+
## 🌍 Traducciones del README
8+
9+
[中文说明](./README_CN.md) | [Deutsch](./README_DE.md) | [Français](./README_FR.md) | [ไทย](./README_TH.md) | [English](README.md)
10+
11+
# dev branch
12+
13+
<img src="static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
14+
15+
_Respaldado por [@DegenSpartanAI](https://x.com/degenspartanai) y [@MarcAIndreessen](https://x.com/pmairca)_
16+
17+
- Framework de simulación multi-agente
18+
- Añade tantos caracteres únicos como quieras con [characterfile](https://github.com/elizaOS/characterfile/)
19+
- Conectores Discord y Twitter con todas las funciones y compatibilidad con canales de voz de Discord.
20+
- Sistema de memoria RAG completo para conversaciones y documentos.
21+
- Capacidad para leer enlaces y archivos PDF, transcribir audio y vídeos, resumir conversaciones, etc.
22+
- Gran capacidad de ampliación: cree sus propias acciones y clientes para ampliar las posibilidades de Eliza.
23+
- Admite modelos locales y de código abierto (configurado por defecto con Nous Hermes Llama 3.1B).
24+
- Compatible con OpenAI para la inferencia en la nube en un dispositivo ligero.
25+
- Modo "Ask Claude" para llamar a Claude en consultas más complejas
26+
- 100% Typescript
27+
28+
# Primeros pasos
29+
30+
**Prerrequisitos (OBLIGATORIOS):**
31+
32+
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
33+
- [pnpm](https://pnpm.io/installation)
34+
35+
### Edita el archivo .env
36+
37+
- Copie .env.example en .env y rellene los valores apropiados
38+
- Edita las variables de entorno de TWITTER para añadir el nombre de usuario y la contraseña de tu bot
39+
40+
### Edita el archivo del character
41+
42+
- Mira el archivo `src/core/defaultCharacter.ts` - tú puedes modificarlo
43+
- También puede cargar caracteres con el comando `pnpm start --characters="path/to/your/character.json"` y ejecutar múltiples bots al mismo tiempo.
44+
45+
Después de configurar el archivo .env y el archivo de caracteres, puedes iniciar el bot con el siguiente comando:
46+
47+
```
48+
pnpm i
49+
pnpm start
50+
```
51+
52+
# Personalizando Eliza
53+
54+
### Añadir acciones personalizadas
55+
56+
Para evitar conflictos de git en el directorio core, recomendamos añadir acciones personalizadas a un directorio `custom_actions` y luego añadirlas al archivo `elizaConfig.yaml`. Consulte el archivo `elizaConfig.example.yaml` para ver un ejemplo.
57+
58+
## Ejecutando con diferentes modelos
59+
60+
### Ejecuta con Llama
61+
62+
Tú puedes ejecutar los modelos Llama 70B o 405B configurando el ambiente `XAI_MODEL` en la variable `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` o `meta-llama/Meta-Llama-3.1-405B-Instruct`
63+
64+
### Ejecuta con Grok
65+
66+
Tú puedes ejecutar modelos Grok configurando el ambiente `XAI_MODEL` en la variable `grok-beta`
67+
68+
### Ejecuta con OpenAI
69+
70+
Tú puedes ejecutar modelos OpenAI configurando el ambiente `XAI_MODEL` en la variable `gpt-4-mini` o `gpt-4o`
71+
72+
## Requerimientos adicionales
73+
74+
Puede que necesite instalar Sharp. Si aparece un error al arrancar, intente instalarlo con el siguiente comando:
75+
76+
```
77+
pnpm install --include=optional sharp
78+
```
79+
80+
# Configuración del entorno
81+
82+
Tendrás que añadir variables de entorno a tu archivo .env para conectarte a distintas plataformas:
83+
84+
```
85+
# Variables de entorno necesarias
86+
DISCORD_APPLICATION_ID=
87+
DISCORD_API_TOKEN= # Bot token
88+
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
89+
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
90+
91+
# CONFIGURACION DE ELEVENLABS
92+
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
93+
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
94+
ELEVENLABS_VOICE_STABILITY=0.5
95+
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
96+
ELEVENLABS_VOICE_STYLE=0.66
97+
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
98+
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
99+
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
100+
101+
TWITTER_DRY_RUN=false
102+
TWITTER_USERNAME= # Account username
103+
TWITTER_PASSWORD= # Account password
104+
TWITTER_EMAIL= # Account email
105+
106+
X_SERVER_URL=
107+
XAI_API_KEY=
108+
XAI_MODEL=
109+
110+
111+
# Para preguntarle cosas a Claude
112+
ANTHROPIC_API_KEY=
113+
114+
WALLET_SECRET_KEY=EXAMPLE_WALLET_SECRET_KEY
115+
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
116+
117+
BIRDEYE_API_KEY=
118+
119+
SOL_ADDRESS=So11111111111111111111111111111111111111112
120+
SLIPPAGE=1
121+
RPC_URL=https://api.mainnet-beta.solana.com
122+
HELIUS_API_KEY=
123+
124+
125+
## Telegram
126+
TELEGRAM_BOT_TOKEN=
127+
128+
TOGETHER_API_KEY=
129+
```
130+
131+
# Configuración de la inferencia local
132+
133+
### Configuración CUDA
134+
135+
Si tienes una GPU NVIDIA, puedes instalar CUDA para acelerar drásticamente la inferencia local.
136+
137+
```
138+
pnpm install
139+
npx --no node-llama-cpp source download --gpu cuda
140+
```
141+
142+
Asegúrese de que ha instalado el kit de herramientas CUDA, incluidos cuDNN y cuBLAS.
143+
144+
### Ejecutando localmente
145+
146+
Añade XAI_MODEL y ajústalo a una de las opciones anteriores de [Run with Llama](#run-with-llama) - puedes dejar X_SERVER_URL y XAI_API_KEY en blanco, descarga el modelo de huggingface y lo consulta localmente.
147+
148+
# Clientes
149+
150+
## Discord Bot
151+
152+
Para obtener ayuda con la configuración de su Bot Discord, echa un vistazo aquí: https://discordjs.guide/preparations/setting-up-a-bot-application.html
153+
154+
# Desarrollo
155+
156+
## Pruebas
157+
158+
Para ejecutar el conjunto de pruebas:
159+
160+
```bash
161+
pnpm test # Ejecutar las pruebas una vez
162+
pnpm test:watch # Ejecutar pruebas en modo vigilancia
163+
```
164+
165+
Para pruebas database-specific:
166+
167+
```bash
168+
pnpm test:sqlite # Ejecuta pruebas con SQLite
169+
pnpm test:sqljs # Ejecuta pruebas con with SQL.js
170+
```
171+
172+
Las pruebas se escriben usando Jest y se encuentran en los archivos `src/**/*.test.ts`. El entorno de pruebas está configurado para:
173+
174+
- Cargar variables de entorno desde `.env.test`.
175+
- Uso de un tiempo de espera de 2 minutos para pruebas de larga duración
176+
- Compatibilidad con módulos ESM
177+
- Ejecutar pruebas en secuencia (--runInBand)
178+
179+
Para crear nuevas pruebas, añade un archivo `.test.ts` junto al código que estás probando.

docs/docs/core/agents.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const runtime = new AgentRuntime({
9090

9191
## State Management
9292

93-
This section should cover how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces/state) interface:
93+
This section covers how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces/state) interface:
9494

9595
```typescript
9696
interface State {

docs/docs/faq.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Eliza's architecture consists of several interconnected components:
2828
- **Agents**: These are the core elements that represent individual AI personalities. Agents operate within a runtime environment and interact with various platforms.
2929
- **Actions**: Actions are predefined behaviors that agents can execute in response to messages, enabling them to perform tasks and interact with external systems.
3030
- **Clients**: Clients act as interfaces between agents and specific platforms, such as Discord, Twitter, and Telegram. They handle platform-specific message formats and communication protocols.
31+
- **Plugins**: Plugins are modular way to extend the core functionality with additional features, actions, evaluators, and providers. They are self-contained modules that can be easily added or removed to customize your agent's capabilities
3132
- **Providers**: Providers supply agents with contextual information, including time awareness, user relationships, and data from external sources.
3233
- **Evaluators**: These modules assess and extract information from conversations, helping agents track goals, build memory, and maintain context awareness.
3334
- **Character Files**: These JSON files define the personality, knowledge, and behavior of each AI agent.

docs/docs/guides/local-development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,4 +447,4 @@ npx knowledge2character <character-file> <knowledge-file>
447447
- [Configuration Guide](./configuration.md) for setup details
448448
- [Advanced Usage](./advanced.md) for complex features
449449
- [API Documentation](/api) for complete API reference
450-
- [Contributing Guide](../community/contributing.md) for contribution guidelines
450+
- [Contributing Guide](../contributing.md) for contribution guidelines

packages/client-direct/src/api.ts

+62
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111

1212
import { REST, Routes } from "discord.js";
1313
import { DirectClient } from ".";
14+
import { stringToUuid } from "@elizaos/core";
1415

1516
export function createApiRouter(
1617
agents: Map<string, AgentRuntime>,
@@ -121,5 +122,66 @@ export function createApiRouter(
121122
}
122123
});
123124

125+
router.get("/agents/:agentId/:roomId/memories", async (req, res) => {
126+
const agentId = req.params.agentId;
127+
const roomId = stringToUuid(req.params.roomId);
128+
let runtime = agents.get(agentId);
129+
130+
// if runtime is null, look for runtime with the same name
131+
if (!runtime) {
132+
runtime = Array.from(agents.values()).find(
133+
(a) => a.character.name.toLowerCase() === agentId.toLowerCase()
134+
);
135+
}
136+
137+
if (!runtime) {
138+
res.status(404).send("Agent not found");
139+
return;
140+
}
141+
142+
try {
143+
const memories = await runtime.messageManager.getMemories({
144+
roomId,
145+
});
146+
const response = {
147+
agentId,
148+
roomId,
149+
memories: memories.map((memory) => ({
150+
id: memory.id,
151+
userId: memory.userId,
152+
agentId: memory.agentId,
153+
createdAt: memory.createdAt,
154+
content: {
155+
text: memory.content.text,
156+
action: memory.content.action,
157+
source: memory.content.source,
158+
url: memory.content.url,
159+
inReplyTo: memory.content.inReplyTo,
160+
attachments: memory.content.attachments?.map(
161+
(attachment) => ({
162+
id: attachment.id,
163+
url: attachment.url,
164+
title: attachment.title,
165+
source: attachment.source,
166+
description: attachment.description,
167+
text: attachment.text,
168+
contentType: attachment.contentType,
169+
})
170+
),
171+
},
172+
embedding: memory.embedding,
173+
roomId: memory.roomId,
174+
unique: memory.unique,
175+
similarity: memory.similarity,
176+
})),
177+
};
178+
179+
res.json(response);
180+
} catch (error) {
181+
console.error("Error fetching memories:", error);
182+
res.status(500).json({ error: "Failed to fetch memories" });
183+
}
184+
});
185+
124186
return router;
125187
}

0 commit comments

Comments
 (0)