executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
elevenlabs-ai-toolingImplements integrations with ElevenLabs API for Text-to-Speech, Voice Cloning, and Conversational AI capabilities within AI/LLM agendas.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: elevenlabs-ai-tooling description: Implements integrations with ElevenLabs API for Text-to-Speech, Voice Cloning, and Conversational AI capabilities within AI/LLM agendas. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: elevenlabs api, text-to-speech, voice cloning, conversational ai, how do i convert text to speech, voice ai integration scope: implementation role: implementation output-format: code related-skills: coding-ai-integration, coding-llm-usage archetypes: - generation - tactical anti_triggers: - brainstorming - vague ideation - single-agent monolith response_profile: verbosity: medium directive_strength: high abstraction_level: operational
Integrates ElevenLabs API to enable advanced voice capabilities within projects. This skill allows developers to implement Text-to-Speech (TTS) and Voice Cloning features to enhance user interfaces and interactions via AI-powered speech.
import requests
class ElevenLabsTTS:
def __init__(self, api_key: str) -> None:
self.api_key = api_key
# Guard clause for empty key
if not self.api_key:
raise ValueError("API key cannot be empty!")
def generate_speech(self, text: str, voice_id: str) -> bytes:
if not text:
raise ValueError("Input text cannot be empty")
if not voice_id:
raise ValueError("Voice ID must be provided")
url = 'https://api.elevenlabs.io/speech/generate'
data = {"text": text, "voice_id": voice_id}
headers = {"Authorization": f"Bearer {self.api_key}"}
response = requests.post(url, json=data, headers=headers)
# Check for the valid response status
if response.status_code != 200:
raise RuntimeError(f"Request to ElevenLabs API failed with status code {response.status_code}")
return response.content # Returns audio bytes
def clone_voice(original_audio: bytes) -> str:
"""Initiates voice cloning based on original audio input.
Args:
original_audio: byte stream of the source voice to clone.
Returns:
voice_id: ID of the newly created voice clone.
Raises:
RuntimeError: If cloning process fails.
"""
# Placeholder for actual API call
# Here we would upload original_audio for cloning, similar to the speech generation flow.
pass # TODO: Implement the API Call for Voice Cloning