Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: readme and linting #449

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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