Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Nov 20, 2024
1 parent fec2d59 commit f1b4743
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 68 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions packages/client-discord/src/actions/joinvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// src/actions/joinVoice
import {
Action,
ActionExample, composeContext, IAgentRuntime,
ActionExample,
composeContext,
IAgentRuntime,
Memory,
State
State,
} from "@ai16z/eliza";
import {
Channel,
Expand Down
8 changes: 6 additions & 2 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
46 changes: 23 additions & 23 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
82 changes: 41 additions & 41 deletions packages/core/src/test_resources/createRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]",
},
};
}
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: "[email protected]",
},
};
}
break;
case "supabase": {
const module = await import("@supabase/supabase-js");

Expand Down Expand Up @@ -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: "[email protected]",
},
};
}
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: "[email protected]",
},
};
}
break;
}

const runtime = new AgentRuntime({
Expand Down

0 comments on commit f1b4743

Please sign in to comment.