Skip to content

sgns::neoswarm::elm::DomainELM

Domain-specific ELM (Math, Code, Science) with optional dedicated .mnn model file. More...

#include <domain_elm.hpp>

Inherits from sgns::neoswarm::elm::IELM

Public Functions

Name
DomainELM(ELMRole role, std::shared_ptr< core::InferenceEngine > sharedEngine =nullptr)
Construct a DomainELM for the given domain role.
virtual std::string GetName() const override
virtual ELMRole GetRole() const override
virtual bool IsLoaded() const override
virtual outcome::result< void > Load(const std::string & model_path) override
Load the ELM model from disk (if a dedicated model path is configured).
virtual outcome::result< std::string > Process(const std::string & input, const ELMContext & context) override
Process input through this ELM and return refined output.

Additional inherited members

Public Functions inherited from sgns::neoswarm::elm::IELM

Name
virtual ~IELM() =default
virtual float GetConfidence() const
Confidence in the last Process() call.

Protected Attributes inherited from sgns::neoswarm::elm::IELM

Name
float m_lastConfidence

Detailed Description

class sgns::neoswarm::elm::DomainELM;

Domain-specific ELM (Math, Code, Science) with optional dedicated .mnn model file.

Per D-01/D-02: by default uses the shared MNN backbone; if Load() is called with a non-empty model_path, creates a dedicated MNNInferenceEngine instance and uses that instead. Fail-close per D-04.

Public Functions Documentation

function DomainELM

explicit DomainELM(
    ELMRole role,
    std::shared_ptr< core::InferenceEngine > sharedEngine =nullptr
)

Construct a DomainELM for the given domain role.

Parameters:

  • role ELMRole::Math, Code, or Science.
  • sharedEngine Shared inference engine (MNN backbone). May be nullptr for stub/testing; Process will fail-close.

function GetName

inline virtual std::string GetName() const override

Return: Human-readable name of this ELM.

Reimplements: sgns::neoswarm::elm::IELM::GetName

function GetRole

inline virtual ELMRole GetRole() const override

Return: The ELM role this instance fulfills.

Reimplements: sgns::neoswarm::elm::IELM::GetRole

function IsLoaded

inline virtual bool IsLoaded() const override

Return: True if the ELM model has been loaded.

Reimplements: sgns::neoswarm::elm::IELM::IsLoaded

function Load

virtual outcome::result< void > Load(
    const std::string & model_path
) override

Load the ELM model from disk (if a dedicated model path is configured).

Parameters:

  • model_path Path to the model file (.mnn or similar).

Return: outcome::success or ModelLoadFailed.

Reimplements: sgns::neoswarm::elm::IELM::Load

function Process

virtual outcome::result< std::string > Process(
    const std::string & input,
    const ELMContext & context
) override

Process input through this ELM and return refined output.

Parameters:

  • input Text to process (typically output of previous chain step).
  • context ELM execution context (original task, prior outputs, confidences).

Return: Refined text or InferenceFailed.

Reimplements: sgns::neoswarm::elm::IELM::Process


Updated on 2026-10-09 at 03:59:42 +0000