Skip to content

Commit

Permalink
Merge branch 'develop' into fixImageGen
Browse files Browse the repository at this point in the history
  • Loading branch information
proteanx authored Dec 23, 2024
2 parents ba0b324 + c823cac commit b5c810b
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 39 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
name: integration-test
name: Integration Tests
on:
push:
branches:
- "*"
pull_request:
pull_request_target:
branches:
- "*"
jobs:
smoke-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9.4.0

- uses: actions/setup-node@v4
with:
node-version: "23"
cache: "pnpm"

- name: Run smoke tests
run: pnpm run smokeTests
jobs:
integration-tests:
runs-on: ubuntu-latest
env:
Expand All @@ -46,20 +31,11 @@ jobs:
run: pnpm build

- name: Check for API key
id: check_api_key
run: |
if [ -z "$OPENAI_API_KEY" ]; then
echo "::set-output name=api_key_present::false"
else
echo "::set-output name=api_key_present::true"
echo "Error: OPENAI_API_KEY is not set."
exit 1
fi
- name: Run integration tests
if: steps.check_api_key.outputs.api_key_present == 'true'
run: pnpm run integrationTests

- name: Skip integration tests
if: steps.check_api_key.outputs.api_key_present == 'false'
run: |
echo "Skipping integration tests due to missing required API keys"
exit 1
26 changes: 26 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: smoke-test
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
smoke-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
with:
version: 9.4.0

- uses: actions/setup-node@v4
with:
node-version: "23"
cache: "pnpm"

- name: Run smoke tests
run: pnpm run smokeTests
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ cd eliza-starter
cp .env.example .env
pnpm i && pnpm build && pnpm start
```
Once the agent is running, You should see the message to run "pnpm start:client" at the end.
Open another terminal and move to same directory and then run below command and follow the URL to chat to your agent.
```bash
pnpm start:client
```

Then read the [Documentation](https://elizaos.github.io/eliza/) to learn how to customize your Eliza.

Expand Down
12 changes: 9 additions & 3 deletions docs/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,15 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact

1. **Node.js Version**

- Ensure Node.js 23.3.0 is installed
- Use `node -v` to check version
- Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions
- Ensure Node.js 23.3.0 is installed
- Use `node -v` to check version
- Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions

NOTE: pnpm may be bundled with a different node version, ignoring nvm. If this is the case, you can use
```bash
pnpm env use --global 23.3.0
```
to force it to use the correct one.

2. **Sharp Installation**
If you see Sharp-related errors:
Expand Down
126 changes: 119 additions & 7 deletions packages/plugin-0g/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,125 @@
A plugin for storing data using the 0G protocol within the ElizaOS ecosystem.

## Description

The 0G plugin enables seamless integration with the Zero Gravity (0G) protocol for decentralized file storage. It provides functionality to upload files to the 0G network.

## Future work
## Installation

```bash
pnpm install @elizaos/plugin-0g
```

## Configuration

The plugin requires the following environment variables to be set:
```typescript
ZEROG_INDEXER_RPC=<0G indexer RPC endpoint>
ZEROG_EVM_RPC=<0G EVM RPC endpoint>
ZEROG_PRIVATE_KEY=<Private key for transactions>
ZEROG_FLOW_ADDRESS=<0G Flow contract address>
```

## Usage

### Basic Integration

```typescript
import { zgPlugin } from '@ai16z/plugin-0g';
```


### File Upload Example

```typescript
// The plugin automatically handles file uploads when triggered
// through natural language commands like:

"Upload my document.pdf"
"Store this image.png on 0G"
"Save my resume.docx to Zero Gravity"
```


## API Reference

### Actions

#### ZG_UPLOAD

Uploads files to the 0G network.

**Aliases:**
- UPLOAD_FILE_TO_ZG
- STORE_FILE_ON_ZG
- SAVE_FILE_TO_ZG
- UPLOAD_TO_ZERO_GRAVITY
- STORE_ON_ZERO_GRAVITY
- SHARE_FILE_ON_ZG
- PUBLISH_FILE_TO_ZG

**Input Content:**
```typescript
interface UploadContent {
filePath: string;
}
```


## Common Issues & Troubleshooting

1. **File Access Errors**
- Ensure the file exists at the specified path
- Check file permissions
- Verify the path is absolute or relative to the execution context

2. **Configuration Issues**
- Verify all required environment variables are set
- Ensure RPC endpoints are accessible
- Confirm private key has sufficient permissions

## Security Best Practices

1. **Environment Variables**
- Never commit private keys to version control
- Use secure environment variable management
- Rotate private keys periodically


## Development Guide

### Setting Up Development Environment

1. Clone the repository
2. Install dependencies:

```bash
pnpm install
```

3. Build the plugin:

```bash
pnpm run build
```

4. Run the plugin:

```bash
pnpm run dev
```

## Future Enhancements

- Model service deployment on 0G serving network
- 0G KV store for plugin state persistence
- Upload history and file metadata storage
- 0G as a database option for Eliza state storage
- Enhanced file path and context extraction

## Contributing

Contributions are welcome! Please see our contributing guidelines for more details.

## License

- Enable model service deployment on 0G serving network.
- Implement 0G KV store for plugin state persistence .
- Store upload history and file metadata.
- Provide 0G as a db option for Eliza to store its memory/state.
- Enhance file path and context extraction.
[License information needed]

0 comments on commit b5c810b

Please sign in to comment.