Skip to content

Commit

Permalink
Merge pull request #30 from ai16z/main
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
MarcoMandar authored Nov 19, 2024
2 parents c9b50ba + 5fdbee6 commit ee9929c
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 22 deletions.
13 changes: 7 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DISCORD_APPLICATION_ID=
DISCORD_API_TOKEN= # Bot token
OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk-
REDPILL_API_KEY= # REDPILL API Key
GROK_API_KEY= # GROK API Key
GROQ_API_KEY=gsk_*
OPENROUTER_API_KEY=
GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key
Expand Down Expand Up @@ -37,20 +38,20 @@ POST_INTERVAL_MAX= #180 #Default
#USE IMAGE GEN
IMAGE_GEN= #TRUE

#Leave blank to use local embeddings
#Leave blank to use local embeddings
USE_OPENAI_EMBEDDING= #TRUE

#OpenRouter (Use one model for everything or set individual for small, medium, large tasks)
#leave blank to use defaults hermes 70b for small tasks & 405b for medium/large tasks
OPENROUTER_MODEL=
SMALL_OPENROUTER_MODEL=
MEDIUM_OLLAMA_MODEL=
LARGE_OLLAMA_MODEL=
SMALL_OPENROUTER_MODEL=
MEDIUM_OLLAMA_MODEL=
LARGE_OLLAMA_MODEL=


#Set to Use for New OLLAMA provider
#Set to Use for New OLLAMA provider
OLLAMA_SERVER_URL= #Leave blank for default localhost:11434
OLLAMA_MODEL=
OLLAMA_MODEL=
OLLAMA_EMBEDDING_MODEL= #default mxbai-embed-large
#To use custom model types for different tasks set these
SMALL_OLLAMA_MODEL= #default llama3.2
Expand Down
28 changes: 28 additions & 0 deletions docs/docs/core/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ sidebar_position: 6

Actions are core building blocks in Eliza that define how agents respond to and interact with messages. They allow agents to interact with external systems, modify their behavior, and perform tasks beyond simple message responses.

---

## Overview

Each Action consists of:
Expand All @@ -17,6 +19,8 @@ Each Action consists of:
- `handler`: Implementation of the action's behavior
- `examples`: Array of example usage patterns

---

## Implementation

```typescript
Expand All @@ -36,6 +40,8 @@ Source: https://github.com/ai16z/eliza/packages/core/src/types.ts

# Built-in Actions

---

## Conversation Flow

### CONTINUE
Expand All @@ -57,6 +63,8 @@ Source: https://github.com/ai16z/eliza/packages/core/src/types.ts
- Default response action
- Used for standard conversational replies

---

## External Integrations

### TAKE_ORDER
Expand All @@ -81,6 +89,8 @@ const take_order: Action = {

Source: https://github.com/ai16z/eliza/packages/plugin-solana/src/actions/takeOrder.ts

---

## Creating Custom Actions

1. Implement the Action interface
Expand Down Expand Up @@ -123,6 +133,8 @@ test("Validate action behavior", async () => {
});
```

---

## Core Concepts

### Action Structure
Expand Down Expand Up @@ -151,6 +163,8 @@ interface Action {
- **handler**: Implements the action's behavior
- **examples**: Demonstrates proper usage patterns

---

## Built-in Actions

### CONTINUE
Expand Down Expand Up @@ -205,6 +219,8 @@ const followRoomAction: Action = {
};
```

---

## Creating Custom Actions

### Basic Action Template
Expand Down Expand Up @@ -273,6 +289,8 @@ const complexAction: Action = {
};
```

---

## Implementation Patterns

### State-Based Actions
Expand Down Expand Up @@ -310,6 +328,8 @@ const serviceAction: Action = {
};
```

---

## Best Practices

### Action Design
Expand Down Expand Up @@ -368,6 +388,8 @@ examples: [
];
```

---

## Troubleshooting

### Common Issues
Expand Down Expand Up @@ -425,6 +447,8 @@ const chainedAction: Action = {
};
```

---

## Example: Complete Action Implementation

```typescript
Expand Down Expand Up @@ -498,6 +522,8 @@ const documentAnalysisAction: Action = {
};
```

---

# Best Practices

1. **Validation**
Expand All @@ -517,6 +543,8 @@ const documentAnalysisAction: Action = {
- Document expected inputs/outputs
- Explain error scenarios

---

## Further Reading

- [Provider System](./providers.md)
Expand Down
9 changes: 6 additions & 3 deletions docs/docs/core/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Agents are the core components of the Eliza framework that handle autonomous int

## Overview

The [AgentRuntime](/api/classes/AgentRuntime) class is the primary implementation of the [IAgentRuntime](/api/interfaces) interface, which manages the agent's core functions, including:
The [AgentRuntime](/api/classes/AgentRuntime) class is the primary implementation of the [IAgentRuntime](/api/interfaces/IAgentRuntime) interface, which manages the agent's core functions, including:

- **Message and Memory Processing**: Storing, retrieving, and managing conversation data and contextual memory.
- **State Management**: Composing and updating the agent’s state for a coherent, ongoing interaction.
Expand Down Expand Up @@ -90,7 +90,7 @@ const runtime = new AgentRuntime({

## State Management

This section should cover how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces) interface:
This section should cover how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces/state) interface:

```typescript
interface State {
Expand Down Expand Up @@ -148,7 +148,7 @@ The Eliza framework uses multiple types of memory to support an agent's long-ter

- **RAG Integration**: Uses a vector search to perform contextual recall based on similarity matching. This enables the agent to retrieve relevant memory snippets or knowledge based on the content and intent of the current conversation, making its responses more contextually relevant.

The runtime uses multiple specialized [IMemoryManager](/api/interfaces) instances:
The runtime uses multiple specialized [IMemoryManager](/api/interfaces/IMemoryManager) instances:

- `messageManager` - conversation messages and responses
- `descriptionManager` - user descriptions and profiles
Expand Down Expand Up @@ -210,6 +210,8 @@ await memoryManager.createMemory({
- Use immutability in state management.
- Log errors and maintain stability during service failures.

---

## Evaluation System

The runtime's [evaluate](/api/classes/AgentRuntime#evaluate) method processes evaluations:
Expand Down Expand Up @@ -250,6 +252,7 @@ await memoryManager.createMemory({
roomId,
});
```
---

## Further Reading

Expand Down
14 changes: 11 additions & 3 deletions docs/docs/core/characterfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ sidebar_position: 4

Character files are JSON-formatted configurations that define an AI character's personality, knowledge, and behavior patterns. This guide explains how to create effective character files for use with Eliza agents.

---

## Overview

A `characterfile` implements the [Character](/api/type-aliases) type and defines the character's:
A `characterfile` implements the [Character](/api/type-aliases/character) type and defines the character's:

- Core identity and behavior
- Model provider configuration
Expand Down Expand Up @@ -90,11 +92,11 @@ The character's display name for identification and in conversations.

#### `modelProvider` (required)

Specifies the AI model provider. Supported options from [ModelProviderName](/api/enumerations) include `ANTHROPIC`, `LLAMALOCAL`, `OPENAI`, and others.
Specifies the AI model provider. Supported options from [ModelProviderName](/api/enumerations/modelprovidername) include `ANTHROPIC`, `LLAMALOCAL`, `OPENAI`, and others.

#### `clients` (required)

Array of supported client types from [Clients](/api/enumerations) e.g., `DISCORD`, `DIRECT`, `TWITTER`, `TELEGRAM`.
Array of supported client types from [Clients](/api/enumerations/clients) e.g., `DISCORD`, `DIRECT`, `TWITTER`, `TELEGRAM`.

#### `bio`

Expand Down Expand Up @@ -205,6 +207,8 @@ The `settings` object defines additional configurations like secrets and voice m
}
```

---

## Example: Complete Character File

```json
Expand Down Expand Up @@ -290,6 +294,8 @@ npx knowledge2character <character-file> <knowledge-file>
- Show character-specific responses
- Demonstrate typical interaction patterns

---

## Tips for Quality

1. **Bio and Lore**
Expand All @@ -316,6 +322,8 @@ npx knowledge2character <character-file> <knowledge-file>
- Organize in digestible chunks
- Update regularly to maintain relevance

---

## Further Reading

- [Agents Documentation](./agents.md)
Expand Down
19 changes: 11 additions & 8 deletions docs/docs/core/evaluators.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ sidebar_position: 5

# 📊 Evaluators

## Table of Contents
[Evaluators](/api/interfaces/evaluator) are core components that assess and extract information from conversations. They integrate with the [AgentRuntime](/api/classes/AgentRuntime)'s evaluation system.

- [Overview](#overview)
- [Quick Start](#quick-start)
- [Best Practices](#best-practices)
- [Built-in Evaluators](#built-in-evaluators)
- [Creating Custom Evaluators](#creating-custom-evaluators)
- [Memory Integration](#memory-integration)
---

## Overview

[Evaluators](/api/interfaces) are core components that assess and extract information from conversations. They integrate with the [AgentRuntime](/api/classes/AgentRuntime)'s evaluation system, enabling agents to:
Evaluators enable agents to:

- Build long-term memory
- Track goal progress
- Extract facts and insights
- Maintain contextual awareness

---

## Quick Start

1. Import the necessary evaluator types:
Expand All @@ -46,6 +43,8 @@ const evaluator: Evaluator = {
};
```

---

## Built-in Evaluators

### Fact Evaluator
Expand Down Expand Up @@ -205,6 +204,8 @@ const memoryEvaluator: Evaluator = {
};
```

---

## Integration with Agent Runtime

The [AgentRuntime](/api/classes/AgentRuntime) processes evaluators through its [evaluate](/api/classes/AgentRuntime#evaluate) method:
Expand All @@ -217,6 +218,8 @@ runtime.registerEvaluator(customEvaluator);
const results = await runtime.evaluate(message, state);
```

---

## Error Handling

```typescript
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/core/providers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 🔌 Providers

[Providers](/api/interfaces) are core modules that inject dynamic context and real-time information into agent interactions. They serve as a bridge between the agent and various external systems, enabling access to market data, wallet information, sentiment analysis, and temporal context.
[Providers](/api/interfaces/provider) are core modules that inject dynamic context and real-time information into agent interactions. They serve as a bridge between the agent and various external systems, enabling access to market data, wallet information, sentiment analysis, and temporal context.

---

## Overview

Expand Down
1 change: 1 addition & 0 deletions docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Before getting started with Eliza, ensure you have:
DISCORD_API_TOKEN= # Bot token
HEURIST_API_KEY= # Heurist API key for LLM and image generation
OPENAI_API_KEY= # OpenAI API key
GROK_API_KEY= # Grok API key
ELEVENLABS_XI_API_KEY= # API key from elevenlabs (for voice)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { themes as prismThemes } from "prism-react-renderer";

const config = {
title: "eliza",
tagline: "The flexible, scalable AI agent for everyone",
tagline: "Flexible, scalable AI agents for everyone",
favicon: "img/favicon.ico",
url: "https://ai16z.github.io",
baseUrl: "/eliza/",
Expand Down

0 comments on commit ee9929c

Please sign in to comment.