|
Entropic 2.9.5
Local-first agentic inference engine
|
Shared <parameter=NAME>value</parameter> extractor for XML-format chat adapters (Qwen 3.5 / Qwen 3.6 / Nemotron 3).
More...
#include <spdlog/spdlog.h>#include <memory>#include <string>#include <unordered_map>

Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| std::unordered_map< std::string, std::string > | entropic::inference::adapters::parse_xml_parameters (const std::string &func_body, const std::shared_ptr< spdlog::logger > &logger) |
Extract <parameter=NAME>value</parameter> pairs from a function body. | |
Shared <parameter=NAME>value</parameter> extractor for XML-format chat adapters (Qwen 3.5 / Qwen 3.6 / Nemotron 3).
Pre-v2.4.1 each adapter carried a byte-identical inline regex parser. They also shared a latent bug (gh#79): when a model closes a parameter with </NAME> echoing the opening name instead of the literal </parameter>, the non-greedy regex scanned past the wrong close tag to the next </parameter>, bleeding the following parameter's content into the first parameter's value.
This helper centralizes the parse:
</parameter> OR </NAME> close tags (whichever comes first after the opening, where NAME matches the opening's name verbatim).<function= tag (malformed multi-call output handling, preserved from the per-adapter implementations).Definition in file xml_parameter_parser.h.
| std::unordered_map< std::string, std::string > entropic::inference::adapters::parse_xml_parameters | ( | const std::string & | func_body, |
| const std::shared_ptr< spdlog::logger > & | logger | ||
| ) |
Extract <parameter=NAME>value</parameter> pairs from a function body.
gh#79 fix: tolerates </NAME> close tags in addition to the literal </parameter>. See the helper definitions above and the header for full contract.
@utility
Returns a map keyed by parameter name. Empty keys / values (after trim) are skipped with a warning. The </NAME> close-tag tolerance is the gh#79 fix.
| func_body | Function body text (between <function=name> and the matching </function>). |
| logger | Adapter-owned logger for warn messages. May be null — the parser is silent in that case. |
Definition at line 116 of file xml_parameter_parser.cpp.