All skills
asyrafhussin avatar

/laravel-ai-sdk

@7221662

Laravel AI SDK for building AI-powered features. Use when creating agents, generating images or audio, working with embeddings, vector search, or testing AI features. Triggers on tasks involving laravel/ai, AI agents, tool-calling, structured output, streaming, embeddings, reranking, or AI faking in tests.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/laravel-ai-sdk

This session only. Nothing lands on disk.

rulesmedia-audio-transcription.md

≈670 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Audio Generation and Transcription

Impact: MEDIUM (Text-to-speech and speech-to-text)

Generate audio from text (TTS) and transcribe audio to text (STT). Supports voice selection, instructions, diarization, storage, and queueing.

Bad Example

// Manual TTS API call — no storage, no voice control
$response = Http::withToken(config('services.openai.key'))
    ->post('https://api.openai.com/v1/audio/speech', [
        'model' => 'tts-1',
        'input' => 'Hello world',
        'voice' => 'alloy',
    ]);

file_put_contents(storage_path('audio.mp3'), $response->body());

Good Example

// Text-to-speech
use Laravel\Ai\Audio;

$audio = Audio::of('I love coding with Laravel.')->generate();
$rawContent = (string) $audio;
// Voice selection and instructions
$audio = Audio::of('I love coding with Laravel.')
    ->female()  // or ->male(), ->voice('voice-id')
    ->instructions('Said like a pirate')
    ->generate();
// Store audio
$path = $audio->store();
$path = $audio->storeAs('audio.mp3');
$path = $audio->storePublicly();
// Queue audio generation
use Laravel\Ai\Responses\AudioResponse;

Audio::of('I love coding with Laravel.')
    ->queue()
    ->then(function (AudioResponse $audio) {
        $path = $audio->store();
    });
// Speech-to-text transcription
use Laravel\Ai\Transcription;

$transcript = Transcription::fromPath('/home/laravel/audio.mp3')->generate();
$transcript = Transcription::fromStorage('audio.mp3')->generate();
$transcript = Transcription::fromUpload($request->file('audio'))->generate();

return (string) $transcript;
// Diarization — segment transcript by speaker
$transcript = Transcription::fromStorage('audio.mp3')
    ->diarize()
    ->generate();
// Queue transcription
use Laravel\Ai\Responses\TranscriptionResponse;

Transcription::fromStorage('audio.mp3')
    ->queue()
    ->then(function (TranscriptionResponse $transcript) {
        // Process transcript
    });

Why

  • Fluent API: Voice, instructions, and quality in a single chain
  • Multiple sources: Generate from text, transcribe from path, storage, or upload
  • Diarization: Speaker-segmented transcripts for meetings and interviews
  • Queueable: Offload long audio processing to background workers
  • Provider support: TTS via OpenAI, ElevenLabs. STT via OpenAI, ElevenLabs, Mistral

Reference: Laravel AI SDK — Audio

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk MEDIUM
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive guide for the Laravel AI SDK but contains deceptive metadata claiming authorship by the 'Laravel Community' despite being associated with the user 'asyrafhussin'. It also presents an indirect prompt injection surface by documenting patterns for ingesting untrusted data (such as transcripts and external URLs) while granting agents capabilities like file system storage and network access.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7221662. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
Other metadata
metadata
{
  "author": "Laravel Community",
  "version": "1.0.0",
  "laravelVersion": "13.x",
  "phpVersion": "8.3+"
}

README badge

README badge for asyrafhussin/agent-skills/laravel-ai-sdk