Skip to content

OSSS.ai.services.classification_service

OSSS.ai.services.classification_service

ClassificationService

Thin wrapper around the sklearn classifier agent.

Responsibilities: - Own the classifier instance / model path - Normalize the output into a stable dict - Handle errors and return a safe fallback profile - Optionally write normalized results into execution_state/context so that downstream components (e.g., DecisionNode) can use them.

classify(query, config) async

Run the classifier and return a normalized profile dict.

Never raises on classifier failure – returns a low-confidence "general" profile instead.

If config includes a context / execution_state reference, this method will also populate: - execution_state["task_classification"] - execution_state["cognitive_classification"] - execution_state["classifier_profile"] so that DecisionNode and other routing logic can see them.