Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/yodamaster726/eliza into yo…
Browse files Browse the repository at this point in the history
…damaster726-main
  • Loading branch information
ponderingdemocritus committed Nov 23, 2024
2 parents 464377e + d0aed6d commit 527f649
Show file tree
Hide file tree
Showing 18 changed files with 4,893 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ STARKNET_ADDRESS=
STARKNET_PRIVATE_KEY=
STARKNET_RPC_URL=


# Coinbase Commerce
COINBASE_COMMERCE_KEY=
1 change: 1 addition & 0 deletions agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@ai16z/plugin-node": "workspace:*",
"@ai16z/plugin-solana": "workspace:*",
"@ai16z/plugin-starknet": "workspace:*",
"@ai16z/plugin-coinbase": "workspace:*",
"readline": "^1.3.0",
"ws": "^8.18.0",
"yargs": "17.7.2"
Expand Down
5 changes: 5 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { nodePlugin } from "@ai16z/plugin-node";
import { coinbaseCommercePlugin } from "@ai16z/plugin-coinbase";
import Database from "better-sqlite3";
import fs from "fs";
import readline from "readline";
Expand Down Expand Up @@ -249,6 +250,10 @@ export function createAgent(
bootstrapPlugin,
nodePlugin,
character.settings.secrets?.WALLET_PUBLIC_KEY ? solanaPlugin : null,
character.settings.secrets?.COINBASE_COMMERCE_KEY ||
process.env.COINBASE_COMMERCE_KEY
? coinbaseCommercePlugin
: null,
].filter(Boolean),
providers: [],
actions: [],
Expand Down
105 changes: 105 additions & 0 deletions docs/docs/packages/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,111 @@ const character = {
};
```

Here is the updated README with the Coinbase Commerce plugin information added:

---

# 🧩 Plugins

## Overview

Eliza's plugin system provides a modular way to extend the core functionality with additional features, actions, evaluators, and providers. Plugins are self-contained modules that can be easily added or removed to customize your agent's capabilities.

## Core Plugin Concepts

### Plugin Structure

Each plugin in Eliza must implement the `Plugin` interface with the following properties:

```typescript
interface Plugin {
name: string; // Unique identifier for the plugin
description: string; // Brief description of plugin functionality
actions?: Action[]; // Custom actions provided by the plugin
evaluators?: Evaluator[]; // Custom evaluators for behavior assessment
providers?: Provider[]; // Context providers for message generation
services?: Service[]; // Additional services (optional)
}
```

### Available Plugins

#### 1. Bootstrap Plugin (`@eliza/plugin-bootstrap`)

The bootstrap plugin provides essential baseline functionality:

**Actions:**

- `continue` - Continue the current conversation flow
- `followRoom` - Follow a room for updates
- `unfollowRoom` - Unfollow a room
- `ignore` - Ignore specific messages
- `muteRoom` - Mute notifications from a room
- `unmuteRoom` - Unmute notifications from a room

**Evaluators:**

- `fact` - Evaluate factual accuracy
- `goal` - Assess goal completion

**Providers:**

- `boredom` - Manages engagement levels
- `time` - Provides temporal context
- `facts` - Supplies factual information

#### 2. Image Generation Plugin (`@eliza/plugin-image-generation`)

Enables AI image generation capabilities:

**Actions:**

- `GENERATE_IMAGE` - Create images based on text descriptions
- Supports multiple image generation services (Anthropic, Together)
- Auto-generates captions for created images

#### 3. Node Plugin (`@eliza/plugin-node`)

Provides core Node.js-based services:

**Services:**

- `BrowserService` - Web browsing capabilities
- `ImageDescriptionService` - Image analysis
- `LlamaService` - LLM integration
- `PdfService` - PDF processing
- `SpeechService` - Text-to-speech
- `TranscriptionService` - Speech-to-text
- `VideoService` - Video processing

#### 4. Solana Plugin (`@eliza/plugin-solana`)

Integrates Solana blockchain functionality:

**Evaluators:**

- `trustEvaluator` - Assess transaction trust scores

**Providers:**

- `walletProvider` - Wallet management
- `trustScoreProvider` - Transaction trust metrics

#### 5. Coinbase Commerce Plugin (`@eliza/plugin-coinbase-commerce`)

Integrates Coinbase Commerce for payment and transaction management:

**Actions:**

- `CREATE_CHARGE` - Create a payment charge using Coinbase Commerce
- `GET_ALL_CHARGES` - Fetch all payment charges
- `GET_CHARGE_DETAILS` - Retrieve details for a specific charge

**Description:**
This plugin enables Eliza to interact with the Coinbase Commerce API to create and manage payment charges, providing seamless integration with cryptocurrency-based payment systems.

---

### Writing Custom Plugins

Create a new plugin by implementing the Plugin interface:
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/defaultCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const defaultCharacter: Character = {
username: "eliza",
plugins: [],
clients: [],
modelProvider: ModelProviderName.OPENAI,
modelProvider: ModelProviderName.OLLAMA,
settings: {
secrets: {},
voice: {
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ export const generateObjectV2 = async ({

const provider = runtime.modelProvider;
const model = models[provider].model[modelClass];
if (!model) {
throw new Error(`Unsupported model class: ${modelClass}`);
}
const temperature = models[provider].settings.temperature;
const frequency_penalty = models[provider].settings.frequency_penalty;
const presence_penalty = models[provider].settings.presence_penalty;
Expand All @@ -952,7 +955,7 @@ export const generateObjectV2 = async ({
const apiKey = runtime.token;

try {
context = await trimTokens(context, max_context_length, modelClass);
context = await trimTokens(context, max_context_length, "gpt-4o");

const modelOptions: ModelSettings = {
prompt: context,
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-coinbase/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*

!dist/**
!package.json
!readme.md
!tsup.config.ts
Loading

0 comments on commit 527f649

Please sign in to comment.