Skip to content

Commit

Permalink
Merge branch 'develop' into feat/sol-agent-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
renlulu authored Dec 24, 2024
2 parents 635b672 + 8b23c3a commit 47eef3a
Show file tree
Hide file tree
Showing 66 changed files with 1,716 additions and 1,532 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')"
41 changes: 36 additions & 5 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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 @@ -696,13 +697,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 @@ -717,19 +735,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);
});
90 changes: 45 additions & 45 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"name": "eliza-client",
"private": true,
"version": "0.1.7-alpha.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"check-types": "tsc --noEmit",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@elizaos/core": "workspace:*",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-separator": "1.1.0",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-tooltip": "1.1.4",
"@tanstack/react-query": "5.61.0",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"lucide-react": "0.460.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.1",
"tailwind-merge": "2.5.5",
"tailwindcss-animate": "1.0.7",
"vite-plugin-top-level-await": "1.4.4",
"vite-plugin-wasm": "3.3.0"
},
"devDependencies": {
"@eslint/js": "9.16.0",
"@types/node": "22.8.4",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"autoprefixer": "10.4.20",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-react-refresh": "0.4.14",
"globals": "15.11.0",
"postcss": "8.4.49",
"tailwindcss": "3.4.15",
"typescript": "5.6.3",
"typescript-eslint": "8.11.0",
"vite": "link:@tanstack/router-plugin/vite"
}
"name": "eliza-client",
"private": true,
"version": "0.1.7-alpha.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"check-types": "tsc --noEmit",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@elizaos/core": "workspace:*",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-separator": "1.1.0",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-tooltip": "1.1.4",
"@tanstack/react-query": "5.61.0",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"lucide-react": "0.460.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.1",
"tailwind-merge": "2.5.5",
"tailwindcss-animate": "1.0.7",
"vite-plugin-top-level-await": "1.4.4",
"vite-plugin-wasm": "3.3.0"
},
"devDependencies": {
"@eslint/js": "9.16.0",
"@types/node": "22.8.4",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"autoprefixer": "10.4.20",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-react-refresh": "0.4.14",
"globals": "15.11.0",
"postcss": "8.4.49",
"tailwindcss": "3.4.15",
"typescript": "5.6.3",
"typescript-eslint": "8.11.0",
"vite": "link:@tanstack/router-plugin/vite"
}
}
87 changes: 23 additions & 64 deletions docs/community/Streams/12-2024/2024-12-03.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,32 @@ description: "Building Complex AI Agents with Actions, Providers, & Evaluators"

**Building Complex AI Agents with Actions, Providers, & Evaluators**

Date: 2024-12-03
YouTube Link: https://www.youtube.com/watch?v=XenGeAcPAQo
- Date: 2024-12-03
- YouTube Link: https://www.youtube.com/watch?v=XenGeAcPAQo

## Timestamps

**00:03:33** - Shift in focus from characters (Dev School Part 1) to agent capabilities
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=213

**00:07:09** - Deep dive into providers, actions, and evaluators, the core building blocks of Eliza
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=429

**00:07:28** - Discussion about actions vs. tools, favoring decoupled intent and action execution
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=448

**00:18:02** - Explanation of providers and their function as information sources for agents
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=1082

**00:20:15** - Introduction to evaluators and their role in agent reflection and state analysis
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=1215

**00:29:22** - Brief overview of clients as connectors to external platforms
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=1762

**00:31:02** - Description of adapters and their function in database interactions
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=1862

**00:34:02** - Discussion about plugins as bundles of core components, examples, and recommendations
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=2042

**00:40:31** - Live Coding Demo begins: Creating a new plugin from scratch (DevSchoolExamplePlugin)
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=2431

**00:47:54** - Implementing the simple HelloWorldAction
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=2791

**01:00:26** - Implementing the CurrentNewsAction (fetching and formatting news data)
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=3626

**01:22:09** - Demonstrating the Eliza Client for interacting with agents locally
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=4929

**01:23:54** - Q&A: Plugin usage in character files, installation, Eliza vs. Eliza Starter
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=5034

**01:36:17** - Saving agent responses as memories in the database
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=5777

**01:43:06** - Using prompts for data extraction within actions
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=6186

**01:51:54** - Importance of deleting the database during development to avoid context issues
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=6714

**01:57:04** - Viewing agent context via console logs to understand model inputs
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=7024

**02:07:07** - Explanation of memory management with knowledge, facts, and lore
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=7627

**02:16:53** - Q&A: Prompt engineering opportunities, knowledge chunking and retrieval
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=8213

**02:22:57** - Call for contributions: Encouraging viewers to create their own actions and plugins
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=8577

**02:26:31** - Closing remarks and future DevSchool session announcements
- Link: https://www.youtube.com/watch?v=XenGeAcPAQo&t=8791
- [00:03:33](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=213>) - Shift in focus from characters (DevSchool Part 1) to agent capabilities.
- [00:07:09](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=429>) - Deep dive into providers, actions, and evaluators, the core building blocks of Eliza.
- [00:07:28](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=448>) - Discussion about actions vs. tools, favoring decoupled intent and action execution.
- [00:18:02](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=1082>) - Explanation of providers and their function as information sources for agents.
- [00:20:15](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=1215>) - Introduction to evaluators and their role in agent reflection and state analysis.
- [00:29:22](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=1762>) - Brief overview of clients as connectors to external platforms.
- [00:31:02](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=1862>) - Description of adapters and their function in database interactions.
- [00:34:02](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=2042>) - Discussion about plugins as bundles of core components, examples, and recommendations.
- [00:40:31](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=2431>) - Live Coding Demo begins: Creating a new plugin from scratch (DevSchoolExamplePlugin).
- [00:47:54](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=2874>) - Implementing the simple HelloWorldAction.
- [01:00:26](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=3626>) - Implementing the CurrentNewsAction (fetching and formatting news data).
- [01:22:09](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=4929>) - Demonstrating the Eliza Client for interacting with agents locally.
- [01:23:54](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=5034>) - Q&A: Plugin usage in character files, installation, Eliza vs. Eliza Starter.
- [01:36:17](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=5777>) - Saving agent responses as memories in the database.
- [01:43:06](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=6186>) - Using prompts for data extraction within actions.
- [01:51:54](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=6714>) - Importance of deleting the database during development to avoid context issues.
- [01:57:04](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=7024>) - Viewing agent context via console logs to understand model inputs.
- [02:07:07](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=7627>) - Explanation of memory management with knowledge, facts, and lore.
- [02:16:53](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=8213>) - Q&A: Prompt engineering opportunities, knowledge chunking and retrieval.
- [02:22:57](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=8577>) - Call for contributions: Encouraging viewers to create their own actions and plugins.
- [02:26:31](<https://www.youtube.com/watch?v=XenGeAcPAQo&t=8791>) - Closing remarks and future DevSchool session announcements.

## Summary

Expand Down
4 changes: 2 additions & 2 deletions docs/community/Streams/12-2024/2024-12-05.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ description: "Form-Filling Frenzy & Eliza's Wild Ride"

**Form-Filling Frenzy & Eliza's Wild Ride**

Date: 2024-12-05
YouTube Link: https://www.youtube.com/watch?v=Y1DiqSVy4aU
- Date: 2024-12-05
- YouTube Link: https://www.youtube.com/watch?v=Y1DiqSVy4aU

## Timestamps

Expand Down
Loading

0 comments on commit 47eef3a

Please sign in to comment.