Skip to content

Commit 8a1b698

Browse files
authored
Merge branch 'develop' into fix/jsdoc-automation
2 parents 64ec385 + 555479a commit 8a1b698

File tree

9 files changed

+239
-174
lines changed

9 files changed

+239
-174
lines changed

.github/workflows/stale.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,23 @@ jobs:
1212
issues: write
1313
pull-requests: write
1414

15+
env:
16+
DAYS_BEFORE_STALE: 30 # Define the days-before-stale value
17+
DAYS_BEFORE_CLOSE: 7 # Define the days-before-close value
18+
1519
steps:
1620
- uses: actions/stale@v5
1721
with:
1822
repo-token: ${{ secrets.GITHUB_TOKEN }}
19-
stale-issue-message: 'This issue has been automatically marked as stale due to inactivity.'
20-
stale-pr-message: 'This pull request has been automatically marked as stale due to inactivity.'
23+
stale-issue-message: |
24+
This issue has been automatically marked as stale due to ${{
25+
env.DAYS_BEFORE_STALE }} days of inactivity.
26+
If no further activity occurs within ${{ env.DAYS_BEFORE_CLOSE }} days, it will be closed automatically. Please take action if this issue is still relevant.
27+
stale-pr-message: |
28+
This pull request has been automatically marked as stale due to ${{
29+
env.DAYS_BEFORE_STALE }} days of inactivity.
30+
If no further activity occurs within ${{ env.DAYS_BEFORE_CLOSE }} days, it will be closed automatically. Please take action if this pull request is still relevant.
2131
stale-issue-label: 'no-issue-activity'
2232
stale-pr-label: 'no-pr-activity'
23-
days-before-stale: 30 # Marks issues and PRs as stale after X days of inactivity
24-
days-before-close: 7 # Closes issues and PRs X days after being marked as stale
33+
days-before-stale: ${{ env.DAYS_BEFORE_STALE }}
34+
days-before-close: ${{ env.DAYS_BEFORE_CLOSE }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ packages/plugin-coinbase/src/plugins/transactions.csv
4949
tsup.config.bundled_*.mjs
5050

5151
.turbo
52+
.cursorrules
5253

5354
coverage
5455
.eslintcache

CHANGELOG.md

+4-143
Large diffs are not rendered by default.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## 🌍 README Translations
1414

15-
[中文说明](./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) | [Italiano](./README_IT.md) | [ไทย](./README_TH.md) | [Deutsch](./README_DE.md) | [Tiếng Việt](./README_VI.md) | [עִברִית](https://github.com/elizaos/Elisa/blob/main/README_HE.md) | [Tagalog](./README_TG.md)
15+
[中文说明](./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) | [Italiano](./README_IT.md) | [ไทย](./README_TH.md) | [Deutsch](./README_DE.md) | [Tiếng Việt](./README_VI.md) | [עִברִית](https://github.com/elizaos/Elisa/blob/main/README_HE.md) | [Tagalog](./README_TG.md) | [Polski](./README_PL.md)
1616

1717
## ✨ Features
1818

@@ -56,7 +56,7 @@ cp .env.example .env
5656
pnpm i && pnpm build && pnpm start
5757
```
5858
Once the agent is running, You should see the message to run "pnpm start:client" at the end.
59-
Open another terminal and move to same directory and then run below command and follow the URL to chat to your agent.
59+
Open another terminal and move to same directory and then run below command and follow the URL to chat to your agent.
6060
```bash
6161
pnpm start:client
6262
```
@@ -86,11 +86,11 @@ Copy .env.example to .env and fill in the appropriate values.
8686
cp .env.example .env
8787
```
8888

89-
Note: .env is optional. If your planning to run multiple distinct agents, you can pass secrets through the character JSON
89+
Note: .env is optional. If you're planning to run multiple distinct agents, you can pass secrets through the character JSON
9090

9191
### Automatically Start Eliza
9292

93-
This will run everything to setup the project and start the bot with the default character.
93+
This will run everything to set up the project and start the bot with the default character.
9494

9595
```bash
9696
sh scripts/start.sh

README_CN.md

+45-3
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,55 @@ pnpm start
104104

105105
## 配置不同的大模型
106106

107-
### 配置Llama
107+
您可以使用不同的大模型来驱动您的AI Agent,切换不同大模型需要两步:
108108

109-
您可以通过设置 `XAI_MODEL` 环境变量为 `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo``meta-llama/Meta-Llama-3.1-405B-Instruct` 来运行 Llama 70B 或 405B 模型
109+
1. 确认您在`.env`文件内配置了对应的大模型API Key或对应的访问配置,例如如果您想使用OpenAI,则需要找到`OPENAI_API_KEY`参数,并填入您的OpenAI API Key,并以此类推。
110+
2. 在您的*Character*文件里找到`modelProvider`,并更改这里的内容,例如如果想要切换到Claude,则需要填入`anthropic`,以此来表明您将使用anthropic大模型作为您的对应Agent的Provider.
111+
112+
`.env`文件内您可以找到不同大模型的详细配置,包括设定具体想要使用对应提供商的哪个模型,下方我们给出了两个实例:
110113

111114
### 配置OpenAI
112115

113-
您可以通过设置 `XAI_MODEL` 环境变量为 `gpt-4o-mini``gpt-4o` 来运行 OpenAI 模型
116+
首先您需要在Character文件内指定model provider
117+
118+
```json
119+
"name": "C-3PO",
120+
"clients": [],
121+
"modelProvider": "openai"
122+
...
123+
```
124+
125+
其次请在`env`文件内配置相关参数
126+
127+
```
128+
# AI Model API Keys
129+
OPENAI_API_KEY= # OpenAI API key, starting with sk-
130+
SMALL_OPENAI_MODEL= # Default: gpt-4o-mini
131+
MEDIUM_OPENAI_MODEL= # Default: gpt-4o
132+
LARGE_OPENAI_MODEL= # Default: gpt-4o
133+
EMBEDDING_OPENAI_MODEL= # Default: text-embedding-3-small
134+
IMAGE_OPENAI_MODEL= # Default: dall-e-3
135+
136+
```
137+
138+
### 配置Anthorpic
139+
140+
```json
141+
"name": "C-3PO",
142+
"clients": [],
143+
"modelProvider": "anthropic"
144+
...
145+
```
146+
147+
其次请在`env`文件内配置相关参数
148+
149+
```
150+
# Anthropic Configuration
151+
ANTHROPIC_API_KEY= # For Claude
152+
SMALL_ANTHROPIC_MODEL= # Default: claude-3-haiku-20240307
153+
MEDIUM_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022
154+
LARGE_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022
155+
```
114156

115157
## 其他要求
116158

README_PL.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Eliza 🤖
2+
3+
<div align="center">
4+
<img src="./docs/static/img/eliza_banner.jpg" alt="Eliza Banner" width="100%" />
5+
</div>
6+
7+
<div align="center">
8+
9+
📖 [Dokumentacja](https://elizaos.github.io/eliza/) | 🎯 [Przykłady](https://github.com/thejoven/awesome-eliza)
10+
11+
</div>
12+
13+
## ✨ Cechy modelu:
14+
15+
- 🛠️ Pełne wsparcie dla Discorda, Telegrama i Twittera
16+
- 🔗 Wsparcie dla wszystkich modeli AI (Llama, Grok, OpenAI, Anthropic, itd.)
17+
- 👥 Wiele osobowości jednocześnie oraz wsparcie dla pokoi
18+
- 📚 Prosta konstrukcja i łatwość modyfikacji ustawień
19+
- 💾 Przywracalna pamięć i opcja przechowywania dokumentów
20+
- 🚀 Wiele możliwości rozszerzeń - twórz własne klienty, aplikacje itd
21+
- ☁️ Wsparcie dla szerokiej gamy modeli (local Llama, OpenAI, Anthropic, Groq, etc.)
22+
- 📦 To po prostu działa!
23+
24+
## Poradniki wideo
25+
26+
[AI Agent Dev School](https://www.youtube.com/watch?v=ArptLpQiKfI&list=PLx5pnFXdPTRzWla0RaOxALTSTnVq53fKL)
27+
28+
## 🎯 Przykłady zastosowania
29+
30+
- 🤖 Chatboty
31+
- 🕵️ Autonomiczni Agenci
32+
- 📈 Utrzymanie procesów biznesowych
33+
- 🎮 Zaplecze dla postaci NPC w grach
34+
- 🧠 Handel
35+
36+
## 🚀 Jak zacząć?
37+
38+
### Wstępne wymagania:
39+
40+
- [Python 2.7+](https://www.python.org/downloads/)
41+
- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
42+
- [pnpm](https://pnpm.io/installation)
43+
44+
> **Notka dla użytkowników Windowsa:** [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual) jest wymagane!.
45+
46+
### Użycie startera (Rekomendowane)
47+
48+
```bash
49+
git clone https://github.com/elizaos/eliza-starter.git
50+
cd eliza-starter
51+
cp .env.example .env
52+
pnpm i && pnpm build && pnpm start
53+
```
54+
Gdy agent się uruchomi, powinien pojawić się komunikat aby uruchomić komendę "pnpm start:client".
55+
Wtedy trzeba odpalić drugi terminal, przejść do tego samego folderu, w którym mamy sklonowany kod z Githuba i odpalić tą komendę, aby być w stanie rozpocząć konwersację z naszym botem.
56+
```bash
57+
pnpm start:client
58+
```
59+
60+
Następnie zapoznaj się z [Dokumentacją](https://elizaos.github.io/eliza/). Tam jest szcegółowo opisane, jak modyfikować i dopasować Elizę do własnych potrzeb.
61+
62+
### Manualny start (Przeznaczone dla osób, które wiedzą, co robią)
63+
64+
```bash
65+
# Sklonuj repozytorium
66+
git clone https://github.com/elizaos/eliza.git
67+
68+
# Sprawdź, czy na pewno masz najnowszą wersję
69+
# Projekt rozrasta się bardzo szybko, dlatego zalecane jest aby często sprawdzać wersję
70+
git checkout $(git describe --tags --abbrev=0)
71+
```
72+
73+
### Start przy użyciu Gitpod'a
74+
75+
[![Otwórz w Gitpodzie](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/elizaos/eliza/tree/main)
76+
77+
### Edytuj plik .env
78+
79+
Zmień nazwę pliku .env.example na .env i wypełnij wartości zmiennych, które będą potrzebne do uruchomienia aplikacji.
80+
81+
```
82+
cp .env.example .env
83+
```
84+
85+
Uwaga: .env jest opcjonalne. Jeżeli planujesz stawiać więcej niż jedną postać, zalecane jest korzystanie z plików JSON dedykowanych dla charakterów. Będzie to bardziej przejrzyste i łatwiejsze do znalezienia gdy trzeba będzie wprowadzić jakieś zmiany.
86+
87+
### Automatyczny start Elizy
88+
89+
Ta komenda postawi projekt i uruchomi bota z domyślnym charakterem.
90+
91+
```bash
92+
sh scripts/start.sh
93+
```
94+
95+
### Edycja pliku postaci
96+
97+
1. Otwórz `packages/core/src/defaultCharacter.ts` aby zmodyfikować postać. Odkomentuj i edytuj.
98+
99+
2. Aby załadować niestandardowe osobowości:
100+
- Uzyj komendy `pnpm start --characters="path/to/your/character.json"`
101+
- Wiele plików z osobowościami może być załadowana jednocześnie
102+
3. Połącz z platformą X (niegdyś Twitter)
103+
- zamień `"clients": []` na `"clients": ["twitter"]` w pliku osobowości aby połączyć z X
104+
105+
### Manualny Start Elizy
106+
107+
```bash
108+
pnpm i
109+
pnpm build
110+
pnpm start
111+
112+
# Projekt rozwija się bardzo szybko, dlatego jeżeli robisz sobie przerwę na jakiś czas i wejdzie w międzyczasie dużo zmian, dobrze jest użyć tej komendy:
113+
pnpm clean
114+
```
115+
116+
#### Dodatkowe wymagania
117+
118+
Możesz musieć zainstalować pakiet Sharp. Jeżeli przy odpalaniu projektu wyskakuje błąd, spróbuj go zainstalować tą komendą:
119+
120+
```
121+
pnpm install --include=optional sharp
122+
```
123+
124+
### Społeczność i kontakt
125+
126+
- [GitHub Issues](https://github.com/elizaos/eliza/issues). Korzystaj w przypadku gdy napotkasz na jakieś bugi podczas uzywania Elizy, lub masz jakieś propozycje rozwoju.
127+
- [Discord](https://discord.gg/ai16z). Używaj, gdy chcesz się pochwalić swoją aplikacją lub po prostu pogadać z kimś.
128+
129+
## Osoby zaangażowane w rozwój:
130+
131+
<a href="https://github.com/elizaos/eliza/graphs/contributors">
132+
<img src="https://contrib.rocks/image?repo=elizaos/eliza" />
133+
</a>
134+
135+
## Historia gwiazdek
136+
137+
[![Wykres historii gwiazdek](https://api.star-history.com/svg?repos=elizaos/eliza&type=Date)](https://star-history.com/#elizaos/eliza&Date)

client/src/Chat.tsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { useRef, useState } from "react";
2-
import { useParams } from "react-router-dom";
3-
import { useMutation } from "@tanstack/react-query";
41
import { Button } from "@/components/ui/button";
5-
import { ImageIcon } from "lucide-react";
62
import { Input } from "@/components/ui/input";
3+
import { useMutation } from "@tanstack/react-query";
4+
import { ImageIcon } from "lucide-react";
5+
import { useEffect, useRef, useState } from "react";
6+
import { useParams } from "react-router-dom";
77
import "./App.css";
8-
import path from "path";
98

109
type TextResponse = {
1110
text: string;
@@ -19,6 +18,15 @@ export default function Chat() {
1918
const [messages, setMessages] = useState<TextResponse[]>([]);
2019
const [selectedFile, setSelectedFile] = useState<File | null>(null);
2120
const fileInputRef = useRef<HTMLInputElement>(null);
21+
const messagesEndRef = useRef<HTMLDivElement>(null);
22+
23+
const scrollToBottom = () => {
24+
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
25+
};
26+
27+
useEffect(() => {
28+
scrollToBottom();
29+
}, [messages]);
2230

2331
const mutation = useMutation({
2432
mutationFn: async (text: string) => {
@@ -115,6 +123,7 @@ export default function Chat() {
115123
No messages yet. Start a conversation!
116124
</div>
117125
)}
126+
<div ref={messagesEndRef} />
118127
</div>
119128
</div>
120129

packages/client-twitter/src/environment.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { z } from "zod";
33
export const DEFAULT_MAX_TWEET_LENGTH = 280;
44

55
const twitterUsernameSchema = z.string()
6-
.min(1)
7-
.max(15)
8-
.regex(/^[A-Za-z][A-Za-z0-9_]*[A-Za-z0-9]$|^[A-Za-z]$/, 'Invalid Twitter username format');
6+
.min(4, 'An X/Twitter Username must be at least 4 characters long')
7+
.max(15, 'n X/Twitter Username cannot exceed 15 characters')
8+
.regex(/^[A-Za-z0-9_]*$/, 'n X Username can only contain letters, numbers, and underscores');
99

1010
export const twitterEnvSchema = z.object({
1111
TWITTER_DRY_RUN: z.boolean(),
12-
TWITTER_USERNAME: z.string().min(1, "Twitter username is required"),
13-
TWITTER_PASSWORD: z.string().min(1, "Twitter password is required"),
14-
TWITTER_EMAIL: z.string().email("Valid Twitter email is required"),
12+
TWITTER_USERNAME: z.string().min(1, "X/Twitter username is required"),
13+
TWITTER_PASSWORD: z.string().min(1, "X/Twitter password is required"),
14+
TWITTER_EMAIL: z.string().email("Valid X/Twitter email is required"),
1515
MAX_TWEET_LENGTH: z.number().int().default(DEFAULT_MAX_TWEET_LENGTH),
1616
TWITTER_SEARCH_ENABLE: z.boolean().default(false),
1717
TWITTER_2FA_SECRET: z.string(),
@@ -164,7 +164,7 @@ export async function validateTwitterConfig(
164164
.map((err) => `${err.path.join(".")}: ${err.message}`)
165165
.join("\n");
166166
throw new Error(
167-
`Twitter configuration validation failed:\n${errorMessages}`
167+
`X/Twitter configuration validation failed:\n${errorMessages}`
168168
);
169169
}
170170
throw error;

packages/client-twitter/src/post.ts

+13-8
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,25 @@ export const twitterActionTemplate =
4444
{{postDirections}}
4545
4646
Guidelines:
47-
- Highly selective engagement
48-
- Direct mentions are priority
49-
- Skip: low-effort content, off-topic, repetitive
47+
- ONLY engage with content that DIRECTLY relates to character's core interests
48+
- Direct mentions are priority IF they are on-topic
49+
- Skip ALL content that is:
50+
- Off-topic or tangentially related
51+
- From high-profile accounts unless explicitly relevant
52+
- Generic/viral content without specific relevance
53+
- Political/controversial unless central to character
54+
- Promotional/marketing unless directly relevant
5055
5156
Actions (respond only with tags):
52-
[LIKE] - Resonates with interests (9.5/10)
53-
[RETWEET] - Perfect character alignment (9/10)
54-
[QUOTE] - Can add unique value (8/10)
55-
[REPLY] - Memetic opportunity (9/10)
57+
[LIKE] - Perfect topic match AND aligns with character (9.8/10)
58+
[RETWEET] - Exceptional content that embodies character's expertise (9.5/10)
59+
[QUOTE] - Can add substantial domain expertise (9.5/10)
60+
[REPLY] - Can contribute meaningful, expert-level insight (9.5/10)
5661
5762
Tweet:
5863
{{currentTweet}}
5964
60-
# Respond with qualifying action tags only.` + postActionResponseFooter;
65+
# Respond with qualifying action tags only. Default to NO action unless extremely confident of relevance.` + postActionResponseFooter;
6166

6267
/**
6368
* Truncate text to fit within the Twitter character limit, ensuring it ends at a complete sentence.

0 commit comments

Comments
 (0)