Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/MarcoMandar/Eliza
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoMandar committed Nov 1, 2024
2 parents dd3d4a6 + 03ebf68 commit d7bda2e
Show file tree
Hide file tree
Showing 184 changed files with 32,099 additions and 29,643 deletions.
Empty file removed .bashrc
Empty file.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ci

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9.4.0

- name: Install dependencies
run: pnpm i

- name: Run Prettier
run: pnpm run prettier --check .

- name: Build packages
run: pnpm run build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/node_modules
node_modules
/out

.env
Expand All @@ -25,6 +25,7 @@ logs/
test-report.json
content_cache/
test_data/
tokencache/
tweetcache/
twitter_cookies.json
timeline_cache.json
Expand Down
15 changes: 15 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**/*/target
**/*/dist
packages/torii-client/wasm
packages/torii-client/pkg
packages/torii-wasm/pkg/
packages/utils-wasm/pkg/

worlds/dojo-starter

# ignore lock files
**/*-lock.yaml
package-lock.json
dev-dist

**/CHANGELOG.md
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eliza

<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%">
<img src="./docs/eliza_banner.jpg" alt="Eliza Banner" width="100%" />

*As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)*

Expand All @@ -20,6 +20,10 @@
## Install Node.js
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

## Using pnpm
We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces.
https://pnpm.io/installation

## Edit the .env file
- Copy .env.example to .env and fill in the appropriate values
- Edit the TWITTER environment variables to add your bot's username and password
Expand All @@ -28,12 +32,6 @@ https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- Check out the file `src/core/defaultCharacter.ts` - you can modify this
- You can also load characters with the `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` and run multiple bots at the same time.

### Linux Installation
You might need these
```
npm install --include=optional sharp
```

### Run with Llama
You can run Llama 70B or 405B models by setting the `XAI_MODEL` environment variable to `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` or `meta-llama/Meta-Llama-3.1-405B-Instruct`

Expand All @@ -49,7 +47,7 @@ If you are getting strange issues when starting up, make sure you're using Node
## Additional Requirements
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
```
npm install --include=optional sharp
pnpm install --include=optional sharp
```

# Environment Setup
Expand All @@ -74,7 +72,7 @@ TWITTER_COOKIES= # Account cookies

If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically.
```
npm install
pnpm install
npx --no node-llama-cpp source download --gpu cuda
```

Expand Down
4 changes: 1 addition & 3 deletions characters/tate.character.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "tate",
"clients": ["discord", "direct, telegram"],
"clients": ["discord", "twitter", "telegram"],
"settings": {
"model": "gpt-4o-mini",
"embeddingModel": "text-embedding-3-small",
"secrets": {},
"voice": {
"model": "en_US-male-medium"
Expand Down
4 changes: 1 addition & 3 deletions characters/trump.character.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "trump",
"clients": ["discord", "direct", "telegram"],
"clients": ["discord", "twitter", "telegram"],
"settings": {
"model": "gpt-4o-mini",
"embeddingModel": "text-embedding-3-small",
"secrets": {},
"voice": {
"model": "en_US-male-medium"
Expand Down
2 changes: 2 additions & 0 deletions .env.example → core/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ HELIUS_API_KEY=

## Telegram
TELEGRAM_BOT_TOKEN=

TOGETHER_API_KEY=
8 changes: 8 additions & 0 deletions core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules/*
**/coverage/*
**/dist/*
**/types/*
**/scripts/concatenated-output.ts
rollup.config.js
jest.config.js
docs/
2 changes: 2 additions & 0 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
52 changes: 52 additions & 0 deletions core/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import typescript from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';

export default [
// JavaScript and TypeScript files
{
files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"],
languageOptions: {
parser: typescript,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json' // Make sure your tsconfig includes @types/node
},
globals: {
// Add Node.js globals
NodeJS: 'readonly',
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint
},
rules: {
...eslint.configs.recommended.rules,
...tseslint.configs.recommended.rules,
"prefer-const": "warn",
"no-constant-binary-expression": "error",

// Disable no-undef as TypeScript handles this better
"no-undef": "off",

// Customize TypeScript rules
"@typescript-eslint/no-explicit-any": "warn", // Changed from error to warn
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}]
}
},
// Add prettier as the last config to override other formatting rules
prettier
];
File renamed without changes.
File renamed without changes.
182 changes: 182 additions & 0 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
{
"name": "eliza",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"lint": "eslint . --fix",
"start": "node --loader ts-node/esm src/index.ts",
"start:arok": "node --loader ts-node/esm src/index.ts --characters=\"characters/arok.character.json\"",
"start:service:ruby": "pm2 start npm --name=\"ruby\" --restart-delay=3000 --max-restarts=10 -- run start:ruby",
"stop:service:ruby": "pm2 stop ruby",
"start:ruby": "node --loader ts-node/esm src/index.ts --characters=\"characters/ruby.character.json\"",
"start:service:trump": "pm2 start npm --name=\"trump\" --restart-delay=3000 --max-restarts=10 -- run start:trump",
"stop:service:trump": "pm2 stop trump",
"start:service:degen": "pm2 start npm --name=\"degen\" --restart-delay=3000 --max-restarts=10 -- run start:degen",
"stop:service:degen": "pm2 stop degen",
"start:degen": "node --loader ts-node/esm src/index.ts --characters=\"characters/degenspartan.json\"",
"start:service:all": "pm2 start npm --name=\"all\" --restart-delay=3000 --max-restarts=10 -- run start:degen",
"stop:service:all": "pm2 stop all",
"start:all": "node --loader ts-node/esm src/index.ts --characters=\"characters/degenspartan.json\",\"characters/ruby.character.json\"",
"start:trump": "node --loader ts-node/esm src/index.ts --characters=\"characters/trump.character.json\"",
"start:service:tate": "pm2 start npm --name=\"tate\" --restart-delay=3000 --max-restarts=10 -- run start:tate",
"stop:service:tate": "pm2 stop tate",
"start:tate": "node --loader ts-node/esm src/index.ts --characters=\"characters/tate.character.json\"",
"watch": "tsc --watch",
"dev": "tsc && nodemon",
"build:docs": "cd docs && npm run build",
"postinstall": "npx playwright install-deps && npx playwright install",
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --runInBand --watch -f",
"test:sqlite": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" TEST_DATABASE_CLIENT=sqlite jest --runInBand --watch -f",
"test:sqljs": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" TEST_DATABASE_CLIENT=sqljs jest --runInBand --watch -f"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.13.0",
"@rollup/plugin-commonjs": "25.0.8",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-replace": "5.0.7",
"@rollup/plugin-terser": "0.1.0",
"@rollup/plugin-typescript": "11.1.6",
"@types/better-sqlite3": "7.6.11",
"@types/fluent-ffmpeg": "2.1.27",
"@types/jest": "29.5.14",
"@types/node": "22.8.4",
"@types/sql.js": "1.4.9",
"@types/tar": "6.1.13",
"@types/wav-encoder": "1.3.3",
"@typescript-eslint/eslint-plugin": "8.12.2",
"@typescript-eslint/parser": "8.12.2",
"dotenv": "16.4.5",
"eslint": "9.13.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"itty-router": "5.0.18",
"jest": "29.7.0",
"lint-staged": "15.2.10",
"npm-run-all2": "7.0.1",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"rollup": "2.79.2",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"tslib": "2.8.0",
"typescript": "5.6.3",
"wrangler": "3.84.0"
},
"dependencies": {
"@ai-sdk/anthropic": "^0.0.53",
"@ai-sdk/google": "^0.0.55",
"@ai-sdk/google-vertex": "^0.0.42",
"@ai-sdk/groq": "^0.0.3",
"@ai-sdk/openai": "^0.0.70",
"@anthropic-ai/sdk": "^0.30.1",
"@cliqz/adblocker-playwright": "1.34.0",
"@coral-xyz/anchor": "^0.30.1",
"@discordjs/opus": "github:discordjs/opus",
"@discordjs/rest": "2.4.0",
"@discordjs/voice": "0.17.0",
"@echogarden/espeak-ng-emscripten": "0.3.0",
"@echogarden/kissfft-wasm": "0.2.0",
"@echogarden/speex-resampler-wasm": "0.2.1",
"@huggingface/transformers": "3.0.1",
"@opendocsg/pdf2md": "0.1.31",
"@solana/spl-token": "0.4.9",
"@solana/web3.js": "1.95.4",
"@supabase/supabase-js": "2.46.1",
"@telegraf/types": "7.1.0",
"@types/body-parser": "1.19.5",
"@types/cors": "2.8.17",
"@types/express": "5.0.0",
"agent-twitter-client": "0.0.13",
"ai": "^3.4.23",
"alawmulaw": "6.0.0",
"ansi-colors": "4.1.3",
"anthropic-vertex-ai": "^1.0.0",
"better-sqlite3": "11.5.0",
"bignumber": "1.1.0",
"bignumber.js": "9.1.2",
"body-parser": "1.20.3",
"capsolver-npm": "2.0.2",
"cldr-segmentation": "2.2.1",
"command-exists": "1.2.9",
"commander": "12.1.0",
"cors": "2.8.5",
"cross-fetch": "4.0.0",
"csv-writer": "1.6.0",
"discord.js": "14.16.3",
"espeak-ng": "1.0.2",
"express": "4.21.1",
"ffmpeg-static": "5.2.0",
"figlet": "1.8.0",
"fluent-ffmpeg": "2.1.3",
"formdata-node": "6.0.3",
"fs-extra": "11.2.0",
"gaxios": "6.7.1",
"gif-frames": "^0.4.1",
"glob": "11.0.0",
"graceful-fs": "4.2.11",
"html-escaper": "3.0.3",
"html-to-text": "9.0.5",
"import-meta-resolve": "4.1.0",
"jieba-wasm": "2.2.0",
"js-sha1": "0.7.0",
"json5": "2.2.3",
"kuromoji": "0.1.2",
"libsodium-wrappers": "0.7.15",
"multer": "1.4.5-lts.1",
"node-cache": "5.1.2",
"node-llama-cpp": "3.1.1",
"node-wav": "0.0.2",
"nodejs-whisper": "0.1.18",
"nodemon": "3.1.7",
"onnxruntime-node": "1.20.0",
"openai": "4.69.0",
"pdfjs-dist": "4.7.76",
"pg": "^8.13.1",
"playwright": "1.48.2",
"pm2": "5.4.2",
"prism-media": "1.3.5",
"pumpdotfun-sdk": "1.3.2",
"puppeteer-extra": "3.3.6",
"puppeteer-extra-plugin-capsolver": "2.0.1",
"sql.js": "1.12.0",
"sqlite-vec": "0.1.4-alpha.2",
"srt": "0.0.3",
"systeminformation": "5.23.5",
"tar": "7.4.3",
"telegraf": "4.16.3",
"tiktoken": "1.0.17",
"tinyld": "1.3.4",
"together-ai": "^0.7.0",
"unique-names-generator": "4.7.1",
"uuid": "11.0.2",
"uuidv4": "6.2.13",
"wav": "1.0.2",
"wav-encoder": "1.3.0",
"wavefile": "11.0.0",
"whisper-turbo": "0.11.0",
"ws": "8.18.0",
"yargs": "17.7.2",
"youtube-dl-exec": "3.0.10"
},
"trustedDependencies": {
"onnxruntime-node": "1.19.0",
"@discordjs/opus": "github:discordjs/opus",
"sharp": "^0.33.5"
},
"optionalDependencies": {
"sharp": "0.33.5",
"sqlite-vss-darwin-arm64": "0.1.2",
"sqlite-vss-darwin-x64": "0.1.2",
"sqlite-vss-linux-arm64": "^0.1.2",
"sqlite-vss-linux-x64": "0.1.2",
"sqlite-vss-win32-arm64": "^0.1.2",
"sqlite-vss-win32-x64": "^0.1.2"
}
}
File renamed without changes.
Loading

0 comments on commit d7bda2e

Please sign in to comment.