feat: merge reply emotions while preserving configurable Qwen/Doubao provider
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
import com.gorios.lanvoice.net.DialogueProtocol
|
||||
|
||||
fun main() {
|
||||
val states = listOf("neutral" to 0) + listOf("happy", "angry", "sad").flatMap { kind -> listOf(kind to 1, kind to 2) }
|
||||
states.forEach { (kind, strength) ->
|
||||
val parsed = checkNotNull(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(7L, 10L, kind, strength, "model"))
|
||||
check(parsed.emotion.wire == kind && parsed.intensity == strength && parsed.turnId == 7L)
|
||||
}
|
||||
listOf("other" to 1, "neutral" to 2, "happy" to 0, "sad" to 3).forEach { (kind, strength) ->
|
||||
val parsed = checkNotNull(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(7L, 10L, kind, strength, "model"))
|
||||
check(parsed.label == "中立" && parsed.source == com.gorios.lanvoice.dialogue.EmotionSource.FALLBACK)
|
||||
}
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(null, 1, "happy", 2, "model") == null)
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", true, "model")?.label == "中立")
|
||||
check(com.gorios.lanvoice.dialogue.ReplyEmotion.fromWire(1, 1, "happy", 2.0, "model")?.label == "中立")
|
||||
|
||||
val pcm = ByteArray(640) { (it % 256).toByte() }
|
||||
val uplink = DialogueProtocol.uplink(pcm, 0x81234567L, 0xffffffffL)
|
||||
val golden = byteArrayOf(0x4c, 0x56, 0x01, 0x01, 0x81.toByte(), 0x23, 0x45, 0x67,
|
||||
|
||||
Reference in New Issue
Block a user