From a5642a9afaa0ef3ca5d1052d8da9be05545e7251 Mon Sep 17 00:00:00 2001 From: Julien Buret Date: Sun, 5 Jan 2025 16:55:19 +0100 Subject: [PATCH] dependencies update --- .../src/main/kotlin/EnvironmentManager.kt | 2 - bot/connector-teams/pom.xml | 2 +- .../model/webhook/message/content/Referral.kt | 2 +- .../main/kotlin/engine/message/Sentence.kt | 25 ++++--- nlp/front/shared/pom.xml | 47 +++++++++++++ .../test/kotlin/FaqSettingsMongoDAOTest.kt | 25 ++++--- nlp/model/opennlp/pom.xml | 2 +- .../src/main/kotlin/OpenNlpModelBuilder.kt | 2 +- nlp/model/sagemaker/pom.xml | 2 +- pom.xml | 69 +++++++++---------- util/gcp-tools/pom.xml | 2 +- 11 files changed, 116 insertions(+), 64 deletions(-) diff --git a/bot/admin/kotlin-compiler/core/src/main/kotlin/EnvironmentManager.kt b/bot/admin/kotlin-compiler/core/src/main/kotlin/EnvironmentManager.kt index 70fd9e1675..cd59e6aa3a 100644 --- a/bot/admin/kotlin-compiler/core/src/main/kotlin/EnvironmentManager.kt +++ b/bot/admin/kotlin-compiler/core/src/main/kotlin/EnvironmentManager.kt @@ -104,8 +104,6 @@ internal object EnvironmentManager { configuration.put(CommonConfigurationKeys.MODULE_NAME, "tockScript") - configuration.put(JSConfigurationKeys.TYPED_ARRAYS_ENABLED, true) - val environment = KotlinCoreEnvironment.createForProduction( disposable, diff --git a/bot/connector-teams/pom.xml b/bot/connector-teams/pom.xml index 9d553e02ee..6d40eb40a3 100644 --- a/bot/connector-teams/pom.xml +++ b/bot/connector-teams/pom.xml @@ -30,7 +30,7 @@ 4.14.3 - 9.41.1 + 9.48 2.11.0 2.5.1 diff --git a/bot/connector-whatsapp-cloud/src/main/kotlin/model/webhook/message/content/Referral.kt b/bot/connector-whatsapp-cloud/src/main/kotlin/model/webhook/message/content/Referral.kt index 06c0a495e6..eefa48dfc5 100644 --- a/bot/connector-whatsapp-cloud/src/main/kotlin/model/webhook/message/content/Referral.kt +++ b/bot/connector-whatsapp-cloud/src/main/kotlin/model/webhook/message/content/Referral.kt @@ -36,7 +36,7 @@ enum class MediaType { IMAGE, VIDEO; companion object { - fun fromString(type: String): MediaType = when (type.toLowerCase()) { + fun fromString(type: String): MediaType = when (type.lowercase()) { "image" -> IMAGE "video" -> VIDEO else -> throw IllegalArgumentException("Unsupported media type: $type") diff --git a/bot/engine/src/main/kotlin/engine/message/Sentence.kt b/bot/engine/src/main/kotlin/engine/message/Sentence.kt index a0d631bd37..354ad57fa7 100644 --- a/bot/engine/src/main/kotlin/engine/message/Sentence.kt +++ b/bot/engine/src/main/kotlin/engine/message/Sentence.kt @@ -36,7 +36,7 @@ data class Sentence( val messages: MutableList = mutableListOf(), val userInterface: UserInterfaceType? = null, override val delay: Long = 0, - @Transient private val nlpStatsProvider: (() -> NlpCallStats?)? = null + @Transient private val nlpStatsProvider: NlpStatsProvider? = null ) : Message { companion object { @@ -44,22 +44,22 @@ data class Sentence( private fun toGenericMessage(message: ConnectorMessage): GenericMessage = ( - try { - message.toGenericMessage() ?: GenericMessage(message) - } catch (t: Throwable) { - logger.error(t) - GenericMessage(message) - } - ).copy(connectorType = message.connectorType, connectorMessage = message) + try { + message.toGenericMessage() ?: GenericMessage(message) + } catch (t: Throwable) { + logger.error(t) + GenericMessage(message) + } + ).copy(connectorType = message.connectorType, connectorMessage = message) } constructor( text: String?, messages: MutableList = mutableListOf(), userInterface: UserInterfaceType? = null, - nlpStatsProvider: (() -> NlpCallStats?)? = null + nlpStatsProvider: NlpStatsProvider? = null ) : - this(text, messages.map { toGenericMessage(it) }.toMutableList(), userInterface, 0, nlpStatsProvider) + this(text, messages.map { toGenericMessage(it) }.toMutableList(), userInterface, 0, nlpStatsProvider) override val eventType: EventType = EventType.sentence @@ -120,3 +120,8 @@ data class Sentence( return result } } + +fun interface NlpStatsProvider { + operator fun invoke(): NlpCallStats? +} + diff --git a/nlp/front/shared/pom.xml b/nlp/front/shared/pom.xml index bb353cb401..ea1ff5d409 100644 --- a/nlp/front/shared/pom.xml +++ b/nlp/front/shared/pom.xml @@ -42,6 +42,53 @@ src/main/kotlin + src/test/kotlin + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin} + + + + kapt + + kapt + + + + + org.litote.jackson + jackson-generator + ${jackson-generator} + + + org.litote.kmongo + kmongo-annotation-processor + ${kmongo} + + + + + + + compile + compile + + compile + + + + + test-compile + test-compile + + test-compile + + + + + diff --git a/nlp/front/storage-mongo/src/test/kotlin/FaqSettingsMongoDAOTest.kt b/nlp/front/storage-mongo/src/test/kotlin/FaqSettingsMongoDAOTest.kt index 806206c2f4..cc2b4c6db2 100644 --- a/nlp/front/storage-mongo/src/test/kotlin/FaqSettingsMongoDAOTest.kt +++ b/nlp/front/storage-mongo/src/test/kotlin/FaqSettingsMongoDAOTest.kt @@ -56,16 +56,17 @@ class FaqSettingsMongoDAOTest : AbstractTest() { @Test fun `Save a FaqSettings`() { faqSettingsDao.save(faqSettings) + val settings = faqSettingsDao.getFaqSettingsByApplicationId(applicationId) assertEquals( - expected = faqSettings, - actual = faqSettingsDao.getFaqSettingsById(faqSettingsId), - message = "There should be something returned with an faqSettingsId" + expected = faqSettings.copy(_id = settings!!._id), + actual = settings, + message = "There should be something returned with an applicationId" ) assertEquals( - expected = faqSettings, - actual = faqSettingsDao.getFaqSettingsByApplicationId(applicationId), - message = "There should be something returned with an applicationId" + expected = faqSettings.copy(_id = settings._id), + actual = faqSettingsDao.getFaqSettingsById(settings._id), + message = "There should be something returned with an faqSettingsId" ) assertEquals(1, col.countDocuments()) } @@ -73,10 +74,11 @@ class FaqSettingsMongoDAOTest : AbstractTest() { @Test fun `Update a FaqSettings`() { faqSettingsDao.save(faqSettings) - val faqSettingsSaved = faqSettingsDao.getFaqSettingsById(faqSettingsId) + val faqSettingsSaved = faqSettingsDao.getFaqSettingsByApplicationId(applicationId) + val faqSettingsId = faqSettingsSaved!!._id - assertEquals(expected = faqSettings.satisfactionEnabled, actual = faqSettingsSaved?.satisfactionEnabled) - assertEquals(expected = faqSettings.satisfactionStoryId, actual = faqSettingsSaved?.satisfactionStoryId) + assertEquals(expected = faqSettings.satisfactionEnabled, actual = faqSettingsSaved.satisfactionEnabled) + assertEquals(expected = faqSettings.satisfactionStoryId, actual = faqSettingsSaved.satisfactionStoryId) val faqSettings2 = faqSettings.copy(satisfactionEnabled = true, satisfactionStoryId = storyId) faqSettingsDao.save(faqSettings2) @@ -91,7 +93,8 @@ class FaqSettingsMongoDAOTest : AbstractTest() { @Test fun `Remove a FaqSettings`() { faqSettingsDao.save(faqSettings) - + val faqSettingsSaved = faqSettingsDao.getFaqSettingsByApplicationId(applicationId) + val faqSettingsId = faqSettingsSaved!!._id faqSettingsDao.deleteFaqSettingsById(faqSettingsId) assertEquals( @@ -106,4 +109,4 @@ class FaqSettingsMongoDAOTest : AbstractTest() { ) assertEquals(0, col.countDocuments()) } -} \ No newline at end of file +} diff --git a/nlp/model/opennlp/pom.xml b/nlp/model/opennlp/pom.xml index 0923b5164a..59b83421b6 100644 --- a/nlp/model/opennlp/pom.xml +++ b/nlp/model/opennlp/pom.xml @@ -29,7 +29,7 @@ OpenNlp implementation of Tock NLP Model - 2.4.0 + 2.5.2 diff --git a/nlp/model/opennlp/src/main/kotlin/OpenNlpModelBuilder.kt b/nlp/model/opennlp/src/main/kotlin/OpenNlpModelBuilder.kt index 2e4a3b4cc5..bb0789225e 100644 --- a/nlp/model/opennlp/src/main/kotlin/OpenNlpModelBuilder.kt +++ b/nlp/model/opennlp/src/main/kotlin/OpenNlpModelBuilder.kt @@ -31,7 +31,6 @@ import ai.tock.shared.loadProperties import mu.KotlinLogging import opennlp.tools.ml.maxent.GISModel import opennlp.tools.ml.maxent.GISTrainer -import opennlp.tools.ml.model.AbstractDataIndexer.CUTOFF_PARAM import opennlp.tools.ml.model.Event import opennlp.tools.ml.model.OnePassRealValueDataIndexer import opennlp.tools.ml.model.TwoPassDataIndexer @@ -42,6 +41,7 @@ import opennlp.tools.namefind.TokenNameFinderFactory import opennlp.tools.util.ObjectStreamUtils import opennlp.tools.util.Span import opennlp.tools.util.TrainingParameters +import opennlp.tools.util.TrainingParameters.CUTOFF_PARAM import java.time.Instant /** diff --git a/nlp/model/sagemaker/pom.xml b/nlp/model/sagemaker/pom.xml index 57569586a3..94f3dfdf90 100644 --- a/nlp/model/sagemaker/pom.xml +++ b/nlp/model/sagemaker/pom.xml @@ -28,7 +28,7 @@ Sagemaker client for Tock NLP Model - 2.28.7 + 2.29.43 diff --git a/pom.xml b/pom.xml index 4a11b34378..c4f8f5539c 100644 --- a/pom.xml +++ b/pom.xml @@ -31,62 +31,62 @@ ${project.basedir}/src/main/kotlin ${project.basedir}/src/test/kotlin - 2.0.20 - 1.9.0 + 2.1.0 + 1.10.1 2.0.16 - 1.5.8 + 1.5.15 3.0.5 4.1.0 - 5.1.0 - 2.17.2 - 2.17.2 - 2.17.2 + 5.2.0 + 2.18.2 + 2.18.2 + 2.18.2 0.4.0 0.4.0 0.4.0 5.6 - 4.5.10 + 4.5.11 2.11.0 4.12.0 1.1.0 1.2.1.2 1.7.1 - 33.3.1-jre - 1.36.0 - 1.45.0 + 33.4.0-jre + 1.37.0 + 1.45.3 1.9.3 - 1.11.0 - 1.12.0 + 1.12.0 + 1.13.0 5.1.1 1.17.1 3.17.0 - 0.23.0 - 20240303 + 0.24.0 + 20241224 4.5.14 4.1.1 1.12 - 26.47.0 - 1.12.772 - 5.7.3 - 6.0.2 + 26.52.0 + 1.12.780 + 5.7.7 + 6.0.3 6.3.0 - 5.11.0 - 1.20.1 + 5.11.4 + 1.20.4 - 1.13.12 + 1.13.14 3.22.0 - 1.15.1 + 1.15.11 0.15.0 1.6.2 - 3.2.5 + 3.5.0 3.3.1 - 3.0.1 - 3.2.4 + 3.1.1 + 3.2.6 1.6.13 1.9.20 3.4.2 @@ -101,12 +101,12 @@ 4.9.10 1.15.2 - 11 + 17 - 11 - 11 + 17 + 17 - v20.13.1 + v20.18.1 @@ -128,11 +128,6 @@ - - org.jetbrains.kotlin - kotlin-stdlib-common - ${kotlin} - org.jetbrains.kotlin kotlin-stdlib @@ -712,6 +707,10 @@ org.jetbrains.kotlin kotlin-maven-plugin ${kotlin} + + 1.9 + 1.9 + diff --git a/util/gcp-tools/pom.xml b/util/gcp-tools/pom.xml index 012e03636a..0a2a56a537 100644 --- a/util/gcp-tools/pom.xml +++ b/util/gcp-tools/pom.xml @@ -13,7 +13,7 @@ http://maven.apache.org - 2.49.0 + 2.55.0