Skip to content

Commit

Permalink
Merge pull request #449 from ai16z/readme
Browse files Browse the repository at this point in the history
feat: readme and linting
  • Loading branch information
ponderingdemocritus authored Nov 20, 2024
2 parents b27361c + 36f058b commit 38b02a7
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 74 deletions.
6 changes: 0 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
**/*/target
**/*/dist
packages/torii-client/wasm
packages/torii-client/pkg
packages/torii-wasm/pkg/
packages/utils-wasm/pkg/

worlds/dojo-starter

# ignore lock files
**/*-lock.yaml
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@

> **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
# Clone the repository
git clone https://github.com/ai16z/eliza.git

# Checkout the latest release
# This project iterates fast, so we recommend checking out the latest release
git checkout $(git describe --tags --abbrev=0)
```

### 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 38b02a7

Please sign in to comment.