Skip to content

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

Merged
merged 5 commits into from
Jul 1, 2025
Merged

Ai multi endpoint classifier #1265

merged 5 commits into from
Jul 1, 2025

Conversation

MohsenTaheriShalmani
Copy link
Contributor

AIGaussianCheck.kt and AIGlmCheck.kt are updated to show how we can deal with an api with mutiple endpoints

class AIResponseClassifier(
private val config: EMConfig = EMConfig(),
private val explicitModel: AIModel? = null
) : AIModel {
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Contributor Author

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

@arcuri82 arcuri82 merged commit 8ee7fb4 into master Jul 1, 2025
14 checks passed
@MohsenTaheriShalmani MohsenTaheriShalmani deleted the ai-multi-endpoint-classifier branch July 1, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants