Skip to content

Commit 0147d74

Browse files
authored
Merge branch 'develop' into fix/await-cached-prices-2
2 parents 02384d4 + 06c0e63 commit 0147d74

File tree

5 files changed

+103
-31
lines changed

5 files changed

+103
-31
lines changed

.devcontainer/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG NODE_VER=23.5.0
2+
ARG BASE_IMAGE=node:${NODE_VER}
3+
FROM $BASE_IMAGE
4+
5+
ENV DEBIAN_FRONTEND=noninteractive
6+
7+
# Install pnpm globally and install necessary build tools
8+
RUN apt-get update \
9+
&& apt-get install -y \
10+
git \
11+
python3 \
12+
make \
13+
g++ \
14+
nano \
15+
vim \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
ARG PNPM_VER=9.15.2
20+
RUN npm install -g pnpm@${PNPM_VER}
21+
22+
# Set Python 3 as the default python
23+
RUN ln -s /usr/bin/python3 /usr/bin/python
24+
ENV DEBIAN_FRONTEND=dialog

.devcontainer/devcontainer.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
2+
{
3+
"name": "elizaos-dev",
4+
"dockerFile": "Dockerfile",
5+
"build": {
6+
"args": {
7+
"NODE_VER": "23.5.0",
8+
"PNPM_VER": "9.15.2"
9+
}
10+
},
11+
"privileged": true,
12+
"runArgs": [
13+
"-p=3000:3000", // Add port for server api
14+
"-p=5173:5173", // Add port for client
15+
//"--volume=/usr/lib/wsl:/usr/lib/wsl", // uncomment for WSL
16+
//"--volume=/mnt/wslg:/mnt/wslg", // uncomment for WSL
17+
"--gpus=all", // ! uncomment for vGPU
18+
//"--device=/dev/dxg", // uncomment this for vGPU under WSL
19+
"--device=/dev/dri"
20+
],
21+
"containerEnv": {
22+
//"MESA_D3D12_DEFAULT_ADAPTER_NAME": "NVIDIA", // uncomment for WSL
23+
//"LD_LIBRARY_PATH": "/usr/lib/wsl/lib" // uncomment for WSL
24+
},
25+
"customizations": {
26+
"vscode": {
27+
"extensions": [
28+
"vscode.json-language-features",
29+
"vscode.css-language-features",
30+
// "foxundermoon.shell-format",
31+
// "dbaeumer.vscode-eslint",
32+
// "esbenp.prettier-vscode"
33+
"ms-python.python"
34+
]
35+
}
36+
},
37+
"features": {}
38+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ tsup.config.bundled_*.mjs
5050

5151
.turbo
5252
.cursorrules
53+
.pnpm-store
5354

5455
coverage
5556
.eslintcache

docs/docs/guides/local-development.md

+39-9
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,61 @@ This guide covers setting up and working with Eliza in a development environment
88

99
## Prerequisites
1010

11-
Before you begin, ensure you have:
11+
You can develop either in a **dev container** or directly on your **host machine**.
12+
13+
### Requirements:
1214

1315
```bash
1416
# Required
15-
Node.js 23+
16-
pnpm
17+
Node.js (v23+; not required if using the dev container)
18+
pnpm (not required if using the dev container)
1719
Git
1820

19-
# Optional but recommended
20-
VS Code
21-
Docker (for database development)
22-
CUDA Toolkit (for GPU acceleration)
21+
VS Code (mandatory for using the dev container or coding)
22+
Docker (mandatory for using the dev container or database development)
23+
CUDA Toolkit (optional, for GPU acceleration)
2324
```
2425
2526
## Initial Setup
2627
2728
### 1. Repository Setup
2829
30+
Clone the repository and navigate to the project directory:
31+
2932
```bash
3033
# Clone the repository
3134
git clone https://github.com/elizaos/eliza.git
3235
cd eliza
36+
```
37+
38+
### 2. (Optional) Run Inside a Dev Container
39+
40+
1. Open the project directory in **VS Code**:
41+
```bash
42+
code .
43+
```
44+
45+
2. In the bottom-right corner, you'll see a popup:
46+
**"Reopen in Container"** – Click it.
47+
48+
- If you don't see the popup or miss it, press `F1`, type:
49+
**"Reopen in Container"**, and select it.
50+
51+
3. Wait for the container to initialize.
3352
53+
4. Open a terminal (hotkey: `Ctrl+Shift+\``) and run commands from the **container terminal** going forward.
54+
55+
### 3. Setup dependencies
56+
57+
```bash
3458
# Install dependencies
3559
pnpm install
3660
3761
# Install optional dependencies
3862
pnpm install --include=optional sharp
3963
```
4064
41-
### 2. Environment Configuration
65+
### 4. Environment Configuration
4266
4367
Create your development environment file:
4468
@@ -56,7 +80,7 @@ XAI_API_KEY= # Leave blank for local inference
5680
XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Local model
5781
```
5882
59-
### 3. Local Model Setup
83+
### 5. Local Model Setup
6084
6185
For local inference without API dependencies:
6286
@@ -106,10 +130,16 @@ pnpm run dev --characters="characters/my-character.json"
106130
pnpm start:client
107131
```
108132
133+
NOTE: If you are using devcontainer, add --host argument to client:
134+
```
135+
pnpm start:client --host
136+
```
137+
109138
Look for the message:
110139
` ➜ Local: http://localhost:5173/`
111140
Click on that link or open a browser window to that location. Once you do that you should see the chat interface connect with the system and you can start interacting with your character.
112141
142+
113143
## Database Development
114144
115145
### SQLite (Recommended for Development)

packages/client-twitter/src/base.ts

+1-22
Original file line numberDiff line numberDiff line change
@@ -729,28 +729,10 @@ export class ClientBase extends EventEmitter {
729729
);
730730
}
731731

732-
async getCachedProfile(username: string) {
733-
return await this.runtime.cacheManager.get<TwitterProfile>(
734-
`twitter/${username}/profile`
735-
);
736-
}
737-
738-
async cacheProfile(profile: TwitterProfile) {
739-
await this.runtime.cacheManager.set(
740-
`twitter/${profile.username}/profile`,
741-
profile
742-
);
743-
}
744-
745732
async fetchProfile(username: string): Promise<TwitterProfile> {
746-
const cached = await this.getCachedProfile(username);
747-
748-
if (cached) return cached;
749-
750733
try {
751734
const profile = await this.requestQueue.add(async () => {
752735
const profile = await this.twitterClient.getProfile(username);
753-
// console.log({ profile });
754736
return {
755737
id: profile.userId,
756738
username,
@@ -767,13 +749,10 @@ export class ClientBase extends EventEmitter {
767749
} satisfies TwitterProfile;
768750
});
769751

770-
this.cacheProfile(profile);
771-
772752
return profile;
773753
} catch (error) {
774754
console.error("Error fetching Twitter profile:", error);
775-
776-
return undefined;
755+
throw error;
777756
}
778757
}
779758
}

0 commit comments

Comments
 (0)