{
  "skill_name": "speech-recognition",
  "evals": [
    {
      "id": 0,
      "name": "speechanalyzer-live-transcription",
      "prompt": "Build live captions for an iOS 26 lecture-recording app with SpeechAnalyzer. Captions should appear while the lecturer speaks and later highlight words during playback. A draft we found uses SpeechTranscriber(locale:preset: .offlineTranscription) and simply finishes the input stream when recording stops. Correct it and outline the full flow.",
      "expected_output": "Replaces the nonexistent .offlineTranscription with a documented preset such as .timeIndexedProgressiveTranscription, checks SpeechTranscriber.isAvailable and supportedLocale(equivalentTo:), installs assets through AssetInventory.assetInstallationRequest(supporting:), converts microphone buffers to SpeechAnalyzer.bestAvailableAudioFormat(compatibleWith:), keeps volatile and final text apart, and ends the session explicitly with a finalize or cancel call rather than relying on the input stream closing.",
      "assertions": [
        "Uses a documented preset such as .timeIndexedProgressiveTranscription and rejects .offlineTranscription",
        "Checks SpeechTranscriber.isAvailable and supportedLocale(equivalentTo:)",
        "Installs assets with AssetInventory.assetInstallationRequest(supporting:)",
        "Converts live buffers to bestAvailableAudioFormat(compatibleWith:)",
        "Replaces volatile results with final ones instead of duplicating text",
        "Ends the analyzer explicitly with finalizeAndFinish, finalizeAndFinishThroughEndOfInput or cancelAndFinishNow"
      ]
    },
    {
      "id": 1,
      "name": "sfspeechrecognizer-live-review",
      "prompt": "Review our SFSpeechRecognizer voice-notes feature for an app that still supports iOS 16. We only add NSSpeechRecognitionUsageDescription, request speech permission after starting the audio engine, set requiresOnDeviceRecognition = true everywhere, and just call task.cancel() when the user taps Stop. Notes can run for several minutes.",
      "expected_output": "Adds NSMicrophoneUsageDescription next to the speech key, requests both speech and microphone permission before activating the session and starting the engine, adopts SFSpeechRecognizerDelegate for availability changes, checks supportsOnDeviceRecognition before forcing on-device with a fallback or message, plans for the per-task duration limit by rolling over or chunking, and cleans up completely: stop the engine, remove the tap, call endAudio() and cancel the task.",
      "assertions": [
        "Requires both NSSpeechRecognitionUsageDescription and NSMicrophoneUsageDescription",
        "Requests speech and microphone permission before the session and engine start",
        "Handles availability changes through the recognizer delegate",
        "Checks supportsOnDeviceRecognition before setting requiresOnDeviceRecognition, with a fallback",
        "Accounts for the task duration limit on multi-minute notes",
        "Stops the engine, removes the tap, calls endAudio() and cancels the task"
      ]
    },
    {
      "id": 2,
      "name": "speech-boundary-routing",
      "prompt": "Our meeting app records audio, shows a live transcript, detects which language each speaker used, rates the mood of the meeting, translates the transcript, plays recordings back with captions, and writes an AI summary. Which pieces does the speech skill own?",
      "expected_output": "Keeps audio capture, speech and microphone permission, transcription and result handling in the speech skill. Sends language detection, mood or sentiment, embeddings and translation of the transcript to natural-language, playback with captions and AVPlayer to avkit, and Apple Intelligence or Foundation Models summaries to apple-on-device-ai. Does not blur NaturalLanguage and Speech together.",
      "assertions": [
        "Keeps capture, authorization, transcription and result handling in this skill",
        "Sends language detection, sentiment, embeddings and translation to natural-language",
        "Sends playback, captions and AVPlayer work to avkit",
        "Sends generated summaries to apple-on-device-ai",
        "Keeps the NaturalLanguage and Speech frameworks distinct"
      ]
    }
  ]
}
