Skip to content

Commit

Permalink
practice: plugin-devschool
Browse files Browse the repository at this point in the history
  • Loading branch information
ileana-pr committed Dec 17, 2024
1 parent f7c3c08 commit bedb635
Show file tree
Hide file tree
Showing 13 changed files with 650 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/plugin-devschool/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
3 changes: 3 additions & 0 deletions packages/plugin-devschool/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import eslintGlobalConfig from "../../eslint.config.mjs";

export default [...eslintGlobalConfig];
19 changes: 19 additions & 0 deletions packages/plugin-devschool/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@ai16z/plugin-devschool",
"version": "0.1.5-alpha.5",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",
"dependencies": {
"@ai16z/eliza": "workspace:*",
"tsup": "8.3.5"
},
"scripts": {
"build": "tsup --format esm --dts",
"dev": "tsup --format esm --dts --watch",
"lint": "eslint . --fix"
},
"peerDependencies": {
"whatwg-url": "7.1.0"
}
}
152 changes: 152 additions & 0 deletions packages/plugin-devschool/src/actions/helloworld.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import {
ActionExample,
IAgentRuntime,
Memory,
type Action,
} from "@ai16z/eliza";

export const noneAction: Action = {
name: "NONE",
similes: [
"NO_ACTION",
"NO_RESPONSE",
"NO_REACTION",
"RESPONSE",
"REPLY",
"DEFAULT",
],
validate: async (_runtime: IAgentRuntime, _message: Memory) => {
return true;
},
description:
"Respond but perform no additional action. This is the default if the agent is speaking and not doing anything additional.",
handler: async (
_runtime: IAgentRuntime,
_message: Memory
): Promise<boolean> => {
return true;
},
examples: [
[
{
user: "{{user1}}",
content: { text: "Hey whats up" },
},
{
user: "{{user2}}",
content: { text: "oh hey", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: {
text: "did u see some faster whisper just came out",
},
},
{
user: "{{user2}}",
content: {
text: "yeah but its a pain to get into node.js",
action: "NONE",
},
},
],
[
{
user: "{{user1}}",
content: {
text: "the things that were funny 6 months ago are very cringe now",
action: "NONE",
},
},
{
user: "{{user2}}",
content: {
text: "lol true",
action: "NONE",
},
},
{
user: "{{user1}}",
content: { text: "too real haha", action: "NONE" },
},
],
[
{
user: "{{user1}}",
content: { text: "gotta run", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "Okay, ttyl", action: "NONE" },
},
{
user: "{{user1}}",
content: { text: "", action: "IGNORE" },
},
],

[
{
user: "{{user1}}",
content: { text: "heyyyyyy", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "whats up long time no see" },
},
{
user: "{{user1}}",
content: {
text: "chillin man. playing lots of fortnite. what about you",
action: "NONE",
},
},
],

[
{
user: "{{user1}}",
content: { text: "u think aliens are real", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "ya obviously", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: { text: "drop a joke on me", action: "NONE" },
},
{
user: "{{user2}}",
content: {
text: "why dont scientists trust atoms cuz they make up everything lmao",
action: "NONE",
},
},
{
user: "{{user1}}",
content: { text: "haha good one", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: {
text: "hows the weather where ur at",
action: "NONE",
},
},
{
user: "{{user2}}",
content: { text: "beautiful all week", action: "NONE" },
},
],
] as ActionExample[][],
} as Action;
2 changes: 2 additions & 0 deletions packages/plugin-devschool/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

export * from "./none.ts";
152 changes: 152 additions & 0 deletions packages/plugin-devschool/src/actions/none.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import {
ActionExample,
IAgentRuntime,
Memory,
type Action,
} from "@ai16z/eliza";

export const noneAction: Action = {
name: "NONE",
similes: [
"NO_ACTION",
"NO_RESPONSE",
"NO_REACTION",
"RESPONSE",
"REPLY",
"DEFAULT",
],
validate: async (_runtime: IAgentRuntime, _message: Memory) => {
return true;
},
description:
"Respond but perform no additional action. This is the default if the agent is speaking and not doing anything additional.",
handler: async (
_runtime: IAgentRuntime,
_message: Memory
): Promise<boolean> => {
return true;
},
examples: [
[
{
user: "{{user1}}",
content: { text: "Hey whats up" },
},
{
user: "{{user2}}",
content: { text: "oh hey", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: {
text: "did u see some faster whisper just came out",
},
},
{
user: "{{user2}}",
content: {
text: "yeah but its a pain to get into node.js",
action: "NONE",
},
},
],
[
{
user: "{{user1}}",
content: {
text: "the things that were funny 6 months ago are very cringe now",
action: "NONE",
},
},
{
user: "{{user2}}",
content: {
text: "lol true",
action: "NONE",
},
},
{
user: "{{user1}}",
content: { text: "too real haha", action: "NONE" },
},
],
[
{
user: "{{user1}}",
content: { text: "gotta run", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "Okay, ttyl", action: "NONE" },
},
{
user: "{{user1}}",
content: { text: "", action: "IGNORE" },
},
],

[
{
user: "{{user1}}",
content: { text: "heyyyyyy", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "whats up long time no see" },
},
{
user: "{{user1}}",
content: {
text: "chillin man. playing lots of fortnite. what about you",
action: "NONE",
},
},
],

[
{
user: "{{user1}}",
content: { text: "u think aliens are real", action: "NONE" },
},
{
user: "{{user2}}",
content: { text: "ya obviously", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: { text: "drop a joke on me", action: "NONE" },
},
{
user: "{{user2}}",
content: {
text: "why dont scientists trust atoms cuz they make up everything lmao",
action: "NONE",
},
},
{
user: "{{user1}}",
content: { text: "haha good one", action: "NONE" },
},
],

[
{
user: "{{user1}}",
content: {
text: "hows the weather where ur at",
action: "NONE",
},
},
{
user: "{{user2}}",
content: { text: "beautiful all week", action: "NONE" },
},
],
] as ActionExample[][],
} as Action;
Loading

0 comments on commit bedb635

Please sign in to comment.