Skip to content

Commit

Permalink
Merge branch 'develop' into realitySpiral/codescanning
Browse files Browse the repository at this point in the history
  • Loading branch information
shakkernerd authored Dec 24, 2024
2 parents 4a75972 + d187801 commit 24dbabe
Show file tree
Hide file tree
Showing 61 changed files with 1,567 additions and 1,335 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ jobs:

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

- 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
if [[ ! "$PR_TITLE" =~ ^(feat|fix|docs|style|refactor|test|chore)(\([a-zA-Z0-9-]+\))?:\ .+ ]]; 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|fix|docs|style|refactor|test|chore: title')."
gh pr comment ${{ github.event.pull_request.number }} --body "❌ PR title does not match the required pattern. Please use one of these formats:
- 'type: description' (e.g., 'feat: add new feature')
- 'type(scope): description' (e.g., 'chore(core): update dependencies')"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

## ✨ Features

Expand Down
129 changes: 129 additions & 0 deletions README_TG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@

# Eliza 🤖

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

<div align="center">

📖 [Dokumentasyon](https://elizaos.github.io/eliza/) | 🎯 [Mga Halimbawa](https://github.com/thejoven/awesome-eliza)

</div>

## ✨ Mga Tampok

- 🛠️ Kumpletong suporta sa [Discord](https://discord.com/), [Twitter](https://twitter.com/), at [Telegram](https://telegram.org/)
- 🔗 Suporta para sa bawat modelo (Llama, Grok, OpenAI, Anthropic, atbp.)
- 👥 Suporta para sa multi-agent at kuwarto
- 📚 Madaling mag-load at makipag-ugnayan sa iyong mga dokumento
- 💾 Naaakses na memorya at imbakan ng dokumento
- 🚀 Napakabisa - maaaring gumawa ng sarili mong mga aksyon at kliyente
- ☁️ Sinusuportahan ang maraming modelo (lokal na Llama, OpenAI, Anthropic, Groq, atbp.)
- 📦 Madaling gamitin!

## Mga Tutorial sa Bidyo

[AI Agent Dev School](https://www.youtube.com/watch?v=ArptLpQiKfI&list=PLx5pnFXdPTRzWla0RaOxALTSTnVq53fKL)

## 🎯 Gamit ito para sa

- 🤖 [Mga Chatbot](https://en.wikipedia.org/wiki/Chatbot)
- 🕵️ Mga Awtonomikong Ahente
- 📈 Pagproseso ng Negosyo
- 🎮 [Mga NPC sa mga Larong Kompyuter](https://en.wikipedia.org/wiki/Non-player_character)
- 🧠 Pangangalakal

## 🚀 Pangkalahatang-ideya

### Mga Kinakailangan

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

> **Paalala para sa mga Gumagamit ng Windows:** Kailangan ang [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual).
### Gamitin ang Starter (Inirerekomenda)

```bash
git clone https://github.com/elizaos/eliza-starter.git
cd eliza-starter
cp .env.example .env
pnpm i && pnpm build && pnpm start
```

Basahin ang [Dokumentasyon](https://elizaos.github.io/eliza/) upang matutunan kung paano ipasadya ang Eliza.

### Manwal na Pag-simula ng Eliza (Inirerekomenda lamang kung alam mo ang ginagawa mo)

```bash
# Clone the repository
git clone https://github.com/elizaos/eliza.git

# Checkout the latest release
git checkout $(git describe --tags --abbrev=0)
```

### Simulan ang Eliza gamit ang Gitpod

[![Buksan sa Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/elizaos/eliza/tree/main)

### Ipasadya ang .env File

Kopyahin ang `.env.example` sa `.env` at punan ang tamang mga halaga.

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

### Awtomatikong Simulan ang Eliza

Ito ay magse-setup ng proyekto at sisimulan ang bot gamit ang kusang mapagpipilian na karakter.

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

### Ipasadya ang Karakter File

1. Buksan ang `packages/core/src/defaultCharacter.ts` para baguhin ang kusang mapagpipilian na karakter.
2. Mag-load ng pasadya na mga karakter:
- Gamitin ang `pnpm start --characters="landas/sa/inyong/character.json"`
- Puwedeng mag-load ng maraming karakter file sabay-sabay.
3. Ikonekta ang Twitter (X):
- Baguhin ang `"clients": []` sa `"clients": ["twitter"]` sa karakter file upang ikonekta ang Twitter.

### Manwal na Pag-simula ng Eliza

```bash
pnpm i
pnpm build
pnpm start

# Linisin ang proyekto kung bumalik ka dito matapos ang mahabang panahon
pnpm clean
```

#### Karagdagang Mga Kinakailangan

Puwede mong kailangang mag-install ng [Sharp](https://sharp.pixelplumbing.com/). Kung may pagkakamali, subukang i-install ito gamit ang:

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

### Komunidad at Kontak

- [Mga Isyu sa GitHub](https://github.com/elizaos/eliza/issues): Para sa mga bug at mungkahi sa tampok.
- [Discord](https://discord.gg/ai16z): Para sa pagbabahagi ng aplikasyon at pakikihalubilo sa komunidad.

## Mga Kontribyutor

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

## Kasaysayan ng mga Bituin

[![Tsart ng Kasaysayan ng mga Bituin](https://api.star-history.com/svg?repos=elizaos/eliza&type=Date)](https://star-history.com/#elizaos/eliza&Date)
120 changes: 60 additions & 60 deletions agent/package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"name": "@elizaos/agent",
"version": "0.1.7-alpha.1",
"main": "src/index.ts",
"type": "module",
"scripts": {
"start": "node --loader ts-node/esm src/index.ts",
"dev": "node --loader ts-node/esm src/index.ts",
"check-types": "tsc --noEmit"
},
"nodemonConfig": {
"watch": [
"src",
"../core/dist"
],
"ext": "ts,json",
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
},
"dependencies": {
"@elizaos/adapter-postgres": "workspace:*",
"@elizaos/adapter-redis": "workspace:*",
"@elizaos/adapter-sqlite": "workspace:*",
"@elizaos/client-auto": "workspace:*",
"@elizaos/client-direct": "workspace:*",
"@elizaos/client-discord": "workspace:*",
"@elizaos/client-farcaster": "workspace:*",
"@elizaos/client-lens": "workspace:*",
"@elizaos/client-telegram": "workspace:*",
"@elizaos/client-twitter": "workspace:*",
"@elizaos/client-slack": "workspace:*",
"@elizaos/core": "workspace:*",
"@elizaos/plugin-0g": "workspace:*",
"@elizaos/plugin-aptos": "workspace:*",
"@elizaos/plugin-bootstrap": "workspace:*",
"@elizaos/plugin-intiface": "workspace:*",
"@elizaos/plugin-coinbase": "workspace:*",
"@elizaos/plugin-conflux": "workspace:*",
"@elizaos/plugin-evm": "workspace:*",
"@elizaos/plugin-flow": "workspace:*",
"@elizaos/plugin-story": "workspace:*",
"@elizaos/plugin-goat": "workspace:*",
"@elizaos/plugin-icp": "workspace:*",
"@elizaos/plugin-image-generation": "workspace:*",
"@elizaos/plugin-nft-generation": "workspace:*",
"@elizaos/plugin-node": "workspace:*",
"@elizaos/plugin-solana": "workspace:*",
"@elizaos/plugin-starknet": "workspace:*",
"@elizaos/plugin-ton": "workspace:*",
"@elizaos/plugin-sui": "workspace:*",
"@elizaos/plugin-tee": "workspace:*",
"@elizaos/plugin-multiversx": "workspace:*",
"@elizaos/plugin-near": "workspace:*",
"@elizaos/plugin-zksync-era": "workspace:*",
"readline": "1.3.0",
"ws": "8.18.0",
"yargs": "17.7.2"
},
"devDependencies": {
"ts-node": "10.9.2",
"tsup": "8.3.5"
}
"name": "@elizaos/agent",
"version": "0.1.7-alpha.1",
"main": "src/index.ts",
"type": "module",
"scripts": {
"start": "node --loader ts-node/esm src/index.ts",
"dev": "node --loader ts-node/esm src/index.ts",
"check-types": "tsc --noEmit"
},
"nodemonConfig": {
"watch": [
"src",
"../core/dist"
],
"ext": "ts,json",
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts"
},
"dependencies": {
"@elizaos/adapter-postgres": "workspace:*",
"@elizaos/adapter-redis": "workspace:*",
"@elizaos/adapter-sqlite": "workspace:*",
"@elizaos/client-auto": "workspace:*",
"@elizaos/client-direct": "workspace:*",
"@elizaos/client-discord": "workspace:*",
"@elizaos/client-farcaster": "workspace:*",
"@elizaos/client-lens": "workspace:*",
"@elizaos/client-telegram": "workspace:*",
"@elizaos/client-twitter": "workspace:*",
"@elizaos/client-slack": "workspace:*",
"@elizaos/core": "workspace:*",
"@elizaos/plugin-0g": "workspace:*",
"@elizaos/plugin-aptos": "workspace:*",
"@elizaos/plugin-bootstrap": "workspace:*",
"@elizaos/plugin-intiface": "workspace:*",
"@elizaos/plugin-coinbase": "workspace:*",
"@elizaos/plugin-conflux": "workspace:*",
"@elizaos/plugin-evm": "workspace:*",
"@elizaos/plugin-flow": "workspace:*",
"@elizaos/plugin-story": "workspace:*",
"@elizaos/plugin-goat": "workspace:*",
"@elizaos/plugin-icp": "workspace:*",
"@elizaos/plugin-image-generation": "workspace:*",
"@elizaos/plugin-nft-generation": "workspace:*",
"@elizaos/plugin-node": "workspace:*",
"@elizaos/plugin-solana": "workspace:*",
"@elizaos/plugin-starknet": "workspace:*",
"@elizaos/plugin-ton": "workspace:*",
"@elizaos/plugin-sui": "workspace:*",
"@elizaos/plugin-tee": "workspace:*",
"@elizaos/plugin-multiversx": "workspace:*",
"@elizaos/plugin-near": "workspace:*",
"@elizaos/plugin-zksync-era": "workspace:*",
"readline": "1.3.0",
"ws": "8.18.0",
"yargs": "17.7.2"
},
"devDependencies": {
"ts-node": "10.9.2",
"tsup": "8.3.5"
}
}
45 changes: 38 additions & 7 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
import yargs from "yargs";
import net from "net";

const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename); // get the name of the directory
Expand Down Expand Up @@ -489,7 +490,7 @@ export async function createAgent(
}

let goatPlugin: any | undefined;
if (getSecret(character, "ALCHEMY_API_KEY")) {
if (getSecret(character, "EVM_PROVIDER_URL")) {
goatPlugin = await createGoatPlugin((secret) =>
getSecret(character, secret)
);
Expand Down Expand Up @@ -560,7 +561,7 @@ export async function createAgent(
getSecret(character, "COINBASE_NOTIFICATION_URI")
? webhookPlugin
: null,
getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null,
getSecret(character, "EVM_PROVIDER_URL") ? goatPlugin : null,
getSecret(character, "FLOW_ADDRESS") &&
getSecret(character, "FLOW_PRIVATE_KEY")
? flowPlugin
Expand Down Expand Up @@ -692,13 +693,30 @@ async function startAgent(
}
}

const checkPortAvailable = (port: number): Promise<boolean> => {
return new Promise((resolve) => {
const server = net.createServer();

server.once("error", (err: NodeJS.ErrnoException) => {
if (err.code === "EADDRINUSE") {
resolve(false);
}
});

server.once("listening", () => {
server.close();
resolve(true);
});

server.listen(port);
});
};

const startAgents = async () => {
const directClient = new DirectClient();
const serverPort = parseInt(settings.SERVER_PORT || "3000");
let serverPort = parseInt(settings.SERVER_PORT || "3000");
const args = parseArguments();

let charactersArg = args.characters || args.character;

let characters = [defaultCharacter];

if (charactersArg) {
Expand All @@ -713,19 +731,32 @@ const startAgents = async () => {
elizaLogger.error("Error starting agents:", error);
}

// Find available port
while (!(await checkPortAvailable(serverPort))) {
elizaLogger.warn(
`Port ${serverPort} is in use, trying ${serverPort + 1}`
);
serverPort++;
}

// upload some agent functionality into directClient
directClient.startAgent = async (character: Character) => {
// wrap it so we don't have to inject directClient later
return startAgent(character, directClient);
};

directClient.start(serverPort);

if (serverPort !== parseInt(settings.SERVER_PORT || "3000")) {
elizaLogger.log(`Server started on alternate port ${serverPort}`);
}

elizaLogger.log(
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents"
"Run `pnpm start:client` to start the client and visit the outputted URL (http://localhost:5173) to chat with your agents. When running multiple agents, use client with different port `SERVER_PORT=3001 pnpm start:client`"
);
};

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

0 comments on commit 24dbabe

Please sign in to comment.