Skip to content

Commit ec77980

Browse files
committed
Merge branch '0000--feat-letzai-plugin' of https://github.com/Letz-AI/eliza into 0000--feat-letzai-plugin
2 parents c52356e + 7b020c2 commit ec77980

File tree

4 files changed

+166
-10
lines changed

4 files changed

+166
-10
lines changed

.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,7 @@ FUEL_WALLET_PRIVATE_KEY=
373373
# Tokenizer Settings
374374
TOKENIZER_MODEL= # Specify the tokenizer model to be used.
375375
TOKENIZER_TYPE= # Options: tiktoken (for OpenAI models) or auto (AutoTokenizer from Hugging Face for non-OpenAI models). Default: tiktoken.
376+
377+
#LetzAI
378+
LETZAI_API_KEY= # LetzAI API Key
379+
LETZAI_MODELS= # list of Letzai models to add to each prompt, e.g.: "@modelname1, @modelname2"

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@
4343
- 🎮 Video Game NPCs
4444
- 🧠 Trading
4545

46+
## 💰 If you plan to launch a token
47+
48+
This framework is the number one open source project on github, we are enabling the next generation of human-machine interface but we still need your help to ensure the code is of the utmost quality with response rapid to critical issues that will affect our builder community at large.
49+
50+
To ensure sustainable development and continued innovation, we ask contributions of 5-10% of initial token distributions from successful launches.
51+
52+
All contributions are publicly tracked on-chain and used exclusively for ecosystem development.
53+
54+
### ⚠️ Don't forget to tip the big guy 10%: ⚠️
55+
[AM84n1iLdxgVTAyENBcLdjXoyvjentTbu5Q6EpKV1PeG](https://solscan.io/account/AM84n1iLdxgVTAyENBcLdjXoyvjentTbu5Q6EpKV1PeG)
56+
4657
## 🚀 Quick Start
4758

4859
### Prerequisites
@@ -138,6 +149,7 @@ pnpm install --include=optional sharp
138149

139150
- [GitHub Issues](https://github.com/elizaos/eliza/issues). Best for: bugs you encounter using Eliza, and feature proposals.
140151
- [Discord](https://discord.gg/ai16z). Best for: sharing your applications and hanging out with the community.
152+
- [Developer Discord](https://discord.gg/3f67SH4rXT). Best for: getting help and plugin development.
141153

142154
## Contributors
143155

packages/client-github/README.md

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Client-GitHub for Eliza Framework
2+
3+
## Overview
4+
5+
The `client-github` module is a component of the Eliza framework designed to interact with GitHub repositories. It provides functionalities to clone repositories, manage branches, create pull requests, and maintain file-based knowledge for Eliza agents.
6+
7+
This client leverages GitHub's REST API via the `@octokit/rest` library and includes robust error handling and configuration validation.
8+
9+
## Features
10+
11+
- **Repository Management**: Clone, pull, and switch branches
12+
- **File Processing**: Generate agent memories from repository files
13+
- **Pull Request Management**: Create and manage pull requests programmatically
14+
- **Commit Operations**: Stage, commit, and push files with ease
15+
- **Knowledge Base Integration**: Convert repository content into agent memories
16+
- **Branch Management**: Flexible branch switching and creation
17+
18+
## Installation
19+
20+
Install the package as part of the Eliza framework:
21+
bash
22+
pnpm add @elizaos/client-github
23+
24+
## Configuration
25+
26+
The GitHub client requires the following environment variables:
27+
28+
| Variable | Description | Required |
29+
|-------------------|------------------------------------|----------|
30+
| `GITHUB_OWNER` | Owner of the GitHub repository | Yes |
31+
| `GITHUB_REPO` | Repository name | Yes |
32+
| `GITHUB_BRANCH` | Target branch (default: `main`) | Yes |
33+
| `GITHUB_PATH` | Path to focus on within the repo | Yes |
34+
| `GITHUB_API_TOKEN`| GitHub API token for authentication| Yes |
35+
36+
## Usage
37+
38+
### Initialization
39+
typescript:packages/client-github/README.md
40+
import { GitHubClientInterface } from "@elizaos/client-github";
41+
// Initialize the client
42+
const client = await GitHubClientInterface.start(runtime);
43+
44+
### Creating Memories
45+
46+
```typescript
47+
// Convert repository files to agent memories
48+
await client.createMemoriesFromFiles();
49+
50+
typescript
51+
// Convert repository files to agent memories
52+
await client.createMemoriesFromFiles();
53+
```
54+
55+
### Creating Pull Requests
56+
57+
```typescript
58+
await client.createPullRequest(
59+
"Feature: Add new functionality",
60+
"feature/new-feature",
61+
[
62+
{
63+
path: "src/feature.ts",
64+
content: "// New feature implementation"
65+
}
66+
],
67+
"Implements new functionality with tests"
68+
);
69+
70+
71+
typescript
72+
await client.createPullRequest(
73+
"Feature: Add new functionality",
74+
"feature/new-feature",
75+
[
76+
{
77+
path: "src/feature.ts",
78+
content: "// New feature implementation"
79+
}
80+
],
81+
"Implements new functionality with tests"
82+
);
83+
```
84+
85+
### Direct Commits
86+
87+
```typescript
88+
await client.createCommit(
89+
"Update configuration",
90+
[
91+
{
92+
path: "config.json",
93+
content: JSON.stringify(config, null, 2)
94+
}
95+
]
96+
);
97+
98+
99+
```
100+
101+
## API Reference
102+
103+
### GitHubClientInterface
104+
105+
- `start(runtime: IAgentRuntime)`: Initialize the client
106+
- `stop(runtime: IAgentRuntime)`: Clean up resources
107+
108+
### GitHubClient
109+
110+
- `initialize()`: Set up repository and configuration
111+
- `createMemoriesFromFiles()`: Generate agent memories
112+
- `createPullRequest(title: string, branch: string, files: Array<{path: string, content: string}>, description?: string)`: Create PR
113+
- `createCommit(message: string, files: Array<{path: string, content: string}>)`: Direct commit
114+
115+
## Scripts
116+
117+
```bash
118+
# Build the project
119+
pnpm run build
120+
121+
# Development with watch mode
122+
pnpm run dev
123+
124+
# Lint the codebase
125+
pnpm run lint
126+
```
127+
128+
## Dependencies
129+
130+
- `@elizaos/core`: ^0.1.7-alpha.2
131+
- `@octokit/rest`: ^20.1.1
132+
- `@octokit/types`: ^12.6.0
133+
- `glob`: ^10.4.5
134+
- `simple-git`: ^3.27.0
135+
136+
## Development Dependencies
137+
138+
- `@types/glob`: ^8.1.0
139+
- `tsup`: ^8.3.5
140+
141+
## Contribution
142+
143+
Contributions are welcome! Please ensure all code adheres to the framework's standards and passes linting checks.
144+
145+
## License
146+
147+
This project is licensed under the MIT License. See the LICENSE file for details.

tsconfig.json

+3-10
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
},
1010
"files": [],
1111
"references": [
12-
{
13-
"path": "packages/core"
14-
},
15-
{
16-
"path": "packages/client-slack"
17-
},
18-
{
19-
"path": "packages/plugin-letzai"
20-
}
12+
{ "path": "packages/core" },
13+
{ "path": "packages/client-slack" }
2114
]
22-
}
15+
}

0 commit comments

Comments
 (0)