Skip to content

Commit

Permalink
Merge pull request elizaOS#1 from ai16z/main
Browse files Browse the repository at this point in the history
upstream
  • Loading branch information
genecyber authored Nov 18, 2024
2 parents b6cdbdf + c96e838 commit 3508c91
Show file tree
Hide file tree
Showing 345 changed files with 16,447 additions and 29,168 deletions.
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=

#POST INTERVAL RANDOM MIN-MAX MINUTES
POST_INTERVAL_MIN= #90 #Default
POST_INTERVAL_MAX= #180 #Default


#USE IMAGE GEN
IMAGE_GEN= #TRUE

Expand All @@ -55,6 +60,13 @@ LARGE_OLLAMA_MODEL= #default hermes3:70b
# For asking Claude stuff
ANTHROPIC_API_KEY=

# Heurist API (Get API Key at https://heurist.ai/dev-access)
HEURIST_API_KEY=
SMALL_HEURIST_LANGUAGE_MODEL=
MEDIUM_HEURIST_LANGUAGE_MODEL=
LARGE_HEURIST_LANGUAGE_MODEL=
HEURIST_IMAGE_MODEL=

WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY

Expand All @@ -72,3 +84,7 @@ TELEGRAM_BOT_TOKEN=

TOGETHER_API_KEY=
SERVER_PORT=3000

# Starknet
STARKNET_ADDRESS=
STARKNET_PRIVATE_KEY=
28 changes: 28 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR Title Check

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-pr-title:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Validate PR title
id: validate
run: |
PR_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
echo "PR Title: $PR_TITLE"
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore):\ .+ ]]; then
echo "PR title does not match the required pattern."
exit 1
fi
- name: Set status
if: failure()
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use the format: 'type: description' (e.g., 'feat: add new feature')."
205 changes: 57 additions & 148 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,192 +1,101 @@
# Eliza
# Eliza 🤖

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

### [For Chinese Version: 中文说明](./README_CN.md)
### [For Japanese Version: 日本語の説明](./README_JA.md)
### [For Korean Version: 한국어 설명](./README_KOR.md)
### [For French Version: Instructions en français](./README_FR.md)
### [For Portuguese Version: Instruções em português](./README_PTBR.md)
<div align="center">
📖 [Documentation](https://ai16z.github.io/eliza/) | 🎯 [Examples](https://github.com/thejoven/awesome-eliza)
</div>

## Features
## 🌍 README Translations
[中文说明](./README_CN.md) | [日本語の説明](./README_JA.md) | [한국어 설명](./README_KOR.md) | [Français](./README_FR.md) | [Português](./README_PTBR.md) | [Türkçe](./README_TR.md) | [Русский](./README_RU.md) | [Español](./README_ES.md)

- 🛠 Full-featured Discord, Twitter and Telegram connectors
## ✨ Features

- 🛠️ Full-featured Discord, Twitter and Telegram connectors
- 🔗 Support for every model (Llama, Grok, OpenAI, Anthropic, etc.)
- 👥 Multi-agent and room support
- 📚 Easily ingest and interact with your documents
- 💾 Retrievable memory and document store
- 🚀 Highly extensible - create your own actions and clients to extend capabilities
- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more
- 🚀 Highly extensible - create your own actions and clients
- ☁️ Supports many models (local Llama, OpenAI, Anthropic, Groq, etc.)
- 📦 Just works!

## What can I use it for?
## 🎯 Use Cases

- 🤖 Chatbots
- 🕵️ Autonomous Agents
- 📈 Business process handling
- 🎮 Video game NPCs
- 📈 Business Process Handling
- 🎮 Video Game NPCs
- 🧠 Trading

## 🚀 Quick Start

# Getting Started
### Prerequisites

**Prerequisites (MUST):**

- [Python 2.7+](https://www.python.org/downloads/)
- [Node.js 23.1+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- [pnpm](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

### Edit the character file

- Check out the file `src/core/defaultCharacter.ts` - you can modify this
- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time.

After setting up the .env file and character file, you can start the bot with the following command:

```
pnpm i
pnpm start
```

# Customising Eliza

### Adding custom actions
> **Note for Windows Users:** WSL is required
To avoid git clashes in the core directory, we recommend adding custom actions to a `custom_actions` directory and then adding them to the `elizaConfig.yaml` file. See the `elizaConfig.example.yaml` file for an example.

## Running with different models

### 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`

### Run with Grok

You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta`

### Run with OpenAI

You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o`

## Additional Requirements
### Edit the .env file

You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
Copy .env.example to .env and fill in the appropriate values

```
pnpm install --include=optional sharp
cp .env.example .env
```

# Environment Setup
### Automatically Start Eliza

You will need to add environment variables to your .env file to connect to various platforms:
This will run everything to setup the project and start the bot with the default character.

```bash
sh scripts/start.sh
```
# Required environment variables
DISCORD_APPLICATION_ID=
DISCORD_API_TOKEN= # Bot token
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key
# ELEVENLABS SETTINGS
ELEVENLABS_MODEL_ID=eleven_multilingual_v2
ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM
ELEVENLABS_VOICE_STABILITY=0.5
ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9
ELEVENLABS_VOICE_STYLE=0.66
ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false
ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4
ELEVENLABS_OUTPUT_FORMAT=pcm_16000
TWITTER_DRY_RUN=false
TWITTER_USERNAME= # Account username
TWITTER_PASSWORD= # Account password
TWITTER_EMAIL= # Account email
TWITTER_COOKIES= # Account cookies

X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=
# For asking Claude stuff
ANTHROPIC_API_KEY=
WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY
WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY
BIRDEYE_API_KEY=
SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=
## Telegram
TELEGRAM_BOT_TOKEN=
### Edit the character file

TOGETHER_API_KEY=
```
1. Open `packages/agent/src/character.ts` to modify the default character. Uncomment and edit.

# Local Inference Setup
2. To load custom characters:
- Use `pnpm start --characters="path/to/your/character.json"`
- Multiple character files can be loaded simultaneously

### CUDA Setup
### Manually Start Eliza

If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically.
```bash
pnpm i
pnpm build
pnpm start

# The project iterates fast, sometimes you need to clean the project if you are coming back to the project
pnpm clean
```
pnpm install
npx --no node-llama-cpp source download --gpu cuda
```

Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS.

### Running locally
#### Additional Requirements

Add XAI_MODEL and set it to one of the above options from [Run with
Llama](#run-with-llama) - you can leave X_SERVER_URL and XAI_API_KEY blank, it
downloads the model from huggingface and queries it locally

# Clients

## Discord Bot

For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html

# Development

## Testing

To run the test suite:
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:

```bash
pnpm test # Run tests once
pnpm test:watch # Run tests in watch mode
```

For database-specific tests:

```bash
pnpm test:sqlite # Run tests with SQLite
pnpm test:sqljs # Run tests with SQL.js
pnpm install --include=optional sharp
```

Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to:
### Community & contact

- Load environment variables from `.env.test`
- Use a 2-minute timeout for long-running tests
- Support ESM modules
- Run tests in sequence (--runInBand)
- [GitHub Issues](https://github.com/ai16z/eliza/issues). Best for: bugs you encounter using Eliza, and feature proposals.
- [Discord](https://discord.gg/ai16z). Best for: sharing your applications and hanging out with the community.

To create new tests, add a `.test.ts` file adjacent to the code you're testing.
## Contributors

## Docker
<a href="https://github.com/ai16z/eliza/graphs/contributors">
<img src="https://contrib.rocks/image?repo=ai16z/eliza" />
</a>

For development purposes, you can run the docker container with the following command:
## Star History

```
pnpm docker
```
[![Star History Chart](https://api.star-history.com/svg?repos=ai16z/eliza&type=Date)](https://star-history.com/#ai16z/eliza&Date)
Loading

0 comments on commit 3508c91

Please sign in to comment.