Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from main #31

Merged
merged 39 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
64f3231
Merge branch 'main' of https://github.com/ai16z/eliza
normand1 Nov 15, 2024
9042e7b
Merge branch 'main' of https://github.com/ai16z/eliza
normand1 Nov 16, 2024
d778e60
use vite
normand1 Nov 16, 2024
c93510c
test running
normand1 Nov 16, 2024
4d7e0aa
cleanup
normand1 Nov 16, 2024
a3eb3ed
cleanup
normand1 Nov 16, 2024
14f1cff
cleanup
normand1 Nov 16, 2024
7940692
cleanup
normand1 Nov 16, 2024
780cfb2
remove log statement
normand1 Nov 16, 2024
5a338d0
merge from main
normand1 Nov 16, 2024
055c609
review feedback updates
normand1 Nov 17, 2024
352392a
video generation plugin
dorianjanezic Nov 18, 2024
5e24871
merge from main
normand1 Nov 18, 2024
caa13f7
update to address review feedback
normand1 Nov 19, 2024
6fbde25
inline user model
normand1 Nov 19, 2024
ff28e99
remove hardcoded endpoint
normand1 Nov 19, 2024
610a100
docs: add italian README translation
fabrizioff Nov 19, 2024
1516f71
services
ponderingdemocritus Nov 19, 2024
eb72f01
remove character
ponderingdemocritus Nov 19, 2024
780f483
fix logging
ponderingdemocritus Nov 19, 2024
97cd09b
linting
ponderingdemocritus Nov 19, 2024
df57d56
removed ollama embeddings. fastembeddings or openai only
o-on-x Nov 19, 2024
87a367e
Merge pull request #411 from fabrizioff/docs/translate-readme-it
jkbrooks Nov 19, 2024
591b971
Add video generation plugin tests and constants
dorianjanezic Nov 19, 2024
6b0baad
systems work
ponderingdemocritus Nov 19, 2024
5ec69db
character
ponderingdemocritus Nov 19, 2024
ac87e38
services
ponderingdemocritus Nov 19, 2024
8ff1269
init deploy unruggable memecoin
RedBeardEth Nov 19, 2024
af4e1fd
Merge pull request #394 from dorianjanezic/main
sirkitree Nov 19, 2024
743aa78
Readme update WSL 2 link added. (#419)
denizekiz Nov 19, 2024
af591e0
merge
ponderingdemocritus Nov 19, 2024
48d6fdb
issues
ponderingdemocritus Nov 19, 2024
3a033b4
Merge pull request #412 from ai16z/fix-services
sirkitree Nov 19, 2024
4fafa3b
Update adapters.md psql schema
tarrencev Nov 19, 2024
5fa2184
Merge pull request #413 from o-on-x/main
sirkitree Nov 19, 2024
329db11
handle merge conflicts
normand1 Nov 19, 2024
95c3055
Merge pull request #424 from tarrencev/patch-1
ponderingdemocritus Nov 20, 2024
bea5567
Merge pull request #365 from normand1/dn/token-provider-tests
jkbrooks Nov 20, 2024
17215f0
Merge pull request #418 from RedBeardEth/unruggable-deploy-token
ponderingdemocritus Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v23.1.0
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
</div>

## 🌍 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)

[中文说明](./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)

## ✨ Features

Expand Down Expand Up @@ -40,7 +41,7 @@
- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- [pnpm](https://pnpm.io/installation)

> **Note for Windows Users:** WSL is required
> **Note for Windows Users:** [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual) is required.

### Edit the .env file

Expand Down
92 changes: 92 additions & 0 deletions README_IT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Eliza 🤖

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

## ✨ Caratteristiche

- 🛠️ Connettori completi per Discord, Twitter e Telegram
- 🔗 Supporto per tutti i modelli (Llama, Grok, OpenAI, Anthropic, ecc.)
- 👥 Supporto multi-agente e per stanze
- 📚 Acquisisci ed interagisci facilmente con i tuoi documenti
- 💾 Memoria recuperabile e archivio documenti
- 🚀 Altamente estensibile - crea le tue azioni e clients personalizzati
- ☁️ Supporto di numerosi modelli (Llama locale, OpenAI, Anthropic, Groq, ecc.)
- 📦 Funziona e basta!

## 🎯 Casi d'Uso

- 🤖 Chatbot
- 🕵️ Agenti Autonomi
- 📈 Gestione Processi Aziendali
- 🎮 NPC per Videogiochi
- 🧠 Trading

## 🚀 Avvio Rapido

### Prerequisiti

- [Python 2.7+](https://www.python.org/downloads/)
- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- [pnpm](https://pnpm.io/installation)

> **Nota per gli utenti Windows:** È richiesto WSL

### Modifica il file .env

Copia .env.example in .env e inserisci i valori appropriati

```
cp .env.example .env
```

### Avvia Eliza Automaticamente

Questo script eseguirà tutti i comandi necessari per configurare il progetto e avviare il bot con il personaggio predefinito.

```bash
sh scripts/start.sh
```

### Modifica il file del personaggio

1. Apri `packages/agent/src/character.ts` per modificare il personaggio predefinito. Decommentare e modificare.

2. Per caricare personaggi personalizzati:
- Usa `pnpm start --characters="percorso/del/tuo/personaggio.json"`
- È possibile caricare più file di personaggi contemporaneamente

### Avvia Eliza Manualmente

```bash
pnpm i
pnpm build
pnpm start

# Il progetto evolve rapidamente; a volte è necessario pulire il progetto se si ritorna sul progetto dopo un po' di tempo
pnpm clean
```

#### Requisiti Aggiuntivi

Potrebbe essere necessario installare Sharp. Se vedi un errore all'avvio, prova a installarlo con il seguente comando:

```
pnpm install --include=optional sharp
```

### Community e contatti

- [GitHub Issues](https://github.com/ai16z/eliza/issues). Ideale per: bug riscontrati utilizzando Eliza e proposte di funzionalità.
- [Discord](https://discord.gg/ai16z). Ideale per: condividere le tue applicazioni e interagire con la community.

## Contributori

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

## Cronologia Stelle

[![Grafico Cronologia Stelle](https://api.star-history.com/svg?repos=ai16z/eliza&type=Date)](https://star-history.com/#ai16z/eliza&Date)
43 changes: 42 additions & 1 deletion docs/docs/packages/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,42 @@ async searchMemories(params: {
### PostgreSQL Schema

```sql
-- migrations/20240318103238_remote_schema.sql
CREATE EXTENSION IF NOT EXISTS vector;

CREATE TABLE IF NOT EXISTS accounts (
id UUID PRIMARY KEY,
"createdAt" DEFAULT CURRENT_TIMESTAMP,
"name" TEXT,
"username" TEXT,
"email" TEXT NOT NULL,
"avatarUrl" TEXT,
"details" JSONB DEFAULT '{}'::"jsonb",
"is_agent" BOOLEAN DEFAULT false NOT NULL,
"location" TEXT,
"profile_line" TEXT,
"signed_tos" BOOLEAN DEFAULT false NOT NULL
);

ALTER TABLE ONLY accounts ADD CONSTRAINT users_email_key UNIQUE (email);

CREATE TABLE IF NOT EXISTS participants (
"id" UUID PRIMARY KEY,
"createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL,
"userId" UUID REFERENCES accounts(id),
"roomId" UUID REFERENCES rooms(id),
"userState" TEXT, -- For MUTED, NULL, or FOLLOWED states
"last_message_read" UUID
);

ALTER TABLE ONLY participants ADD CONSTRAINT participants_id_key UNIQUE (id);
ALTER TABLE ONLY participants ADD CONSTRAINT participants_roomId_fkey FOREIGN KEY ("roomId") REFERENCES rooms(id);
ALTER TABLE ONLY participants ADD CONSTRAINT participants_userId_fkey FOREIGN KEY ("userId") REFERENCES accounts(id);

CREATE TABLE rooms (
id UUID PRIMARY KEY,
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE memories (
id UUID PRIMARY KEY,
type TEXT NOT NULL,
Expand All @@ -440,6 +473,9 @@ CREATE TABLE memories (
"createdAt" TIMESTAMP NOT NULL
);

ALTER TABLE ONLY memories ADD CONSTRAINT memories_roomId_fkey FOREIGN KEY ("roomId") REFERENCES rooms(id);
ALTER TABLE ONLY memories ADD CONSTRAINT memories_userId_fkey FOREIGN KEY ("userId") REFERENCES accounts(id);

CREATE INDEX memory_embedding_idx ON
memories USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);
Expand All @@ -452,6 +488,11 @@ CREATE TABLE relationships (
"createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

ALTER TABLE ONLY relationships ADD CONSTRAINT friendships_id_key UNIQUE (id);
ALTER TABLE ONLY relationships ADD CONSTRAINT relationships_userA_fkey FOREIGN KEY ("userA") REFERENCES accounts(id);
ALTER TABLE ONLY relationships ADD CONSTRAINT relationships_userB_fkey FOREIGN KEY ("userB") REFERENCES accounts(id);
ALTER TABLE ONLY relationships ADD CONSTRAINT relationships_userId_fkey FOREIGN KEY ("userId") REFERENCES accounts(id);

CREATE TABLE goals (
id UUID PRIMARY KEY,
"roomId" UUID NOT NULL,
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"docker:run": "bash ./scripts/docker.sh run",
"docker:bash": "bash ./scripts/docker.sh bash",
"docker:start": "bash ./scripts/docker.sh start",
"docker": "pnpm docker:build && pnpm docker:run && pnpm docker:bash"
"docker": "pnpm docker:build && pnpm docker:run && pnpm docker:bash",
"test": "pnpm --dir packages/core test"
},
"devDependencies": {
"concurrently": "^9.1.0",
Expand All @@ -27,7 +28,9 @@
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"typedoc": "^0.26.11",
"typescript": "5.6.3"
"typescript": "5.6.3",
"vite": "^5.4.11",
"vitest": "^2.1.5"
},
"pnpm": {
"overrides": {
Expand Down
20 changes: 12 additions & 8 deletions packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { DiscordClientInterface } from "@ai16z/client-discord";
import { AutoClientInterface } from "@ai16z/client-auto";
import { TelegramClientInterface } from "@ai16z/client-telegram";
import { TwitterClientInterface } from "@ai16z/client-twitter";
import { defaultCharacter } from "@ai16z/eliza";
import { AgentRuntime } from "@ai16z/eliza";
import { settings } from "@ai16z/eliza";
import {
defaultCharacter,
AgentRuntime,
settings,
Character,
IAgentRuntime,
IDatabaseAdapter,
ModelProviderName,
elizaLogger,
} from "@ai16z/eliza";
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
import { solanaPlugin } from "@ai16z/plugin-solana";
Expand Down Expand Up @@ -219,7 +219,11 @@ export async function createAgent(
db: any,
token: string
) {
console.log("Creating runtime for character", character.name);
elizaLogger.success(
elizaLogger.successesTitle,
"Creating runtime for character",
character.name
);
return new AgentRuntime({
databaseAdapter: db,
token,
Expand Down Expand Up @@ -279,7 +283,7 @@ const startAgents = async () => {
await startAgent(character, directClient);
}
} catch (error) {
console.error("Error starting agents:", error);
elizaLogger.error("Error starting agents:", error);
}

function chat() {
Expand All @@ -292,12 +296,12 @@ const startAgents = async () => {
});
}

console.log("Chat started. Type 'exit' to quit.");
elizaLogger.log("Chat started. Type 'exit' to quit.");
chat();
};

startAgents().catch((error) => {
console.error("Unhandled error in startAgents:", error);
elizaLogger.error("Unhandled error in startAgents:", error);
process.exit(1); // Exit the process after logging
});

Expand Down
2 changes: 1 addition & 1 deletion packages/client-direct/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class DirectClient {
private agents: Map<string, AgentRuntime>;

constructor() {
console.log("DirectClient constructor");
elizaLogger.log("DirectClient constructor");
this.app = express();
this.app.use(cors());
this.agents = new Map();
Expand Down
4 changes: 2 additions & 2 deletions packages/client-discord/src/actions/download_media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default {
callback: HandlerCallback
) => {
const videoService = runtime
.getService(ServiceType.VIDEO)
.getInstance<IVideoService>();
.getService<IVideoService>(ServiceType.VIDEO)
.getInstance();
if (!state) {
state = (await runtime.composeState(message)) as State;
}
Expand Down
45 changes: 25 additions & 20 deletions packages/client-discord/src/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ export class AttachmentManager {
} else if (
attachment.contentType?.startsWith("video/") ||
this.runtime
.getService(ServiceType.VIDEO)
.getInstance<IVideoService>()
.getService<IVideoService>(ServiceType.VIDEO)
.isVideoUrl(attachment.url)
) {
media = await this.processVideoAttachment(attachment);
Expand Down Expand Up @@ -137,10 +136,16 @@ export class AttachmentManager {
throw new Error("Unsupported audio/video format");
}

const transcription = await this.runtime
.getService(ServiceType.TRANSCRIPTION)
.getInstance<ITranscriptionService>()
.transcribeAttachment(audioBuffer);
const transcriptionService =
this.runtime.getService<ITranscriptionService>(
ServiceType.TRANSCRIPTION
);
if (!transcriptionService) {
throw new Error("Transcription service not found");
}

const transcription =
await transcriptionService.transcribeAttachment(audioBuffer);
const { title, description } = await generateSummary(
this.runtime,
transcription
Expand Down Expand Up @@ -220,8 +225,7 @@ export class AttachmentManager {
const response = await fetch(attachment.url);
const pdfBuffer = await response.arrayBuffer();
const text = await this.runtime
.getService(ServiceType.PDF)
.getInstance<IPdfService>()
.getService<IPdfService>(ServiceType.PDF)
.convertPdfToText(Buffer.from(pdfBuffer));
const { title, description } = await generateSummary(
this.runtime,
Expand Down Expand Up @@ -289,8 +293,9 @@ export class AttachmentManager {
): Promise<Media> {
try {
const { description, title } = await this.runtime
.getService(ServiceType.IMAGE_DESCRIPTION)
.getInstance<IImageDescriptionService>()
.getService<IImageDescriptionService>(
ServiceType.IMAGE_DESCRIPTION
)
.describeImage(attachment.url);
return {
id: attachment.id,
Expand Down Expand Up @@ -322,16 +327,16 @@ export class AttachmentManager {
private async processVideoAttachment(
attachment: Attachment
): Promise<Media> {
if (
this.runtime
.getService(ServiceType.VIDEO)
.getInstance<IVideoService>()
.isVideoUrl(attachment.url)
) {
const videoInfo = await this.runtime
.getService(ServiceType.VIDEO)
.getInstance<IVideoService>()
.processVideo(attachment.url);
const videoService = this.runtime.getService<IVideoService>(
ServiceType.VIDEO
);

if (!videoService) {
throw new Error("Video service not found");
}

if (videoService.isVideoUrl(attachment.url)) {
const videoInfo = await videoService.processVideo(attachment.url);
return {
id: attachment.id,
url: attachment.url,
Expand Down
6 changes: 3 additions & 3 deletions packages/client-discord/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { VoiceManager } from "./voice.ts";

export class DiscordClient extends EventEmitter {
apiToken: string;
private client: Client;
private runtime: IAgentRuntime;
client: Client;
runtime: IAgentRuntime;
character: Character;
private messageManager: MessageManager;
private voiceManager: VoiceManager;
Expand Down Expand Up @@ -193,7 +193,7 @@ export class DiscordClient extends EventEmitter {
}

async handleReactionRemove(reaction: MessageReaction, user: User) {
console.log("Reaction removed");
elizaLogger.log("Reaction removed");
// if (user.bot) return;

let emoji = reaction.emoji.name;
Expand Down
Loading
Loading