Skip to content

Commit b04604a

Browse files
authored
Merge branch 'develop' into feature/plugin-hyperliquid
2 parents 4c8fcd5 + bf5b72d commit b04604a

18 files changed

+297
-64
lines changed

docs/README_PT.md

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Eliza - framework de simulação Multi-agentes
2+
3+
# https://github.com/elizaOS/eliza
4+
5+
# Visite https://eliza.builders para suporte
6+
7+
## 🌍 README Traduções
8+
9+
[中文说明](README_CN.md) | [Deutsch](README_DE.md) | [Français](README_FR.md) | [ไทย](README_TH.md) | [Español](README_ES.md) | [Português](README_PT.md)
10+
11+
# dev branch
12+
13+
<img src="static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
14+
15+
_Como visto dando funcionamento em [@DegenSpartanAI](https://x.com/degenspartanai) e [@MarcAIndreessen](https://x.com/pmairca)_
16+
17+
- Framework Multi-agente de simulação
18+
- Adicione quantos personagens únicos quiser com o [characterfile](https://github.com/lalalune/characterfile/)
19+
- Conectores completos para Discord e Twitter, com suporte para canais de voz no Discord
20+
- Memória RAG completa para conversas e documentos
21+
- Pode ler links e PDFs, transcrever áudios e vídeos, resumir conversas e muito mais
22+
- Altamente extensível - crie suas próprias ações e clientes para ampliar as capacidades do Eliza
23+
- Suporte para modelos de código aberto e locais (configuração padrão com Nous Hermes Llama 3.1B)
24+
- Suporte ao OpenAI para inferência em nuvem em dispositivos com configurações leves
25+
- Modo "Perguntar ao Claude" para chamadas a Claude em consultas mais complexas
26+
- 100% Typescript
27+
28+
# Iniciando
29+
30+
**Pré-requisitos (OBRIGATÓRIO):**
31+
32+
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
33+
- [pnpm](https://pnpm.io/installation)
34+
35+
### Edite o arquivo .env
36+
37+
- Copie .env.example para .env e preencha com valores apropriados
38+
- Edite as variáveis de ambiente do TWITTER para adicionar o nome de usuário e a senha do seu bot
39+
40+
### Edite o arquivo de personagem (character file)
41+
42+
- Verifique o arquivo `src/core/defaultCharacter.ts` - você pode modificá-lo
43+
- Você também pode carregar personagens com o comando `pnpm start --characters="path/to/your/character.json"` e executar vários bots ao mesmo tempo.
44+
45+
Após configurar o arquivo .env e o arquivo de personagem (character file), você pode iniciar o bot com o seguinte comando:
46+
47+
```
48+
pnpm i
49+
pnpm start
50+
```
51+
52+
# Personalizando Eliza
53+
54+
### Adicionando ações personalizadas
55+
56+
Para evitar conflitos no diretório principal, recomendamos adicionar ações personalizadas a um diretório chamado `custom_actions` e, em seguida, incluí-las no arquivo `elizaConfig.yaml`. Consulte o arquivo `elizaConfig.example.yaml` para um exemplo.
57+
58+
## Rodando com diferentes modelos
59+
60+
### Rode com Llama
61+
62+
Você pode executar modelos Llama 70B ou 405B configurando a variável de ambiente `XAI_MODEL` para `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` ou `meta-llama/Meta-Llama-3.1-405B-Instruct`
63+
64+
### Rode com Grok
65+
66+
Você pode executar modelos Grok configurando a variável de ambiente `XAI_MODEL` para `grok-beta`.
67+
68+
### Rode com OpenAI
69+
70+
Você pode executar modelos OpenAI configurando a variável de ambiente para `gpt-4-mini` or `gpt-4o`
71+
72+
## Requisitos Adicionais
73+
74+
Você pode precisar instalar o Sharp. Se aparecer um erro ao iniciar, tente instalá-lo com o seguinte comando:
75+
76+
```
77+
pnpm install --include=optional sharp
78+
```
79+
80+
# Configuração do Ambiente
81+
82+
Você precisará adicionar variáveis de ambiente ao seu arquivo .env para conectar a diversas plataformas:
83+
84+
```
85+
# Variaveis de ambiente obrigatorias
86+
DISCORD_APPLICATION_ID=
87+
DISCORD_API_TOKEN= # Bot token
88+
OPENAI_API_KEY=sk-* # OpenAI API key, começando com sk-
89+
ELEVENLABS_XI_API_KEY= # API key da elevenlabs
90+
91+
# Configuracoes 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= # Usuário da conta
103+
TWITTER_PASSWORD= # Senha da conta
104+
TWITTER_EMAIL= # Email da conta
105+
106+
X_SERVER_URL=
107+
XAI_API_KEY=
108+
XAI_MODEL=
109+
110+
111+
# Para perguntas ao 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+
# Configuração de Inferência Local
132+
133+
### Configuração CUDA
134+
135+
Se você tiver uma GPU NVIDIA, pode instalar o CUDA para acelerar significativamente a inferência local.
136+
137+
```
138+
pnpm install
139+
npx --no node-llama-cpp source download --gpu cuda
140+
```
141+
142+
Certifique-se de que você instalou o CUDA Toolkit, incluindo o cuDNN e cuBLAS.
143+
144+
### Rodando localmente
145+
146+
Add XAI_MODEL e defina-o para uma das opções mencionadas em [Run with
147+
Llama](#run-with-llama) - você pode deixar X_SERVER_URL e XAI_API_KEY em branco,
148+
pois o modelo será baixado do Hugging Face e consultado localmente.
149+
150+
# Clientes
151+
152+
## Discord Bot
153+
154+
Para ajuda com a configuração do seu bot no Discord, consulte aqui: https://discordjs.guide/preparations/setting-up-a-bot-application.html
155+
156+
# Desenvolvimento
157+
158+
## Testando
159+
160+
Para executar a suíte de testes:
161+
162+
```bash
163+
pnpm test # Executar os testes uma vez
164+
pnpm test:watch # Executar os testes no modo de observação/monitoramento (watch mode)
165+
```
166+
167+
Para testes específicos de banco de dados:
168+
169+
```bash
170+
pnpm test:sqlite # Rode testes com SQLite
171+
pnpm test:sqljs # Rode testes com SQL.js
172+
```
173+
174+
Os testes são escritos usando o Jest e podem ser encontrados nos arquivos. O ambiente de teste está configurado para:
175+
176+
- Carregar variáveis de ambiente do arquivo `.env.test`
177+
- Usar um tempo limite de 2 minutos para testes de longa duração
178+
- Suportar módulos ESM
179+
- Executar os testes em sequência (--runInBand)
180+
181+
Para criar novos testes, adicione um arquivo `.test.ts` ao lado do código que você está testando.
182+
183+
## Atualizações da Documentação
184+
185+
Por favor, verifique se a documentação fornecida está correta. Para fazer isso, execute o serviço de documentação (docs) abaixo.
186+
187+
```console
188+
docker compose -f docker-compose-docs.yaml up --build
189+
```
190+
191+
O servidor do Docusaurus será iniciado e você poderá verificar a documentação localmente em https://localhost:3000/eliza.

packages/plugin-akash/src/actions/closeDeployment.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import { MsgCloseDeployment } from "@akashnetwork/akash-api/akash/deployment/v1b
77
import { validateAkashConfig } from "../environment";
88
import { fetchDeployments } from "./getDeploymentApi";
99
import { AkashError, AkashErrorCode } from "../error/error";
10-
import { getCertificatePath } from "../utils/paths";
11-
import { inspectRuntime, isPluginLoaded } from "../runtime_inspect";
10+
// import { getCertificatePath } from "../utils/paths";
11+
import { isPluginLoaded } from "../runtime_inspect";
1212

1313
interface CloseDeploymentContent extends Content {
1414
dseq?: string;
1515
closeAll?: boolean;
1616
}
1717

1818
// Certificate file path
19-
const CERTIFICATE_PATH = getCertificatePath(import.meta.url);
19+
// const CERTIFICATE_PATH = getCertificatePath(import.meta.url);
2020

2121
// Initialize wallet and client
2222
async function initializeClient(runtime: IAgentRuntime) {
@@ -312,7 +312,7 @@ export const closeDeploymentAction: Action = {
312312
runtime: IAgentRuntime,
313313
message: Memory,
314314
state: State | undefined,
315-
options: { [key: string]: unknown } = {},
315+
_options: { [key: string]: unknown } = {},
316316
callback?: HandlerCallback
317317
): Promise<boolean> => {
318318
const actionId = Date.now().toString();

packages/plugin-akash/src/actions/createDeployment.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { AkashError, AkashErrorCode, withRetry } from "../error/error";
1616
import * as fs from 'fs';
1717
import * as path from 'path';
1818
import { getCertificatePath, getDefaultSDLPath } from "../utils/paths";
19-
import { fileURLToPath } from 'url';
19+
// import { fileURLToPath } from 'url';
2020
import { inspectRuntime, isPluginLoaded } from "../runtime_inspect";
2121
import https from 'node:https';
2222
import axios from 'axios';
@@ -162,7 +162,8 @@ const loadSDLFromFile = (filePath: string): string => {
162162
}
163163
};
164164

165-
const formatErrorMessage = (error: unknown): string => {
165+
// Preserved for future use
166+
/* const formatErrorMessage = (error: unknown): string => {
166167
if (error instanceof AkashError) {
167168
if (error.code === AkashErrorCode.WALLET_NOT_INITIALIZED) {
168169
return "Akash wallet not initialized";
@@ -196,7 +197,7 @@ const formatErrorMessage = (error: unknown): string => {
196197
return "Failed to parse SDL: Invalid format";
197198
}
198199
return message;
199-
};
200+
}; */
200201

201202
async function initializeWallet(mnemonic: string) {
202203
elizaLogger.debug("=== Initializing Wallet ===", {
@@ -619,7 +620,7 @@ async function queryLeaseStatus(lease: any, providerUri: string, certificate: Ce
619620
'Content-Type': 'application/json',
620621
'Accept': 'application/json'
621622
},
622-
// @ts-ignore - Node's fetch has agent support
623+
// @ts-expect-error - TypeScript's fetch types don't include Node's agent support, but it exists at runtime
623624
agent,
624625
signal: AbortSignal.timeout(10000)
625626
});
@@ -1138,7 +1139,7 @@ export const createDeploymentAction: Action = {
11381139
runtime: IAgentRuntime,
11391140
message: Memory,
11401141
state: State | undefined,
1141-
options: { [key: string]: unknown; } = {},
1142+
_options: { [key: string]: unknown; } = {},
11421143
callback?: HandlerCallback
11431144
): Promise<boolean> => {
11441145
const actionId = Date.now().toString();

packages/plugin-akash/src/actions/getDeploymentApi.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { validateAkashConfig } from "../environment";
55
import { AkashError, AkashErrorCode } from "../error/error";
66
import * as fs from 'fs';
77
import * as path from 'path';
8-
import { getCertificatePath, getDeploymentsPath } from "../utils/paths";
8+
import { getDeploymentsPath } from "../utils/paths";
99

1010
export interface DeploymentInfo {
1111
owner: string;
@@ -278,7 +278,6 @@ export async function loadDeploymentInfo(filePath: string): Promise<DeploymentIn
278278
elizaLogger.info("Loading deployment info", { filePath });
279279

280280
try {
281-
const fs = require('fs');
282281
if (!fs.existsSync(filePath)) {
283282
throw new AkashError(
284283
`Deployment info file not found: ${filePath}`,
@@ -383,14 +382,14 @@ export const getDeploymentApiAction: Action = {
383382
runtime: IAgentRuntime,
384383
message: Memory,
385384
state: State | undefined,
386-
options: { [key: string]: unknown } = {},
385+
_options: { [key: string]: unknown } = {},
387386
callback?: HandlerCallback
388387
): Promise<boolean> => {
389388
const actionId = Date.now().toString();
390389
elizaLogger.info("Starting deployment API request", { actionId });
391390

392391
try {
393-
const config = await validateAkashConfig(runtime);
392+
// const config = await validateAkashConfig(runtime);
394393
const params = message.content as Partial<GetDeploymentsContent>;
395394

396395
// Fetch deployments

packages/plugin-akash/src/actions/getDeploymentStatus.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const getDeploymentStatusAction: Action = {
144144
runtime: IAgentRuntime,
145145
message: Memory,
146146
state: State | undefined,
147-
options: { [key: string]: unknown } = {},
147+
_options: { [key: string]: unknown } = {},
148148
callback?: HandlerCallback
149149
): Promise<boolean> => {
150150
const actionId = Date.now().toString();

packages/plugin-akash/src/actions/getGPUPricing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const getGPUPricingAction: Action = {
9494
runtime: IAgentRuntime,
9595
message: Memory,
9696
state: State | undefined,
97-
options: { [key: string]: unknown; } = {},
97+
_options: { [key: string]: unknown; } = {},
9898
callback?: HandlerCallback
9999
): Promise<boolean> => {
100100
const actionId = Date.now().toString();

packages/plugin-akash/src/actions/getManifest.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { AkashError, AkashErrorCode } from "../error/error";
66
import * as fs from 'fs';
77
import * as path from 'path';
88
import yaml from 'js-yaml';
9-
import { getAkashTypeRegistry } from "@akashnetwork/akashjs/build/stargate";
10-
import { getCertificatePath, getDefaultSDLPath } from "../utils/paths";
9+
// import { getAkashTypeRegistry } from "@akashnetwork/akashjs/build/stargate";
10+
import { getDefaultSDLPath } from "../utils/paths";
1111

1212
interface GetManifestContent extends Content {
1313
sdl?: string;
@@ -121,10 +121,10 @@ const validateSDL = (sdlContent: string, validationLevel: string = "strict"): bo
121121
// });
122122
return true;
123123
} catch (error) {
124-
// elizaLogger.error("SDL validation failed", {
125-
// error: error instanceof Error ? error.message : String(error),
126-
// validationLevel
127-
// });
124+
elizaLogger.error("SDL validation failed", {
125+
error: error instanceof Error ? error.message : String(error),
126+
validationLevel
127+
});
128128
return false;
129129
}
130130
};
@@ -186,7 +186,7 @@ export const getManifestAction: Action = {
186186
runtime: IAgentRuntime,
187187
message: Memory,
188188
state: State | undefined,
189-
options: { [key: string]: unknown; } = {},
189+
_options: { [key: string]: unknown; } = {},
190190
callback?: HandlerCallback
191191
): Promise<boolean> => {
192192
const actionId = Date.now().toString();

packages/plugin-akash/src/actions/getProvidersList.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export const getProvidersListAction: Action = {
211211
runtime: IAgentRuntime,
212212
message: Memory,
213213
state: State | undefined,
214-
options: { [key: string]: unknown; } = {},
214+
_options: { [key: string]: unknown; } = {},
215215
callback?: HandlerCallback
216216
): Promise<boolean> => {
217217
const actionId = Date.now().toString();

packages/plugin-akash/src/error/error.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { elizaLogger } from "@elizaos/core";
21

32
export enum AkashErrorCategory {
43
WALLET = 'WALLET',

packages/plugin-akash/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Plugin, elizaLogger } from "@elizaos/core";
1+
import { Plugin} from "@elizaos/core";
22
import { createDeploymentAction } from "./actions/createDeployment";
33
import { closeDeploymentAction } from "./actions/closeDeployment";
44
import { getProviderInfoAction } from "./actions/getProviderInfo";

packages/plugin-akash/src/providers/wallet.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
22
import { SigningStargateClient } from "@cosmjs/stargate";
3-
import { elizaLogger } from "@elizaos/core";
4-
import { IAgentRuntime, Memory } from "@elizaos/core/src/types";
3+
import { elizaLogger, IAgentRuntime, Memory } from "@elizaos/core";
4+
// import { IAgentRuntime, Memory } from "@elizaos/core/src/types";
55
import { validateAkashConfig } from "../environment";
66
import { getAkashTypeRegistry } from "@akashnetwork/akashjs/build/stargate";
77
import {
88
AkashProvider,
99
AkashWalletState,
1010
AkashError,
1111
AKASH_ERROR_CODES,
12-
AkashRegistryTypes
1312
} from "../types";
1413

1514
// Use a proper UUID for the wallet room

0 commit comments

Comments
 (0)