Skip to content

Commit

Permalink
Merge pull request #162 from ponderingdemocritus/main
Browse files Browse the repository at this point in the history
Import work and cleanup
  • Loading branch information
lalalune authored Nov 2, 2024
2 parents 83106a2 + e25ce25 commit b9a9c33
Show file tree
Hide file tree
Showing 33 changed files with 988 additions and 1,014 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eliza

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

_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_

Expand Down
9 changes: 0 additions & 9 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,5 @@
"onnxruntime-node": "1.19.0",
"@discordjs/opus": "github:discordjs/opus",
"sharp": "^0.33.5"
},
"optionalDependencies": {
"sharp": "0.33.5",
"sqlite-vss-darwin-arm64": "0.1.2",
"sqlite-vss-darwin-x64": "0.1.2",
"sqlite-vss-linux-arm64": "^0.1.2",
"sqlite-vss-linux-x64": "0.1.2",
"sqlite-vss-win32-arm64": "^0.1.2",
"sqlite-vss-win32-x64": "^0.1.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const claudeHandlerTemplate = `{{attachments}}
# Instructions: Claude, I need your help in assisting the user with their last request. Please provide a helpful, thorough response. I have no arms, so you'll have to write out any implements and take care not to omit or leave TODOs for later. Also, please don't acknowledge the request, just do it.`;

export default {
export const askClaude: Action = {
name: "ASK_CLAUDE",
similes: ["CLAUDE", "CALL_CLAUDE", "ANTHROPIC", "SONNET", "OPUS"],
description:
Expand Down
2 changes: 1 addition & 1 deletion core/src/actions/continue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Based on the following conversation, should {{agentName}} continue? YES or NO
Should {{agentName}} continue? ` + booleanFooter;

export default {
export const continueAction: Action = {
name: "CONTINUE",
similes: ["ELABORATE", "KEEP_TALKING"],
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Respond with YES if:
Otherwise, respond with NO.
` + booleanFooter;

export default {
export const followRoom: Action = {
name: "FOLLOW_ROOM",
similes: [
"FOLLOW_CHAT",
Expand Down
2 changes: 1 addition & 1 deletion core/src/actions/ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type Action,
} from "../core/types.ts";

export default {
export const ignore: Action = {
name: "IGNORE",
similes: ["STOP_TALKING", "STOP_CHATTING", "STOP_CONVERSATION"],
validate: async (_runtime: IAgentRuntime, _message: Memory) => {
Expand Down
2 changes: 1 addition & 1 deletion core/src/actions/imageGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "../core/types.ts";
import { generateCaption, generateImage } from "./imageGenerationUtils.ts";

export default {
export const imageGeneration: Action = {
name: "IMAGE_GEN",
similes: ["GENERATE_IMAGE", "CREATE_IMAGE", "MAKE_PICTURE"],
description: "Generate an image based on a prompt",
Expand Down
18 changes: 9 additions & 9 deletions core/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export * from "./ask_claude.ts";
export * from "./follow_room.ts";
export * from "./askClaude.ts";
export * from "./followRoom.ts";
export * from "./imageGeneration.ts";
export * from "./mute_room.ts";
export * from "./muteRoom.ts";
export * from "./swap.ts";
export * from "./unfollow_room.ts";
export * from "./unmute_room.ts";
export * from "./mute_room.ts";
export * from "./unfollowRoom.ts";
export * from "./unmuteRoom.ts";
export * from "./muteRoom.ts";
export * from "./continue.ts";
export * from "./follow_room.ts";
export * from "./followRoom.ts";
export * from "./ignore.ts";
export * from "./imageGenerationUtils.ts";
export * from "./pumpfun.ts";
export * from "./swap.ts";
export * from "./swapUtils.ts";
export * from "./take_order.ts";
export * from "./takeOrder.ts";
export * from "./none.ts";
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Respond with YES if:
Otherwise, respond with NO.
` + booleanFooter;

export default {
export const muteRoom: Action = {
name: "MUTE_ROOM",
similes: [
"MUTE_CHAT",
Expand Down
2 changes: 1 addition & 1 deletion core/src/actions/none.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type Action,
} from "../core/types.ts";

export default {
export const none: Action = {
name: "NONE",
similes: [
"NO_ACTION",
Expand Down
4 changes: 2 additions & 2 deletions core/src/actions/pumpfun.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AnchorProvider } from "@coral-xyz/anchor";
import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet.js";
import { Wallet } from "@coral-xyz/anchor";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import {
CreateTokenMetadata,
Expand Down Expand Up @@ -247,7 +247,7 @@ export default {
} = content;

const privateKey = runtime.getSetting("WALLET_PRIVATE_KEY")!;
const wallet = new NodeWallet(
const wallet = new Wallet(
Keypair.fromSecretKey(new Uint8Array(JSON.parse(privateKey)))
);
const connection = new Connection(settings.RPC_URL!);
Expand Down
2 changes: 1 addition & 1 deletion core/src/actions/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function promptConfirmation(): Promise<boolean> {
return confirmSwap;
}

export default {
export const executeSwap: Action = {
name: "EXECUTE_SWAP",
similes: ["SWAP_TOKENS", "TOKEN_SWAP", "TRADE_TOKENS", "EXCHANGE_TOKENS"],
validate: async (runtime: IAgentRuntime, message: Memory) => {
Expand Down
6 changes: 4 additions & 2 deletions core/src/actions/swapUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import {
RpcResponseAndContext,
SimulatedTransactionResponse,
TokenAmount,
VersionedTransaction
VersionedTransaction,
} from "@solana/web3.js";
import settings from "../core/settings.ts";

const solAddress = settings.SOL_ADDRESS;
const SLIPPAGE = settings.SLIPPAGE;
const connection = new Connection(settings.RPC_URL || "https://api.mainnet-beta.solana.com");
const connection = new Connection(
settings.RPC_URL || "https://api.mainnet-beta.solana.com"
);
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

export async function delayedCall<T>(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Respond with YES if:
Otherwise, respond with NO.
` + booleanFooter;

export default {
export const unfollowRoom: Action = {
name: "UNFOLLOW_ROOM",
similes: [
"UNFOLLOW_CHAT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Respond with YES if:
Otherwise, respond with NO.
` + booleanFooter;

export default {
export const unmuteRoom: Action = {
name: "UNMUTE_ROOM",
similes: [
"UNMUTE_CHAT",
Expand Down
Loading

0 comments on commit b9a9c33

Please sign in to comment.