88#include < tvm/ffi/container/array.h>
99#include < tvm/ffi/container/shape.h>
1010#include < tvm/ffi/optional.h>
11+ #include < tvm/ffi/reflection/registry.h>
1112#include < tvm/ffi/string.h>
1213#include < tvm/node/cast.h>
1314#include < tvm/runtime/int_tuple.h>
@@ -50,8 +51,14 @@ class DataNode : public Object {
5051 */
5152 virtual ObjectRef GetEmbedding (Model model, ObjectRef* dst = nullptr , int offset = 0 ) const = 0;
5253
54+ static void RegisterReflection () {
55+ namespace refl = tvm::ffi::reflection;
56+ refl::ObjectDef<DataNode>();
57+ }
58+
5359 static constexpr const bool _type_has_method_sequal_reduce = false ;
5460 static constexpr const bool _type_has_method_shash_reduce = false ;
61+ static constexpr const uint32_t _type_child_slots = 3 ;
5562 TVM_FFI_DECLARE_OBJECT_INFO (" mlc.serve.Data" , DataNode, Object);
5663};
5764
@@ -75,7 +82,12 @@ class TextDataNode : public DataNode {
7582 int GetLength () const final ;
7683 ObjectRef GetEmbedding (Model model, ObjectRef* dst = nullptr , int offset = 0 ) const final ;
7784
78- TVM_FFI_DECLARE_OBJECT_INFO (" mlc.serve.TextData" , TextDataNode, DataNode);
85+ static void RegisterReflection () {
86+ namespace refl = tvm::ffi::reflection;
87+ refl::ObjectDef<TextDataNode>();
88+ }
89+
90+ TVM_FFI_DECLARE_OBJECT_INFO_FINAL (" mlc.serve.TextData" , TextDataNode, DataNode);
7991};
8092
8193class TextData : public Data {
@@ -96,7 +108,12 @@ class TokenDataNode : public DataNode {
96108 int GetLength () const final ;
97109 ObjectRef GetEmbedding (Model model, ObjectRef* dst = nullptr , int offset = 0 ) const final ;
98110
99- TVM_FFI_DECLARE_OBJECT_INFO (" mlc.serve.TokenData" , TokenDataNode, DataNode);
111+ static void RegisterReflection () {
112+ namespace refl = tvm::ffi::reflection;
113+ refl::ObjectDef<TokenDataNode>();
114+ }
115+
116+ TVM_FFI_DECLARE_OBJECT_INFO_FINAL (" mlc.serve.TokenData" , TokenDataNode, DataNode);
100117};
101118
102119class TokenData : public Data {
@@ -120,7 +137,12 @@ class ImageDataNode : public DataNode {
120137 int GetLength () const final ;
121138 ObjectRef GetEmbedding (Model model, ObjectRef* dst = nullptr , int offset = 0 ) const final ;
122139
123- TVM_FFI_DECLARE_OBJECT_INFO (" mlc.serve.ImageData" , ImageDataNode, DataNode);
140+ static void RegisterReflection () {
141+ namespace refl = tvm::ffi::reflection;
142+ refl::ObjectDef<ImageDataNode>();
143+ }
144+
145+ TVM_FFI_DECLARE_OBJECT_INFO_FINAL (" mlc.serve.ImageData" , ImageDataNode, DataNode);
124146};
125147
126148class ImageData : public Data {
@@ -197,6 +219,11 @@ class RequestStreamOutputObj : public Object {
197219
198220 std::atomic<bool > unpacked = false ;
199221
222+ static void RegisterReflection () {
223+ namespace refl = tvm::ffi::reflection;
224+ refl::ObjectDef<RequestStreamOutputObj>();
225+ }
226+
200227 static constexpr const bool _type_has_method_sequal_reduce = false ;
201228 static constexpr const bool _type_has_method_shash_reduce = false ;
202229 static constexpr const bool _type_mutable = true ;
0 commit comments