-
Notifications
You must be signed in to change notification settings - Fork 94
Ai multi endpoint classifier #1265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
class AIResponseClassifier( | ||
private val config: EMConfig = EMConfig(), | ||
private val explicitModel: AIModel? = null | ||
) : AIModel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the injection here shouldn't be touched. constructor should have no inputs. long story...
recall this class is instantiated as singleton with a DI framework
|
||
private lateinit var delegate: AIModel | ||
private lateinit var model: AIModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changing the name from delegate
to model
? AIResponseClassifier
itself extends AIModel
, but delegates its execution to another model.
} | ||
|
||
fun getInnerModel(): AIModel = model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning a mutable state reference is usually not a good idea in OO, as it can lead break incapsulation. at times, we need it. in those cases, to make it explicit, i prefer to use the term view
instead of get
, eg, viewInnerModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tnx, I'll fix it
AIGaussianCheck.kt and AIGlmCheck.kt are updated to show how we can deal with an api with mutiple endpoints