diff --git a/README.md b/README.md index e7fc4a2c2..27795fc8c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,24 @@ > **Note for Windows Users:** [WSL 2](https://learn.microsoft.com/en-us/windows/wsl/install-manual) is required. +### Use the Starter (Recommended) + +```bash +git clone https://github.com/ai16z/eliza-starter.git + +cp .env.example .env + +pnpm i && pnpm start +``` + +Then read the [Documentation](https://ai16z.github.io/eliza/) to learn how to customize your Eliza. + +### Manually Start Eliza (Only recommended if you know what you are doing) + +```bash +git clone https://github.com/ai16z/eliza.git +``` + ### Edit the .env file Copy .env.example to .env and fill in the appropriate values. diff --git a/packages/client-discord/src/actions/joinvoice.ts b/packages/client-discord/src/actions/joinvoice.ts index 318937b5a..32453a158 100644 --- a/packages/client-discord/src/actions/joinvoice.ts +++ b/packages/client-discord/src/actions/joinvoice.ts @@ -2,9 +2,11 @@ // src/actions/joinVoice import { Action, - ActionExample, composeContext, IAgentRuntime, + ActionExample, + composeContext, + IAgentRuntime, Memory, - State + State, } from "@ai16z/eliza"; import { Channel, diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index b48c98817..448b70518 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -24,8 +24,12 @@ import { import settings from "./settings.ts"; import { Content, - IAgentRuntime, IImageDescriptionService, ITextGenerationService, ModelClass, ModelProviderName, - ServiceType + IAgentRuntime, + IImageDescriptionService, + ITextGenerationService, + ModelClass, + ModelProviderName, + ServiceType, } from "./types.ts"; /** diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index 293c7561a..769086d22 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -1000,35 +1000,35 @@ Text: ${attachment.text} formattedCharacterMessageExamples ) : "", - messageDirections: - this.character?.style?.all?.length > 0 || - this.character?.style?.chat.length > 0 - ? addHeader( - "# Message Directions for " + this.character.name, - (() => { - const all = this.character?.style?.all || []; - const chat = this.character?.style?.chat || []; - return [...all, ...chat].join("\n"); - })() - ) - : "", - + messageDirections: + this.character?.style?.all?.length > 0 || + this.character?.style?.chat.length > 0 + ? addHeader( + "# Message Directions for " + this.character.name, + (() => { + const all = this.character?.style?.all || []; + const chat = this.character?.style?.chat || []; + return [...all, ...chat].join("\n"); + })() + ) + : "", + postDirections: this.character?.style?.all?.length > 0 || this.character?.style?.post.length > 0 ? addHeader( - "# Post Directions for " + this.character.name, - (() => { - const all = this.character?.style?.all || []; - const post = this.character?.style?.post || []; - return [...all, ...post].join("\n"); - })() - ) + "# Post Directions for " + this.character.name, + (() => { + const all = this.character?.style?.all || []; + const post = this.character?.style?.post || []; + return [...all, ...post].join("\n"); + })() + ) : "", - - //old logic left in for reference + + //old logic left in for reference //food for thought. how could we dynamically decide what parts of the character to add to the prompt other than random? rag? prompt the llm to decide? - /* + /* postDirections: this.character?.style?.all?.length > 0 || this.character?.style?.post.length > 0 diff --git a/packages/core/src/test_resources/createRuntime.ts b/packages/core/src/test_resources/createRuntime.ts index 8633f91d6..f894cabaf 100644 --- a/packages/core/src/test_resources/createRuntime.ts +++ b/packages/core/src/test_resources/createRuntime.ts @@ -38,28 +38,28 @@ export async function createRuntime({ switch (env?.TEST_DATABASE_CLIENT as string) { case "sqljs": - { - const module = await import("sql.js"); - - const initSqlJs = module.default; - - // SQLite adapter - const SQL = await initSqlJs({}); - const db = new SQL.Database(); - - adapter = new SqlJsDatabaseAdapter(db); - - // Load sqlite-vss - loadVecExtensions((adapter as SqlJsDatabaseAdapter).db); - // Create a test user and session - session = { - user: { - id: zeroUuid, - email: "test@example.com", - }, - }; - } - break; + { + const module = await import("sql.js"); + + const initSqlJs = module.default; + + // SQLite adapter + const SQL = await initSqlJs({}); + const db = new SQL.Database(); + + adapter = new SqlJsDatabaseAdapter(db); + + // Load sqlite-vss + loadVecExtensions((adapter as SqlJsDatabaseAdapter).db); + // Create a test user and session + session = { + user: { + id: zeroUuid, + email: "test@example.com", + }, + }; + } + break; case "supabase": { const module = await import("@supabase/supabase-js"); @@ -108,25 +108,25 @@ export async function createRuntime({ } case "sqlite": default: - { - const module = await import("better-sqlite3"); - - const Database = module.default; - - // SQLite adapter - adapter = new SqliteDatabaseAdapter(new Database(":memory:")); - - // Load sqlite-vss - await loadVecExtensions((adapter as SqliteDatabaseAdapter).db); - // Create a test user and session - session = { - user: { - id: zeroUuid, - email: "test@example.com", - }, - }; - } - break; + { + const module = await import("better-sqlite3"); + + const Database = module.default; + + // SQLite adapter + adapter = new SqliteDatabaseAdapter(new Database(":memory:")); + + // Load sqlite-vss + await loadVecExtensions((adapter as SqliteDatabaseAdapter).db); + // Create a test user and session + session = { + user: { + id: zeroUuid, + email: "test@example.com", + }, + }; + } + break; } const runtime = new AgentRuntime({