File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
nlp/model/sagemaker/src/main/kotlin Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,22 @@ class SagemakerEngineProvider : NlpEngineProvider {
59
59
}
60
60
61
61
override fun healthcheck (): () -> NlpHealthcheckResult = {
62
- val grouped = SagemakerClientProvider .getAllClient().groupBy { it.name }.withDefault { emptyList() }
63
- NlpHealthcheckResult (
64
- entityClassifier = grouped.getValue(SagemakerEntityClassifier .CLIENT_TYPE .clientName).all { it.healthcheck() },
65
- intentClassifier = grouped.getValue(SagemakerIntentClassifier .CLIENT_TYPE .clientName).all { it.healthcheck() },
66
- )
62
+ val clients = SagemakerClientProvider .getAllClient()
63
+ if (clients.isEmpty()) {
64
+ NlpHealthcheckResult (
65
+ entityClassifier = false ,
66
+ intentClassifier = false
67
+ )
68
+ } else {
69
+ val grouped = clients.groupBy { it.name }.withDefault { emptyList() }
70
+ val entityClients = grouped.getValue(SagemakerEntityClassifier .CLIENT_TYPE .clientName)
71
+ val intentClients = grouped.getValue(SagemakerIntentClassifier .CLIENT_TYPE .clientName)
72
+
73
+ NlpHealthcheckResult (
74
+ entityClassifier = entityClients.isNotEmpty() && entityClients.all { it.healthcheck() },
75
+ intentClassifier = intentClients.isNotEmpty() && intentClients.all { it.healthcheck() }
76
+ )
77
+ }
67
78
}
68
79
}
69
80
You can’t perform that action at this time.
0 commit comments