|
| 1 | +# @elizaos/plugin-beatsfoundation |
| 2 | + |
| 3 | +A plugin for Eliza that enables AI music generation using the Beats Foundation API. |
| 4 | + |
| 5 | +## Features |
| 6 | +- AI-powered music generation from text prompts |
| 7 | +- Support for multiple genres and moods |
| 8 | +- Optional lyrics input |
| 9 | +- Instrumental track generation |
| 10 | +- Natural language processing for music generation requests |
| 11 | +- Access to the Beats Foundation song library |
| 12 | + |
| 13 | +## Installation |
| 14 | +```bash |
| 15 | +npm install @elizaos/plugin-beatsfoundation |
| 16 | +``` |
| 17 | + |
| 18 | +## Configuration |
| 19 | +1. Get your API key from [Beats Foundation](https://www.beatsfoundation.com) |
| 20 | +2. Set up your environment variables: |
| 21 | +```bash |
| 22 | +BEATS_FOUNDATION_API_KEY=your_api_key |
| 23 | +``` |
| 24 | +3. Register the plugin in your Eliza configuration: |
| 25 | +```typescript |
| 26 | +import { BeatsFoundationPlugin } from "@elizaos/plugin-beatsfoundation"; |
| 27 | +// In your Eliza configuration |
| 28 | +plugins: [ |
| 29 | + new BeatsFoundationPlugin(), |
| 30 | + // ... other plugins |
| 31 | +]; |
| 32 | +``` |
| 33 | + |
| 34 | +## Usage |
| 35 | +The plugin responds to natural language queries for music generation. Here are some examples: |
| 36 | +```plaintext |
| 37 | +"Generate a happy pop song about summer" |
| 38 | +"Create an instrumental jazz track" |
| 39 | +"Make me a rock song with these lyrics: [lyrics]" |
| 40 | +"List recent AI-generated songs" |
| 41 | +``` |
| 42 | + |
| 43 | +### Supported Parameters |
| 44 | +The plugin supports various music generation parameters including: |
| 45 | +- Genre (pop, rock, jazz, etc.) |
| 46 | +- Mood (happy, sad, energetic, etc.) |
| 47 | +- Lyrics (optional) |
| 48 | +- Instrumental toggle (boolean, will generate instrumental track or with vocals) |
| 49 | +- Custom prompts (up to 200 characters) |
| 50 | + |
| 51 | +### Available Actions |
| 52 | +#### GENERATE_SONG |
| 53 | +Generates a new AI song based on provided parameters. |
| 54 | +```typescript |
| 55 | +// Example response format |
| 56 | +{ |
| 57 | + id: "song_123", |
| 58 | + title: "Summer Vibes", |
| 59 | + audio_url: "https://...", |
| 60 | + streams: 0, |
| 61 | + upvote_count: 0, |
| 62 | + song_url: "https://...", |
| 63 | + username: "user123" |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +#### LIST_SONGS |
| 68 | +Retrieves a paginated list of generated songs. |
| 69 | + |
| 70 | +## API Reference |
| 71 | +For detailed API documentation, visit [docs.beatsfoundation.com](https://docs.beatsfoundation.com) |
| 72 | + |
| 73 | +### Environment Variables |
| 74 | +| Variable | Description | Required | |
| 75 | +| -------- | ----------- | -------- | |
| 76 | +| BEATS_FOUNDATION_API_KEY | Your Beats Foundation API key | Yes | |
| 77 | + |
| 78 | +### Types |
| 79 | +```typescript |
| 80 | +interface GenerateSongRequest { |
| 81 | + prompt: string; |
| 82 | + lyrics?: string; |
| 83 | + genre?: string; |
| 84 | + mood?: string; |
| 85 | + isInstrumental?: boolean; |
| 86 | +} |
| 87 | + |
| 88 | +interface Song { |
| 89 | + id: string; |
| 90 | + title: string; |
| 91 | + audio_url: string; |
| 92 | + streams: number; |
| 93 | + upvote_count: number; |
| 94 | + song_url: string; |
| 95 | + username: string; |
| 96 | +} |
| 97 | +``` |
| 98 | + |
| 99 | +## Error Handling |
| 100 | +The plugin includes comprehensive error handling for: |
| 101 | +- Invalid API keys |
| 102 | +- Rate limiting (2 generations per hour) |
| 103 | +- Network timeouts |
| 104 | +- Invalid generation parameters |
| 105 | +- Server errors |
| 106 | + |
| 107 | +## Rate Limits |
| 108 | +The Beats Foundation API is currently free to use and has a rate limit of 2 song generations per hour per API key. Public endpoints like song listing and retrieval are not rate limited. |
| 109 | + |
| 110 | +## Support |
| 111 | +For support, please: |
| 112 | +- Visit [docs.beatsfoundation.com](https://docs.beatsfoundation.com) |
| 113 | +- Open an issue in the repository |
| 114 | +- Join our Discord community |
| 115 | + |
| 116 | +## Links |
| 117 | +- [Beats Foundation API Documentation](https://docs.beatsfoundation.com) |
| 118 | +- [GitHub Repository](https://github.com/elizaos/eliza/tree/main/packages/plugin-beatsfoundation) |
0 commit comments