|
| 1 | +@elizaos/plugin-suno |
| 2 | + |
| 3 | +A Suno AI music generation plugin for ElizaOS that enables AI-powered music creation and audio manipulation. |
| 4 | + |
| 5 | +OVERVIEW |
| 6 | + |
| 7 | +The Suno plugin integrates Suno AI's powerful music generation capabilities into ElizaOS, providing a seamless way to: |
| 8 | +- Generate music from text prompts |
| 9 | +- Create custom music with fine-tuned parameters |
| 10 | +- Extend existing audio tracks |
| 11 | + |
| 12 | +Original Plugin: https://github.com/gcui-art/suno-api?tab=readme-ov-file |
| 13 | + |
| 14 | +INSTALLATION |
| 15 | + |
| 16 | + npm install @elizaos/plugin-suno |
| 17 | + |
| 18 | +QUICK START |
| 19 | + |
| 20 | +1. Register the plugin with ElizaOS: |
| 21 | + |
| 22 | + import { sunoPlugin } from '@elizaos/plugin-suno'; |
| 23 | + import { Eliza } from '@elizaos/eliza'; |
| 24 | + |
| 25 | + const eliza = new Eliza(); |
| 26 | + eliza.registerPlugin(sunoPlugin); |
| 27 | + |
| 28 | +2. Configure the Suno provider with your API credentials: |
| 29 | + |
| 30 | + import { sunoProvider } from '@elizaos/plugin-suno'; |
| 31 | + |
| 32 | + sunoProvider.configure({ |
| 33 | + apiKey: 'your-suno-api-key' |
| 34 | + }); |
| 35 | + |
| 36 | +FEATURES |
| 37 | + |
| 38 | +1. Generate Music |
| 39 | + Generate music using predefined settings and a text prompt: |
| 40 | + |
| 41 | + await eliza.execute('suno.generate', { |
| 42 | + prompt: "An upbeat electronic dance track with energetic beats" |
| 43 | + }); |
| 44 | + |
| 45 | +2. Custom Music Generation |
| 46 | + Create music with detailed control over generation parameters: |
| 47 | + |
| 48 | + await eliza.execute('suno.customGenerate', { |
| 49 | + prompt: "A melodic piano piece with soft strings", |
| 50 | + temperature: 0.8, |
| 51 | + duration: 30 |
| 52 | + }); |
| 53 | + |
| 54 | +3. Extend Audio |
| 55 | + Extend existing audio tracks to create longer compositions: |
| 56 | + |
| 57 | + await eliza.execute('suno.extend', { |
| 58 | + audioFile: "path/to/audio.mp3", |
| 59 | + duration: 60 |
| 60 | + }); |
| 61 | + |
| 62 | +API REFERENCE |
| 63 | + |
| 64 | +SunoProvider Configuration |
| 65 | +The Suno provider accepts the following configuration options: |
| 66 | + |
| 67 | + interface SunoConfig { |
| 68 | + apiKey: string; |
| 69 | + } |
| 70 | + |
| 71 | +Action Parameters: |
| 72 | + |
| 73 | +1. Generate Music |
| 74 | + interface GenerateMusicParams { |
| 75 | + prompt: string; |
| 76 | + } |
| 77 | + |
| 78 | +2. Custom Generate Music |
| 79 | + interface CustomGenerateMusicParams { |
| 80 | + prompt: string; |
| 81 | + temperature?: number; |
| 82 | + duration?: number; |
| 83 | + } |
| 84 | + |
| 85 | +3. Extend Audio |
| 86 | + interface ExtendAudioParams { |
| 87 | + audioFile: string; |
| 88 | + duration: number; |
| 89 | + } |
| 90 | + |
| 91 | +ERROR HANDLING |
| 92 | + |
| 93 | +The plugin includes built-in error handling for common scenarios: |
| 94 | + |
| 95 | + try { |
| 96 | + await eliza.execute('suno.generate', params); |
| 97 | + } catch (error) { |
| 98 | + if (error.code === 'SUNO_API_ERROR') { |
| 99 | + // Handle API-specific errors |
| 100 | + } |
| 101 | + // Handle other errors |
| 102 | + } |
| 103 | + |
| 104 | +EXAMPLES |
| 105 | + |
| 106 | +Creating a Complete Song: |
| 107 | + |
| 108 | + const result = await eliza.execute('suno.generate', { |
| 109 | + prompt: "Create a pop song with vocals, drums, and guitar", |
| 110 | + duration: 180 // 3 minutes |
| 111 | + }); |
| 112 | + |
| 113 | + console.log(`Generated music file: ${result.outputPath}`); |
| 114 | + |
| 115 | +Extending an Existing Track: |
| 116 | + |
| 117 | + const extended = await eliza.execute('suno.extend', { |
| 118 | + audioFile: "original-track.mp3", |
| 119 | + duration: 60 // Add 60 seconds |
| 120 | + }); |
| 121 | + |
| 122 | + console.log(`Extended audio file: ${extended.outputPath}`); |
| 123 | + |
| 124 | + |
| 125 | +LICENSE |
| 126 | + |
| 127 | +MIT |
| 128 | + |
| 129 | +SUPPORT |
| 130 | + |
| 131 | +For issues and feature requests, please open an issue on our GitHub repository. |
| 132 | + |
| 133 | +--- |
| 134 | +Built with ❤️ for ElizaOS |
0 commit comments