9
9
"github.com/nyaruka/goflow/assets"
10
10
"github.com/nyaruka/goflow/flows"
11
11
"github.com/nyaruka/goflow/flows/engine"
12
- "github.com/nyaruka/goflow/services/classification/bothub"
13
- "github.com/nyaruka/goflow/services/classification/luis"
14
12
"github.com/nyaruka/goflow/services/classification/wit"
15
13
"github.com/nyaruka/mailroom/core/goflow"
16
14
"github.com/nyaruka/mailroom/runtime"
@@ -25,9 +23,7 @@ const NilClassifierID = ClassifierID(0)
25
23
26
24
// classifier type constants
27
25
const (
28
- ClassifierTypeWit = "wit"
29
- ClassifierTypeLuis = "luis"
30
- ClassifierTypeBothub = "bothub"
26
+ ClassifierTypeWit = "wit"
31
27
)
32
28
33
29
// classifier config key constants
@@ -88,7 +84,7 @@ func (c *Classifier) Type() string { return c.Type_ }
88
84
89
85
// AsService builds the corresponding ClassificationService for the passed in Classifier
90
86
func (c * Classifier ) AsService (cfg * runtime.Config , classifier * flows.Classifier ) (flows.ClassificationService , error ) {
91
- httpClient , httpRetries , httpAccess := goflow .HTTP (cfg )
87
+ httpClient , httpRetries , _ := goflow .HTTP (cfg )
92
88
93
89
switch c .Type () {
94
90
case ClassifierTypeWit :
@@ -98,24 +94,6 @@ func (c *Classifier) AsService(cfg *runtime.Config, classifier *flows.Classifier
98
94
}
99
95
return wit .NewService (httpClient , httpRetries , classifier , accessToken ), nil
100
96
101
- case ClassifierTypeLuis :
102
- appID := c .Config_ [LuisConfigAppID ]
103
- endpoint := c .Config_ [LuisConfigPredictionEndpoint ]
104
- key := c .Config_ [LuisConfigPredictionKey ]
105
- slot := c .Config_ [LuisConfigSlot ]
106
- if endpoint == "" || appID == "" || key == "" || slot == "" {
107
- return nil , fmt .Errorf ("missing %s, %s, %s or %s on LUIS classifier: %s" ,
108
- LuisConfigAppID , LuisConfigPredictionEndpoint , LuisConfigPredictionKey , LuisConfigSlot , c .UUID ())
109
- }
110
- return luis .NewService (httpClient , httpRetries , httpAccess , classifier , endpoint , appID , key , slot ), nil
111
-
112
- case ClassifierTypeBothub :
113
- accessToken := c .Config_ [BothubConfigAccessToken ]
114
- if accessToken == "" {
115
- return nil , fmt .Errorf ("missing %s for Bothub classifier: %s" , BothubConfigAccessToken , c .UUID ())
116
- }
117
- return bothub .NewService (httpClient , httpRetries , classifier , accessToken ), nil
118
-
119
97
default :
120
98
return nil , fmt .Errorf ("unknown classifier type '%s' for classifier: %s" , c .Type (), c .UUID ())
121
99
}
0 commit comments