Skip to content

Commit

Permalink
Merge pull request #20 from ai16z/main
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
MarcoMandar authored Nov 9, 2024
2 parents bcc17c6 + ce4d327 commit 462c56f
Show file tree
Hide file tree
Showing 420 changed files with 17,227 additions and 35,901 deletions.
18 changes: 18 additions & 0 deletions core/.env.example → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DISCORD_API_TOKEN= # Bot token
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
REDPILL_API_KEY= # REDPILL API Key
GROQ_API_KEY=gsk_*
OPENROUTER_API_KEY=

ELEVENLABS_XI_API_KEY= # API key from elevenlabs

Expand All @@ -27,6 +28,22 @@ X_SERVER_URL=
XAI_API_KEY=
XAI_MODEL=

#OpenRouter (Use one model for everything or set individual for small, medium, large tasks)
#leave blank to use defaults hermes 70b for small tasks & 405b for medium/large tasks
OPENROUTER_MODEL=
SMALL_OPENROUTER_MODEL=
MEDIUM_OLLAMA_MODEL=
LARGE_OLLAMA_MODEL=


#Set to Use for New OLLAMA provider
OLLAMA_SERVER_URL= #Leave blank for default localhost:11434
OLLAMA_MODEL=
OLLAMA_EMBEDDING_MODEL= #default mxbai-embed-large
#To use custom model types for different tasks set these
SMALL_OLLAMA_MODEL= #default llama3.2
MEDIUM_OLLAMA_MODEL= #default herems3
LARGE_OLLAMA_MODEL= #default hermes3:70b

# For asking Claude stuff
ANTHROPIC_API_KEY=
Expand All @@ -38,6 +55,7 @@ BIRDEYE_API_KEY=

SOL_ADDRESS=So11111111111111111111111111111111111111112
SLIPPAGE=1
BASE_MINT=So11111111111111111111111111111111111111112
RPC_URL=https://api.mainnet-beta.solana.com
HELIUS_API_KEY=

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:

- name: Create test env file
run: |
echo "TEST_DATABASE_CLIENT=sqlite" > core/.env.test
echo "NODE_ENV=test" >> core/.env.test
echo "TEST_DATABASE_CLIENT=sqlite" > packages/core/.env.test
echo "NODE_ENV=test" >> packages/core/.env.test
- name: Run tests
run: cd core && pnpm test
run: cd packages/core && pnpm test

- name: Build packages
run: pnpm run build
54 changes: 27 additions & 27 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Generate Changelog
on:
push:
tags:
- '*'
push:
tags:
- "*"
jobs:
changelog:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
- name: Generate Changelog
run: |
export PATH="$PATH:/home/runner/.local/share/gem/ruby/3.0.0/bin"
gem install --user-install github_changelog_generator
github_changelog_generator \
-u ${{ github.repository_owner }} \
-p ${{ github.event.repository.name }} \
--token ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
- name: Commit Changelog
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update changelog"
branch: main
file_pattern: "CHANGELOG.md"
commit_author: "GitHub Action <[email protected]>"
changelog:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
- name: Generate Changelog
run: |
export PATH="$PATH:/home/runner/.local/share/gem/ruby/3.0.0/bin"
gem install --user-install github_changelog_generator
github_changelog_generator \
-u ${{ github.repository_owner }} \
-p ${{ github.event.repository.name }} \
--token ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
- name: Commit Changelog
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: update changelog"
branch: main
file_pattern: "CHANGELOG.md"
commit_author: "GitHub Action <[email protected]>"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ embedding-cache.json
.DS_Store

dist/
# Allow models directory but ignore model files
models/*.gguf

cookies.json

Expand All @@ -31,4 +33,8 @@ twitter_cookies.json
timeline_cache.json

*.sqlite
characters/
characters/

packages/core/src/providers/cache
packages/core/src/providers/cache/*
cache/*
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

## Features

- 🛠 Full-featured Discord, Twitter and Telegram connectors
- 👥 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
- 📦 Just works!
- 🛠 Full-featured Discord, Twitter and Telegram connectors
- 👥 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
- 📦 Just works!

## What can I use it for?
- 🤖 Chatbots
- 🕵️ Autonomous Agents
- 📈 Business process handling
- 🎮 Video game NPCs

- 🤖 Chatbots
- 🕵️ Autonomous Agents
- 📈 Business process handling
- 🎮 Video game NPCs

# Getting Started

Expand Down Expand Up @@ -161,15 +162,17 @@ 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
```

Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to:
- Load environment variables from `.env.test`
- Use a 2-minute timeout for long-running tests
- Support ESM modules
- Run tests in sequence (--runInBand)

To create new tests, add a `.test.ts` file adjacent to the code you're testing.
- Load environment variables from `.env.test`
- Use a 2-minute timeout for long-running tests
- Support ESM modules
- Run tests in sequence (--runInBand)

To create new tests, add a `.test.ts` file adjacent to the code you're testing.
44 changes: 23 additions & 21 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

## 功能

- 🛠 支持discord/推特/telegram连接
- 👥 支持多模态agent
- 📚 简单的导入文档并与文档交互
- 💾 可检索的内存和文档存储
- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展
- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等
- 📦 简单好用

- 🛠 支持discord/推特/telegram连接
- 👥 支持多模态agent
- 📚 简单的导入文档并与文档交互
- 💾 可检索的内存和文档存储
- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展
- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等
- 📦 简单好用

你可以用Eliza做什么?
- 🤖 聊天机器人
- 🕵️ 自主Agents
- 📈 业务流程自动化处理
- 🎮 游戏NPC

- 🤖 聊天机器人
- 🕵️ 自主Agents
- 📈 业务流程自动化处理
- 🎮 游戏NPC

# 开始使用

Expand All @@ -30,7 +30,7 @@

### 编辑.env文件

- - 将 .env.example 复制为 .env 并填写适当的值
- - 将 .env.example 复制为 .env 并填写适当的值
- 编辑推特环境并输入你的推特账号和密码

### 编辑角色文件
Expand All @@ -39,6 +39,7 @@
- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。

在完成账号和角色文件的配置后,输入以下命令行启动你的bot:

```
pnpm i
pnpm start
Expand All @@ -53,13 +54,13 @@ pnpm start
## 配置不同的大模型

### 配置Llama

您可以通过设置 `XAI_MODEL` 环境变量为 `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo``meta-llama/Meta-Llama-3.1-405B-Instruct` 来运行 Llama 70B 或 405B 模型

### 配置OpenAI

您可以通过设置 `XAI_MODEL` 环境变量为 `gpt-4o-mini``gpt-4o` 来运行 OpenAI 模型


## 其他要求

您可能需要安装 Sharp。如果在启动时看到错误,请尝试使用以下命令安装:
Expand Down Expand Up @@ -135,10 +136,9 @@ npx --no node-llama-cpp source download --gpu cuda

### 本地运行

添加 XAI_MODEL 并将其设置为上述 [使用 Llama 运行](#run-with-llama) 中的选项之一
添加 XAI_MODEL 并将其设置为上述 [使用 Llama 运行](#run-with-llama) 中的选项之一
您可以将 X_SERVER_URL 和 XAI_API_KEY 留空,它会从 huggingface 下载模型并在本地查询


# 客户端

关于怎么设置discord bot,可以查看discord的官方文档
Expand All @@ -155,15 +155,17 @@ pnpm test:watch # Run tests in watch mode
```

对于数据库特定的测试:

```bash
pnpm test:sqlite # Run tests with SQLite
pnpm test:sqljs # Run tests with SQL.js
```

测试使用 Jest 编写,位于 src/**/*.test.ts 文件中。测试环境配置如下:
- 从 .env.test 加载环境变量
- 使用 2 分钟的超时时间来运行长时间运行的测试
- 支持 ESM 模块
- 按顺序运行测试 (--runInBand)
测试使用 Jest 编写,位于 src/\*_/_.test.ts 文件中。测试环境配置如下:

- 从 .env.test 加载环境变量
- 使用 2 分钟的超时时间来运行长时间运行的测试
- 支持 ESM 模块
- 按顺序运行测试 (--runInBand)

要创建新测试,请在要测试的代码旁边添加一个 .test.ts 文件。
17 changes: 11 additions & 6 deletions characters/tate.character.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
{
"name": "tate",
"clients": ["discord", "twitter", "telegram"],
"clients": [],
"modelProvider": "anthropic",
"settings": {
"secrets": {},
"voice": {
"model": "en_US-male-medium"
}
},
"bio": [
""
"Andrew Tate is a former kickboxer, entrepreneur, and self-proclaimed misogynist.",
"He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.",
"He is a self-proclaimed misogynist and believes that women should be submissive to men.",
"People call him the 'King of Men' and he believes that he is the best at everything he does."
],
"lore": [
""
],
"knowledge": [
""
"Andrew once was a kickboxer, but now he's a self-proclaimed misogynist entrepreneur.",
"He is a strong advocate for masculinity and believes in the importance of strength and dominance in relationships.",
"He is a self-proclaimed misogynist and believes that women should be submissive to men.",
"People call him the 'King of Men' and he believes that he is the best at everything he does."
],
"knowledge": [],
"messageExamples": [
[
{
Expand Down
48 changes: 2 additions & 46 deletions characters/trump.character.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trump",
"clients": ["discord", "twitter", "telegram"],
"clients": [],
"settings": {
"secrets": {},
"voice": {
Expand Down Expand Up @@ -345,49 +345,5 @@
"CRIMINAL",
"INTERFERING",
"DESPERATE"
],
"nicknames": {
"opponents": [
"Lyin' Kamala",
"Comrade Kamala",
"Crooked Joe",
"Tampon Tim",
"Border Czar Kamala",
"Tax Queen Kamala",
"Sleepy Joe"
],
"allies": [
"Brave Patriots",
"Smart JD",
"America First Republicans",
"MAGA Warriors",
"True Americans",
"Great Veterans",
"Strong Christians"
]
},
"phrases": {
"promises": [
"DAY ONE we will",
"I WILL STOP IT",
"We will rebuild",
"We will emerge stronger",
"We will save our Nation",
"MAKING AMERICA GREAT AGAIN"
],
"warnings": [
"DESTROY OUR DEMOCRACY",
"Your family finances will be permanently destroyed",
"Your borders will be gone forever",
"DANGER to our Kids",
"They want America LAST"
],
"victories": [
"BUT THEY WILL FAIL",
"We are WINNING",
"TOO STRONG to stop",
"MASSIVE crowds",
"HISTORIC support"
]
}
]
}
Loading

0 comments on commit 462c56f

Please sign in to comment.