forked from home-assistant/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Assist pipeline, update Wear implementation (home-ass…
…istant#3526) * Group incoming messages by subscription to prevent out-of-order delivery - Messages received on the websocket are processed asynchronously, which is usually fine but can cause issues if messages need to be received in a specific order for a subscription. To fix this, process messages in order for the same subscription. * Implement Assist pipeline API - Add basic support for the Assist pipeline API - Update conversation function to use the Assist pipeline when on the minimum required version - Update UI to refer to Assist pipeline requirement
- Loading branch information
Showing
9 changed files
with
161 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...omeassistant/companion/android/common/data/websocket/impl/entities/AssistPipelineEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.homeassistant.companion.android.common.data.websocket.impl.entities | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties | ||
|
||
data class AssistPipelineEvent( | ||
val type: String, | ||
val data: AssistPipelineEventData? | ||
) | ||
|
||
object AssistPipelineEventType { | ||
const val RUN_START = "run-start" | ||
const val RUN_END = "run-end" | ||
const val STT_START = "stt-start" | ||
const val STT_END = "stt-end" | ||
const val INTENT_START = "intent-start" | ||
const val INTENT_END = "intent-end" | ||
const val TTS_START = "tts-start" | ||
const val TTS_END = "tts-end" | ||
const val ERROR = "error" | ||
} | ||
|
||
interface AssistPipelineEventData | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
data class AssistPipelineRunStart( | ||
val pipeline: String, | ||
val language: String, | ||
val runnerData: Map<String, Any?> | ||
) : AssistPipelineEventData | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
data class AssistPipelineIntentStart( | ||
val engine: String, | ||
val language: String, | ||
val intentInput: String | ||
) : AssistPipelineEventData | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
data class AssistPipelineIntentEnd( | ||
val intentOutput: ConversationResponse | ||
) : AssistPipelineEventData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters