com.justai.jaicf.activator.caila.CailaIntentActivatorContext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of caila Show documentation
Show all versions of caila Show documentation
JAICF-Kotlin Caila NLU Activator Adapter. Provides intent recognition and named entity extraction.
package com.justai.jaicf.activator.caila
import com.justai.jaicf.activator.caila.dto.CailaAnalyzeResponseData
import com.justai.jaicf.activator.caila.dto.CailaInferenceResultData
import com.justai.jaicf.activator.intent.IntentActivatorContext
import com.justai.jaicf.context.ActivatorContext
data class CailaIntentActivatorContext(
val result: CailaAnalyzeResponseData,
val intentData: CailaInferenceResultData
) : IntentActivatorContext(
intent = intentData.intent.name,
confidence = intentData.confidence.toFloat()
), java.io.Serializable {
val topIntent = intentData.intent
var slots = intentData.slots?.map { it.name to it.value }?.toMap() ?: emptyMap()
val entities get() = result.entitiesLookup.entities
companion object {
private const val serialVersionUID = 4934755046273038374L
}
}
val ActivatorContext.caila
get() = this as? CailaIntentActivatorContext
© 2015 - 2025 Weber Informatics LLC | Privacy Policy