Skip to content

Commit

Permalink
fix: convert tts param to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamakuprina committed Jan 25, 2024
1 parent d611305 commit fd56eda
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class TelephonyReactions(private val bargeInDefaultProps: BargeInProperties) : J
*
* @param text to synthesis speech from
* @param bargeIn true to allow interruption and handle in in current dialog context
* @param tts true to allow SSML parsing of text
* @param tts SSML text for telephony channel
* */
fun say(text: String, bargeIn: Boolean, tts: Boolean = false) = when (bargeIn) {
fun say(text: String, bargeIn: Boolean, tts: String? = null) = when (bargeIn) {
true -> say(text, CURRENT_CONTEXT_PATH, tts)
false -> if (tts) {
replies.add(TextReply(text, state = currentState, tts = text))
false -> if (tts != null) {
replies.add(TextReply(text, state = currentState, tts = tts))
SayReaction.create(text)
} else say(text)
}
Expand All @@ -54,16 +54,16 @@ class TelephonyReactions(private val bargeInDefaultProps: BargeInProperties) : J
*
* @param text to synthesis speech from speech from
* @param bargeInContext scenario context with states which should handle possible interruptions.
* @param tts true to allow SSML parsing of text
* @param tts SSML text for telephony channel
* */
fun say(text: String, @PathValue bargeInContext: String, tts: Boolean): SayReaction {
fun say(text: String, @PathValue bargeInContext: String, tts: String? = null): SayReaction {
ensureBargeInProps()
replies.add(
TextReply(
text,
state = currentState,
bargeInReply = BargeInReplyData(bargeInContext, BargeInType.INTENT),
tts = if (tts) text else null
tts = tts
)
)
return SayReaction.create(text)
Expand Down

0 comments on commit fd56eda

Please sign in to comment.