From 511f1cd5740eabbdefff225510e1045cc83ebd2a Mon Sep 17 00:00:00 2001 From: ayaangazali Date: Mon, 17 Aug 2026 11:10:06 -0700 Subject: [PATCH] fix(kotlin): stop deprecations pointing at deprecated replacements Six @Deprecated messages on the legacy extension surface name a namespace method that is itself deprecated, so following the migration advice lands the caller on a second deprecation: unloadModel -> models.unload(category) @Deprecated -> unloadAll(category) stopSynthesis -> tts.stop() @Deprecated -> SpeechHandle stopSpeaking -> tts.stop() @Deprecated -> SpeechHandle streamVAD -> vad.detectStream(audio, options) @Deprecated -> openStream(format, options) resetVAD -> vad.detectStream @Deprecated -> openStream(format, options) transcribeStream -> stt.transcribeStream(audio, ...) @Deprecated -> openStream(format, options) Each now names the replacement the namespace's own annotation points at, so one hop reaches a supported API: models.unloadAll(category) interrupt() on the SpeechHandle returned by tts.speak() vad.openStream(format, options) / close() on the VadStream it returns stt.openStream(format, options) Messages only. No signatures, bodies, or annotations targets change. --- .../sdk/public/extensions/Models/RunAnywhereModelLifecycle.kt | 2 +- .../runanywhere/sdk/public/extensions/STT/RunAnywhereSTT.kt | 2 +- .../runanywhere/sdk/public/extensions/TTS/RunAnywhereTTS.kt | 4 ++-- .../runanywhere/sdk/public/extensions/VAD/RunAnywhereVAD.kt | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/Models/RunAnywhereModelLifecycle.kt b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/Models/RunAnywhereModelLifecycle.kt index fb4c5afff..1a968586e 100644 --- a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/Models/RunAnywhereModelLifecycle.kt +++ b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/Models/RunAnywhereModelLifecycle.kt @@ -97,7 +97,7 @@ suspend fun RunAnywhere.loadModel(model: RAModelInfo): RAModelLoadResult = ), ) -@Deprecated("Use RunAnywhere.models.unload(category).") +@Deprecated("Use RunAnywhere.models.unloadAll(category).") suspend fun RunAnywhere.unloadModel(request: ModelUnloadRequest): ModelUnloadResult { if (!isInitialized) { return ModelUnloadResult( diff --git a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/STT/RunAnywhereSTT.kt b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/STT/RunAnywhereSTT.kt index c56c3eb99..5ae3de3c3 100644 --- a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/STT/RunAnywhereSTT.kt +++ b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/STT/RunAnywhereSTT.kt @@ -85,7 +85,7 @@ suspend fun RunAnywhere.transcribe( return result } -@Deprecated("Use RunAnywhere.stt.transcribeStream(audio, options).") +@Deprecated("Use RunAnywhere.stt.openStream(format, options).") fun RunAnywhere.transcribeStream( audio: Flow, options: RASTTOptions = RASTTOptions.defaults(), diff --git a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/TTS/RunAnywhereTTS.kt b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/TTS/RunAnywhereTTS.kt index 5ca27b786..5aedc6423 100644 --- a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/TTS/RunAnywhereTTS.kt +++ b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/TTS/RunAnywhereTTS.kt @@ -177,7 +177,7 @@ fun RunAnywhere.synthesizeStream( } } -@Deprecated("Use RunAnywhere.tts.stop().") +@Deprecated("Use interrupt() on the SpeechHandle returned by RunAnywhere.tts.speak().") suspend fun RunAnywhere.stopSynthesis() { CppBridgeTTS.stop() } @@ -241,7 +241,7 @@ private fun convertPcmToWav(pcmData: ByteArray, sampleRate: Int): ByteArray { ?: throw SDKException.tts("Failed to convert PCM to WAV") } -@Deprecated("Use RunAnywhere.tts.stop().") +@Deprecated("Use interrupt() on the SpeechHandle returned by RunAnywhere.tts.speak().") suspend fun RunAnywhere.stopSpeaking() { ttsAudioPlayback.stop() stopSynthesis() diff --git a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/VAD/RunAnywhereVAD.kt b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/VAD/RunAnywhereVAD.kt index 41873f20f..81cd0f74f 100644 --- a/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/VAD/RunAnywhereVAD.kt +++ b/bindings/kotlin/src/main/kotlin/com/runanywhere/sdk/public/extensions/VAD/RunAnywhereVAD.kt @@ -93,7 +93,7 @@ suspend fun RunAnywhere.detectVoiceActivity( * `error_code`) and the flow finishes so callers do not silently keep * pumping audio into a dead detector. */ -@Deprecated("Use RunAnywhere.vad.detectStream(audio, options).") +@Deprecated("Use RunAnywhere.vad.openStream(format, options).") fun RunAnywhere.streamVAD( audio: Flow, options: RAVADOptions? = null, @@ -115,7 +115,7 @@ fun RunAnywhere.streamVAD( ) } -@Deprecated("Cancel the Flow returned by RunAnywhere.vad.detectStream instead.") +@Deprecated("Close the VadStream returned by RunAnywhere.vad.openStream instead.") suspend fun RunAnywhere.resetVAD() { if (!isInitialized) { throw notInitializedException()