diff --git a/src/main.cpp b/src/main.cpp index 34bc83e..b08aa5c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -998,7 +998,8 @@ PYBIND11_MODULE(_core, m) [&](VW::cs_label* cs_label) { ex.l.cs = *cs_label; }, }, label); - }); + }) + .def("_get_tag", [](VW::example& ex) -> std::string { return std::string(ex.tag.data(), ex.tag.size()); }); py::class_(m, "Workspace") .def(py::init( diff --git a/src/vowpal_wabbit_next/_core.pyi b/src/vowpal_wabbit_next/_core.pyi index 4fccaef..baec774 100644 --- a/src/vowpal_wabbit_next/_core.pyi +++ b/src/vowpal_wabbit_next/_core.pyi @@ -95,6 +95,7 @@ class DenseParameters(): class Example(): def __init__(self) -> None: ... def _get_label(self, arg0: LabelType) -> typing.Union[SimpleLabel, MulticlassLabel, CBLabel, CSLabel, None]: ... + def _get_tag(self) -> str: ... def _is_newline(self) -> bool: ... def _set_label(self, arg0: typing.Union[SimpleLabel, MulticlassLabel, CBLabel, CSLabel, None]) -> None: ... pass