feat(chat): add per-message read-aloud TTS playback (#1305)
This commit is contained in:
14 files changed
+2370
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package com.m57.hermescontrol.data.model
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Request body for `POST /api/audio/speak` — the dashboard's server-side
|
||||
* text-to-speech relay.
|
||||
*/
|
||||
@Serializable
|
||||
data class TtsSpeakRequest(
|
||||
val text: String,
|
||||
)
|
||||
|
||||
/**
|
||||
* Response of `POST /api/audio/speak`.
|
||||
*
|
||||
* Returns base64 encoded [data_url] with [mime_type] and the [provider] used,
|
||||
* or [ok] = false on failure.
|
||||
*/
|
||||
@Serializable
|
||||
data class TtsSpeakResponse(
|
||||
val ok: Boolean = false,
|
||||
val data_url: String? = null,
|
||||
val mime_type: String? = null,
|
||||
val provider: String? = null,
|
||||
)
|
||||
@@ -134,6 +134,8 @@ import com.m57.hermescontrol.data.model.ToolsetPostSetupResponse
|
||||
import com.m57.hermescontrol.data.model.ToolsetProviderSelectRequest
|
||||
import com.m57.hermescontrol.data.model.ToolsetProviderSelectResponse
|
||||
import com.m57.hermescontrol.data.model.ToolsetToggleRequest
|
||||
import com.m57.hermescontrol.data.model.TtsSpeakRequest
|
||||
import com.m57.hermescontrol.data.model.TtsSpeakResponse
|
||||
import com.m57.hermescontrol.data.model.UpdateCheckResponse
|
||||
import com.m57.hermescontrol.data.model.UpdateCronJobRequest
|
||||
import com.m57.hermescontrol.data.model.UpdateProfileDescriptionRequest
|
||||
@@ -1043,4 +1045,10 @@ interface HermesApiService : KanbanApiService {
|
||||
suspend fun transcribeAudio(
|
||||
@Body body: AudioTranscriptionRequest,
|
||||
): Response<AudioTranscriptionResponse>
|
||||
|
||||
@POST("api/audio/speak")
|
||||
suspend fun speakText(
|
||||
@Body request: TtsSpeakRequest,
|
||||
@Query("profile") profile: String? = null,
|
||||
): Response<TtsSpeakResponse>
|
||||
}
|
||||
Reference in new issue
Block a user