unaiverse 0.1.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. unaiverse/__init__.py +19 -0
  2. unaiverse/agent.py +2226 -0
  3. unaiverse/agent_basics.py +2389 -0
  4. unaiverse/clock.py +234 -0
  5. unaiverse/dataprops.py +1282 -0
  6. unaiverse/hsm.py +2471 -0
  7. unaiverse/modules/__init__.py +18 -0
  8. unaiverse/modules/cnu/__init__.py +17 -0
  9. unaiverse/modules/cnu/cnus.py +536 -0
  10. unaiverse/modules/cnu/layers.py +261 -0
  11. unaiverse/modules/cnu/psi.py +60 -0
  12. unaiverse/modules/hl/__init__.py +15 -0
  13. unaiverse/modules/hl/hl_utils.py +411 -0
  14. unaiverse/modules/networks.py +1509 -0
  15. unaiverse/modules/utils.py +748 -0
  16. unaiverse/networking/__init__.py +16 -0
  17. unaiverse/networking/node/__init__.py +18 -0
  18. unaiverse/networking/node/connpool.py +1332 -0
  19. unaiverse/networking/node/node.py +2752 -0
  20. unaiverse/networking/node/profile.py +446 -0
  21. unaiverse/networking/node/tokens.py +79 -0
  22. unaiverse/networking/p2p/__init__.py +188 -0
  23. unaiverse/networking/p2p/go.mod +127 -0
  24. unaiverse/networking/p2p/go.sum +548 -0
  25. unaiverse/networking/p2p/golibp2p.py +18 -0
  26. unaiverse/networking/p2p/golibp2p.pyi +136 -0
  27. unaiverse/networking/p2p/lib.go +2765 -0
  28. unaiverse/networking/p2p/lib_types.py +311 -0
  29. unaiverse/networking/p2p/message_pb2.py +50 -0
  30. unaiverse/networking/p2p/messages.py +360 -0
  31. unaiverse/networking/p2p/mylogger.py +78 -0
  32. unaiverse/networking/p2p/p2p.py +900 -0
  33. unaiverse/networking/p2p/proto-go/message.pb.go +846 -0
  34. unaiverse/stats.py +1506 -0
  35. unaiverse/streamlib/__init__.py +15 -0
  36. unaiverse/streamlib/streamlib.py +210 -0
  37. unaiverse/streams.py +804 -0
  38. unaiverse/utils/__init__.py +16 -0
  39. unaiverse/utils/lone_wolf.json +28 -0
  40. unaiverse/utils/misc.py +441 -0
  41. unaiverse/utils/sandbox.py +292 -0
  42. unaiverse/world.py +384 -0
  43. unaiverse-0.1.12.dist-info/METADATA +366 -0
  44. unaiverse-0.1.12.dist-info/RECORD +47 -0
  45. unaiverse-0.1.12.dist-info/WHEEL +5 -0
  46. unaiverse-0.1.12.dist-info/licenses/LICENSE +177 -0
  47. unaiverse-0.1.12.dist-info/top_level.txt +1 -0
@@ -0,0 +1,846 @@
1
+ // Specifies that we are using the proto3 syntax.
2
+
3
+ // Code generated by protoc-gen-go. DO NOT EDIT.
4
+ // versions:
5
+ // protoc-gen-go v1.36.6
6
+ // protoc v4.25.3
7
+ // source: message.proto
8
+
9
+ // Defines the package name, which helps in preventing naming conflicts.
10
+
11
+ package proto_go
12
+
13
+ import (
14
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
15
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
16
+ structpb "google.golang.org/protobuf/types/known/structpb"
17
+ reflect "reflect"
18
+ sync "sync"
19
+ unsafe "unsafe"
20
+ )
21
+
22
+ const (
23
+ // Verify that this generated code is sufficiently up-to-date.
24
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
25
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
26
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
27
+ )
28
+
29
+ type Message struct {
30
+ state protoimpl.MessageState `protogen:"open.v1"`
31
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
32
+ ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` // "profile", "action_request", etc.
33
+ Channel string `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel,omitempty"`
34
+ Piggyback string `protobuf:"bytes,4,opt,name=piggyback,proto3" json:"piggyback,omitempty"`
35
+ TimestampNet string `protobuf:"bytes,5,opt,name=timestamp_net,json=timestampNet,proto3" json:"timestamp_net,omitempty"`
36
+ // The simplified 'oneof' for the hybrid approach
37
+ //
38
+ // Types that are valid to be assigned to Content:
39
+ //
40
+ // *Message_StreamSample
41
+ // *Message_JsonContent
42
+ // *Message_StatsUpdate
43
+ Content isMessage_Content `protobuf_oneof:"content"`
44
+ unknownFields protoimpl.UnknownFields
45
+ sizeCache protoimpl.SizeCache
46
+ }
47
+
48
+ func (x *Message) Reset() {
49
+ *x = Message{}
50
+ mi := &file_message_proto_msgTypes[0]
51
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
52
+ ms.StoreMessageInfo(mi)
53
+ }
54
+
55
+ func (x *Message) String() string {
56
+ return protoimpl.X.MessageStringOf(x)
57
+ }
58
+
59
+ func (*Message) ProtoMessage() {}
60
+
61
+ func (x *Message) ProtoReflect() protoreflect.Message {
62
+ mi := &file_message_proto_msgTypes[0]
63
+ if x != nil {
64
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
65
+ if ms.LoadMessageInfo() == nil {
66
+ ms.StoreMessageInfo(mi)
67
+ }
68
+ return ms
69
+ }
70
+ return mi.MessageOf(x)
71
+ }
72
+
73
+ // Deprecated: Use Message.ProtoReflect.Descriptor instead.
74
+ func (*Message) Descriptor() ([]byte, []int) {
75
+ return file_message_proto_rawDescGZIP(), []int{0}
76
+ }
77
+
78
+ func (x *Message) GetSender() string {
79
+ if x != nil {
80
+ return x.Sender
81
+ }
82
+ return ""
83
+ }
84
+
85
+ func (x *Message) GetContentType() string {
86
+ if x != nil {
87
+ return x.ContentType
88
+ }
89
+ return ""
90
+ }
91
+
92
+ func (x *Message) GetChannel() string {
93
+ if x != nil {
94
+ return x.Channel
95
+ }
96
+ return ""
97
+ }
98
+
99
+ func (x *Message) GetPiggyback() string {
100
+ if x != nil {
101
+ return x.Piggyback
102
+ }
103
+ return ""
104
+ }
105
+
106
+ func (x *Message) GetTimestampNet() string {
107
+ if x != nil {
108
+ return x.TimestampNet
109
+ }
110
+ return ""
111
+ }
112
+
113
+ func (x *Message) GetContent() isMessage_Content {
114
+ if x != nil {
115
+ return x.Content
116
+ }
117
+ return nil
118
+ }
119
+
120
+ func (x *Message) GetStreamSample() *StreamSampleContent {
121
+ if x != nil {
122
+ if x, ok := x.Content.(*Message_StreamSample); ok {
123
+ return x.StreamSample
124
+ }
125
+ }
126
+ return nil
127
+ }
128
+
129
+ func (x *Message) GetJsonContent() string {
130
+ if x != nil {
131
+ if x, ok := x.Content.(*Message_JsonContent); ok {
132
+ return x.JsonContent
133
+ }
134
+ }
135
+ return ""
136
+ }
137
+
138
+ func (x *Message) GetStatsUpdate() *StatBatch {
139
+ if x != nil {
140
+ if x, ok := x.Content.(*Message_StatsUpdate); ok {
141
+ return x.StatsUpdate
142
+ }
143
+ }
144
+ return nil
145
+ }
146
+
147
+ type isMessage_Content interface {
148
+ isMessage_Content()
149
+ }
150
+
151
+ type Message_StreamSample struct {
152
+ StreamSample *StreamSampleContent `protobuf:"bytes,6,opt,name=stream_sample,json=streamSample,proto3,oneof"`
153
+ }
154
+
155
+ type Message_JsonContent struct {
156
+ JsonContent string `protobuf:"bytes,7,opt,name=json_content,json=jsonContent,proto3,oneof"` // Umbrella for ALL other structured messages
157
+ }
158
+
159
+ type Message_StatsUpdate struct {
160
+ StatsUpdate *StatBatch `protobuf:"bytes,8,opt,name=stats_update,json=statsUpdate,proto3,oneof"`
161
+ }
162
+
163
+ func (*Message_StreamSample) isMessage_Content() {}
164
+
165
+ func (*Message_JsonContent) isMessage_Content() {}
166
+
167
+ func (*Message_StatsUpdate) isMessage_Content() {}
168
+
169
+ type StreamSampleContent struct {
170
+ state protoimpl.MessageState `protogen:"open.v1"`
171
+ Samples map[string]*StreamSample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
172
+ unknownFields protoimpl.UnknownFields
173
+ sizeCache protoimpl.SizeCache
174
+ }
175
+
176
+ func (x *StreamSampleContent) Reset() {
177
+ *x = StreamSampleContent{}
178
+ mi := &file_message_proto_msgTypes[1]
179
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
180
+ ms.StoreMessageInfo(mi)
181
+ }
182
+
183
+ func (x *StreamSampleContent) String() string {
184
+ return protoimpl.X.MessageStringOf(x)
185
+ }
186
+
187
+ func (*StreamSampleContent) ProtoMessage() {}
188
+
189
+ func (x *StreamSampleContent) ProtoReflect() protoreflect.Message {
190
+ mi := &file_message_proto_msgTypes[1]
191
+ if x != nil {
192
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
193
+ if ms.LoadMessageInfo() == nil {
194
+ ms.StoreMessageInfo(mi)
195
+ }
196
+ return ms
197
+ }
198
+ return mi.MessageOf(x)
199
+ }
200
+
201
+ // Deprecated: Use StreamSampleContent.ProtoReflect.Descriptor instead.
202
+ func (*StreamSampleContent) Descriptor() ([]byte, []int) {
203
+ return file_message_proto_rawDescGZIP(), []int{1}
204
+ }
205
+
206
+ func (x *StreamSampleContent) GetSamples() map[string]*StreamSample {
207
+ if x != nil {
208
+ return x.Samples
209
+ }
210
+ return nil
211
+ }
212
+
213
+ type StreamSample struct {
214
+ state protoimpl.MessageState `protogen:"open.v1"`
215
+ Data *SampleData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
216
+ DataTag int32 `protobuf:"varint,2,opt,name=data_tag,json=dataTag,proto3" json:"data_tag,omitempty"`
217
+ DataUuid *string `protobuf:"bytes,3,opt,name=data_uuid,json=dataUuid,proto3,oneof" json:"data_uuid,omitempty"`
218
+ unknownFields protoimpl.UnknownFields
219
+ sizeCache protoimpl.SizeCache
220
+ }
221
+
222
+ func (x *StreamSample) Reset() {
223
+ *x = StreamSample{}
224
+ mi := &file_message_proto_msgTypes[2]
225
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
226
+ ms.StoreMessageInfo(mi)
227
+ }
228
+
229
+ func (x *StreamSample) String() string {
230
+ return protoimpl.X.MessageStringOf(x)
231
+ }
232
+
233
+ func (*StreamSample) ProtoMessage() {}
234
+
235
+ func (x *StreamSample) ProtoReflect() protoreflect.Message {
236
+ mi := &file_message_proto_msgTypes[2]
237
+ if x != nil {
238
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
239
+ if ms.LoadMessageInfo() == nil {
240
+ ms.StoreMessageInfo(mi)
241
+ }
242
+ return ms
243
+ }
244
+ return mi.MessageOf(x)
245
+ }
246
+
247
+ // Deprecated: Use StreamSample.ProtoReflect.Descriptor instead.
248
+ func (*StreamSample) Descriptor() ([]byte, []int) {
249
+ return file_message_proto_rawDescGZIP(), []int{2}
250
+ }
251
+
252
+ func (x *StreamSample) GetData() *SampleData {
253
+ if x != nil {
254
+ return x.Data
255
+ }
256
+ return nil
257
+ }
258
+
259
+ func (x *StreamSample) GetDataTag() int32 {
260
+ if x != nil {
261
+ return x.DataTag
262
+ }
263
+ return 0
264
+ }
265
+
266
+ func (x *StreamSample) GetDataUuid() string {
267
+ if x != nil && x.DataUuid != nil {
268
+ return *x.DataUuid
269
+ }
270
+ return ""
271
+ }
272
+
273
+ type SampleData struct {
274
+ state protoimpl.MessageState `protogen:"open.v1"`
275
+ // Types that are valid to be assigned to DataPayload:
276
+ //
277
+ // *SampleData_TensorData
278
+ // *SampleData_ImageData
279
+ // *SampleData_TextData
280
+ // *SampleData_FileData
281
+ DataPayload isSampleData_DataPayload `protobuf_oneof:"data_payload"`
282
+ unknownFields protoimpl.UnknownFields
283
+ sizeCache protoimpl.SizeCache
284
+ }
285
+
286
+ func (x *SampleData) Reset() {
287
+ *x = SampleData{}
288
+ mi := &file_message_proto_msgTypes[3]
289
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
290
+ ms.StoreMessageInfo(mi)
291
+ }
292
+
293
+ func (x *SampleData) String() string {
294
+ return protoimpl.X.MessageStringOf(x)
295
+ }
296
+
297
+ func (*SampleData) ProtoMessage() {}
298
+
299
+ func (x *SampleData) ProtoReflect() protoreflect.Message {
300
+ mi := &file_message_proto_msgTypes[3]
301
+ if x != nil {
302
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
303
+ if ms.LoadMessageInfo() == nil {
304
+ ms.StoreMessageInfo(mi)
305
+ }
306
+ return ms
307
+ }
308
+ return mi.MessageOf(x)
309
+ }
310
+
311
+ // Deprecated: Use SampleData.ProtoReflect.Descriptor instead.
312
+ func (*SampleData) Descriptor() ([]byte, []int) {
313
+ return file_message_proto_rawDescGZIP(), []int{3}
314
+ }
315
+
316
+ func (x *SampleData) GetDataPayload() isSampleData_DataPayload {
317
+ if x != nil {
318
+ return x.DataPayload
319
+ }
320
+ return nil
321
+ }
322
+
323
+ func (x *SampleData) GetTensorData() *TensorData {
324
+ if x != nil {
325
+ if x, ok := x.DataPayload.(*SampleData_TensorData); ok {
326
+ return x.TensorData
327
+ }
328
+ }
329
+ return nil
330
+ }
331
+
332
+ func (x *SampleData) GetImageData() *ImageData {
333
+ if x != nil {
334
+ if x, ok := x.DataPayload.(*SampleData_ImageData); ok {
335
+ return x.ImageData
336
+ }
337
+ }
338
+ return nil
339
+ }
340
+
341
+ func (x *SampleData) GetTextData() *TextData {
342
+ if x != nil {
343
+ if x, ok := x.DataPayload.(*SampleData_TextData); ok {
344
+ return x.TextData
345
+ }
346
+ }
347
+ return nil
348
+ }
349
+
350
+ func (x *SampleData) GetFileData() *FileData {
351
+ if x != nil {
352
+ if x, ok := x.DataPayload.(*SampleData_FileData); ok {
353
+ return x.FileData
354
+ }
355
+ }
356
+ return nil
357
+ }
358
+
359
+ type isSampleData_DataPayload interface {
360
+ isSampleData_DataPayload()
361
+ }
362
+
363
+ type SampleData_TensorData struct {
364
+ TensorData *TensorData `protobuf:"bytes,1,opt,name=tensor_data,json=tensorData,proto3,oneof"`
365
+ }
366
+
367
+ type SampleData_ImageData struct {
368
+ ImageData *ImageData `protobuf:"bytes,2,opt,name=image_data,json=imageData,proto3,oneof"`
369
+ }
370
+
371
+ type SampleData_TextData struct {
372
+ TextData *TextData `protobuf:"bytes,3,opt,name=text_data,json=textData,proto3,oneof"`
373
+ }
374
+
375
+ type SampleData_FileData struct {
376
+ FileData *FileData `protobuf:"bytes,4,opt,name=file_data,json=fileData,proto3,oneof"`
377
+ }
378
+
379
+ func (*SampleData_TensorData) isSampleData_DataPayload() {}
380
+
381
+ func (*SampleData_ImageData) isSampleData_DataPayload() {}
382
+
383
+ func (*SampleData_TextData) isSampleData_DataPayload() {}
384
+
385
+ func (*SampleData_FileData) isSampleData_DataPayload() {}
386
+
387
+ type TensorData struct {
388
+ state protoimpl.MessageState `protogen:"open.v1"`
389
+ Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // gzipped raw bytes
390
+ Dtype string `protobuf:"bytes,2,opt,name=dtype,proto3" json:"dtype,omitempty"`
391
+ Shape []int32 `protobuf:"varint,3,rep,packed,name=shape,proto3" json:"shape,omitempty"`
392
+ unknownFields protoimpl.UnknownFields
393
+ sizeCache protoimpl.SizeCache
394
+ }
395
+
396
+ func (x *TensorData) Reset() {
397
+ *x = TensorData{}
398
+ mi := &file_message_proto_msgTypes[4]
399
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
400
+ ms.StoreMessageInfo(mi)
401
+ }
402
+
403
+ func (x *TensorData) String() string {
404
+ return protoimpl.X.MessageStringOf(x)
405
+ }
406
+
407
+ func (*TensorData) ProtoMessage() {}
408
+
409
+ func (x *TensorData) ProtoReflect() protoreflect.Message {
410
+ mi := &file_message_proto_msgTypes[4]
411
+ if x != nil {
412
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
413
+ if ms.LoadMessageInfo() == nil {
414
+ ms.StoreMessageInfo(mi)
415
+ }
416
+ return ms
417
+ }
418
+ return mi.MessageOf(x)
419
+ }
420
+
421
+ // Deprecated: Use TensorData.ProtoReflect.Descriptor instead.
422
+ func (*TensorData) Descriptor() ([]byte, []int) {
423
+ return file_message_proto_rawDescGZIP(), []int{4}
424
+ }
425
+
426
+ func (x *TensorData) GetData() []byte {
427
+ if x != nil {
428
+ return x.Data
429
+ }
430
+ return nil
431
+ }
432
+
433
+ func (x *TensorData) GetDtype() string {
434
+ if x != nil {
435
+ return x.Dtype
436
+ }
437
+ return ""
438
+ }
439
+
440
+ func (x *TensorData) GetShape() []int32 {
441
+ if x != nil {
442
+ return x.Shape
443
+ }
444
+ return nil
445
+ }
446
+
447
+ type ImageData struct {
448
+ state protoimpl.MessageState `protogen:"open.v1"`
449
+ Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // raw PNG bytes
450
+ unknownFields protoimpl.UnknownFields
451
+ sizeCache protoimpl.SizeCache
452
+ }
453
+
454
+ func (x *ImageData) Reset() {
455
+ *x = ImageData{}
456
+ mi := &file_message_proto_msgTypes[5]
457
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
458
+ ms.StoreMessageInfo(mi)
459
+ }
460
+
461
+ func (x *ImageData) String() string {
462
+ return protoimpl.X.MessageStringOf(x)
463
+ }
464
+
465
+ func (*ImageData) ProtoMessage() {}
466
+
467
+ func (x *ImageData) ProtoReflect() protoreflect.Message {
468
+ mi := &file_message_proto_msgTypes[5]
469
+ if x != nil {
470
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
471
+ if ms.LoadMessageInfo() == nil {
472
+ ms.StoreMessageInfo(mi)
473
+ }
474
+ return ms
475
+ }
476
+ return mi.MessageOf(x)
477
+ }
478
+
479
+ // Deprecated: Use ImageData.ProtoReflect.Descriptor instead.
480
+ func (*ImageData) Descriptor() ([]byte, []int) {
481
+ return file_message_proto_rawDescGZIP(), []int{5}
482
+ }
483
+
484
+ func (x *ImageData) GetData() []byte {
485
+ if x != nil {
486
+ return x.Data
487
+ }
488
+ return nil
489
+ }
490
+
491
+ type TextData struct {
492
+ state protoimpl.MessageState `protogen:"open.v1"`
493
+ Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // string of text
494
+ unknownFields protoimpl.UnknownFields
495
+ sizeCache protoimpl.SizeCache
496
+ }
497
+
498
+ func (x *TextData) Reset() {
499
+ *x = TextData{}
500
+ mi := &file_message_proto_msgTypes[6]
501
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
502
+ ms.StoreMessageInfo(mi)
503
+ }
504
+
505
+ func (x *TextData) String() string {
506
+ return protoimpl.X.MessageStringOf(x)
507
+ }
508
+
509
+ func (*TextData) ProtoMessage() {}
510
+
511
+ func (x *TextData) ProtoReflect() protoreflect.Message {
512
+ mi := &file_message_proto_msgTypes[6]
513
+ if x != nil {
514
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
515
+ if ms.LoadMessageInfo() == nil {
516
+ ms.StoreMessageInfo(mi)
517
+ }
518
+ return ms
519
+ }
520
+ return mi.MessageOf(x)
521
+ }
522
+
523
+ // Deprecated: Use TextData.ProtoReflect.Descriptor instead.
524
+ func (*TextData) Descriptor() ([]byte, []int) {
525
+ return file_message_proto_rawDescGZIP(), []int{6}
526
+ }
527
+
528
+ func (x *TextData) GetData() string {
529
+ if x != nil {
530
+ return x.Data
531
+ }
532
+ return ""
533
+ }
534
+
535
+ type FileData struct {
536
+ state protoimpl.MessageState `protogen:"open.v1"`
537
+ Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
538
+ Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
539
+ MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
540
+ unknownFields protoimpl.UnknownFields
541
+ sizeCache protoimpl.SizeCache
542
+ }
543
+
544
+ func (x *FileData) Reset() {
545
+ *x = FileData{}
546
+ mi := &file_message_proto_msgTypes[7]
547
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
548
+ ms.StoreMessageInfo(mi)
549
+ }
550
+
551
+ func (x *FileData) String() string {
552
+ return protoimpl.X.MessageStringOf(x)
553
+ }
554
+
555
+ func (*FileData) ProtoMessage() {}
556
+
557
+ func (x *FileData) ProtoReflect() protoreflect.Message {
558
+ mi := &file_message_proto_msgTypes[7]
559
+ if x != nil {
560
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
561
+ if ms.LoadMessageInfo() == nil {
562
+ ms.StoreMessageInfo(mi)
563
+ }
564
+ return ms
565
+ }
566
+ return mi.MessageOf(x)
567
+ }
568
+
569
+ // Deprecated: Use FileData.ProtoReflect.Descriptor instead.
570
+ func (*FileData) Descriptor() ([]byte, []int) {
571
+ return file_message_proto_rawDescGZIP(), []int{7}
572
+ }
573
+
574
+ func (x *FileData) GetContent() []byte {
575
+ if x != nil {
576
+ return x.Content
577
+ }
578
+ return nil
579
+ }
580
+
581
+ func (x *FileData) GetFilename() string {
582
+ if x != nil {
583
+ return x.Filename
584
+ }
585
+ return ""
586
+ }
587
+
588
+ func (x *FileData) GetMimeType() string {
589
+ if x != nil {
590
+ return x.MimeType
591
+ }
592
+ return ""
593
+ }
594
+
595
+ // --- Definitions for the Optimized Path: Stat Updates ---
596
+ type StatUpdate struct {
597
+ state protoimpl.MessageState `protogen:"open.v1"`
598
+ PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
599
+ StatName string `protobuf:"bytes,2,opt,name=stat_name,json=statName,proto3" json:"stat_name,omitempty"`
600
+ Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Use int64 for unix ms
601
+ Value *structpb.Value `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
602
+ unknownFields protoimpl.UnknownFields
603
+ sizeCache protoimpl.SizeCache
604
+ }
605
+
606
+ func (x *StatUpdate) Reset() {
607
+ *x = StatUpdate{}
608
+ mi := &file_message_proto_msgTypes[8]
609
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
610
+ ms.StoreMessageInfo(mi)
611
+ }
612
+
613
+ func (x *StatUpdate) String() string {
614
+ return protoimpl.X.MessageStringOf(x)
615
+ }
616
+
617
+ func (*StatUpdate) ProtoMessage() {}
618
+
619
+ func (x *StatUpdate) ProtoReflect() protoreflect.Message {
620
+ mi := &file_message_proto_msgTypes[8]
621
+ if x != nil {
622
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
623
+ if ms.LoadMessageInfo() == nil {
624
+ ms.StoreMessageInfo(mi)
625
+ }
626
+ return ms
627
+ }
628
+ return mi.MessageOf(x)
629
+ }
630
+
631
+ // Deprecated: Use StatUpdate.ProtoReflect.Descriptor instead.
632
+ func (*StatUpdate) Descriptor() ([]byte, []int) {
633
+ return file_message_proto_rawDescGZIP(), []int{8}
634
+ }
635
+
636
+ func (x *StatUpdate) GetPeerId() string {
637
+ if x != nil {
638
+ return x.PeerId
639
+ }
640
+ return ""
641
+ }
642
+
643
+ func (x *StatUpdate) GetStatName() string {
644
+ if x != nil {
645
+ return x.StatName
646
+ }
647
+ return ""
648
+ }
649
+
650
+ func (x *StatUpdate) GetTimestamp() int64 {
651
+ if x != nil {
652
+ return x.Timestamp
653
+ }
654
+ return 0
655
+ }
656
+
657
+ func (x *StatUpdate) GetValue() *structpb.Value {
658
+ if x != nil {
659
+ return x.Value
660
+ }
661
+ return nil
662
+ }
663
+
664
+ type StatBatch struct {
665
+ state protoimpl.MessageState `protogen:"open.v1"`
666
+ Updates []*StatUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"`
667
+ unknownFields protoimpl.UnknownFields
668
+ sizeCache protoimpl.SizeCache
669
+ }
670
+
671
+ func (x *StatBatch) Reset() {
672
+ *x = StatBatch{}
673
+ mi := &file_message_proto_msgTypes[9]
674
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
675
+ ms.StoreMessageInfo(mi)
676
+ }
677
+
678
+ func (x *StatBatch) String() string {
679
+ return protoimpl.X.MessageStringOf(x)
680
+ }
681
+
682
+ func (*StatBatch) ProtoMessage() {}
683
+
684
+ func (x *StatBatch) ProtoReflect() protoreflect.Message {
685
+ mi := &file_message_proto_msgTypes[9]
686
+ if x != nil {
687
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
688
+ if ms.LoadMessageInfo() == nil {
689
+ ms.StoreMessageInfo(mi)
690
+ }
691
+ return ms
692
+ }
693
+ return mi.MessageOf(x)
694
+ }
695
+
696
+ // Deprecated: Use StatBatch.ProtoReflect.Descriptor instead.
697
+ func (*StatBatch) Descriptor() ([]byte, []int) {
698
+ return file_message_proto_rawDescGZIP(), []int{9}
699
+ }
700
+
701
+ func (x *StatBatch) GetUpdates() []*StatUpdate {
702
+ if x != nil {
703
+ return x.Updates
704
+ }
705
+ return nil
706
+ }
707
+
708
+ var File_message_proto protoreflect.FileDescriptor
709
+
710
+ const file_message_proto_rawDesc = "" +
711
+ "\n" +
712
+ "\rmessage.proto\x12\x03p2p\x1a\x1cgoogle/protobuf/struct.proto\"\xc7\x02\n" +
713
+ "\aMessage\x12\x16\n" +
714
+ "\x06sender\x18\x01 \x01(\tR\x06sender\x12!\n" +
715
+ "\fcontent_type\x18\x02 \x01(\tR\vcontentType\x12\x18\n" +
716
+ "\achannel\x18\x03 \x01(\tR\achannel\x12\x1c\n" +
717
+ "\tpiggyback\x18\x04 \x01(\tR\tpiggyback\x12#\n" +
718
+ "\rtimestamp_net\x18\x05 \x01(\tR\ftimestampNet\x12?\n" +
719
+ "\rstream_sample\x18\x06 \x01(\v2\x18.p2p.StreamSampleContentH\x00R\fstreamSample\x12#\n" +
720
+ "\fjson_content\x18\a \x01(\tH\x00R\vjsonContent\x123\n" +
721
+ "\fstats_update\x18\b \x01(\v2\x0e.p2p.StatBatchH\x00R\vstatsUpdateB\t\n" +
722
+ "\acontent\"\xa5\x01\n" +
723
+ "\x13StreamSampleContent\x12?\n" +
724
+ "\asamples\x18\x01 \x03(\v2%.p2p.StreamSampleContent.SamplesEntryR\asamples\x1aM\n" +
725
+ "\fSamplesEntry\x12\x10\n" +
726
+ "\x03key\x18\x01 \x01(\tR\x03key\x12'\n" +
727
+ "\x05value\x18\x02 \x01(\v2\x11.p2p.StreamSampleR\x05value:\x028\x01\"~\n" +
728
+ "\fStreamSample\x12#\n" +
729
+ "\x04data\x18\x01 \x01(\v2\x0f.p2p.SampleDataR\x04data\x12\x19\n" +
730
+ "\bdata_tag\x18\x02 \x01(\x05R\adataTag\x12 \n" +
731
+ "\tdata_uuid\x18\x03 \x01(\tH\x00R\bdataUuid\x88\x01\x01B\f\n" +
732
+ "\n" +
733
+ "_data_uuid\"\xdd\x01\n" +
734
+ "\n" +
735
+ "SampleData\x122\n" +
736
+ "\vtensor_data\x18\x01 \x01(\v2\x0f.p2p.TensorDataH\x00R\n" +
737
+ "tensorData\x12/\n" +
738
+ "\n" +
739
+ "image_data\x18\x02 \x01(\v2\x0e.p2p.ImageDataH\x00R\timageData\x12,\n" +
740
+ "\ttext_data\x18\x03 \x01(\v2\r.p2p.TextDataH\x00R\btextData\x12,\n" +
741
+ "\tfile_data\x18\x04 \x01(\v2\r.p2p.FileDataH\x00R\bfileDataB\x0e\n" +
742
+ "\fdata_payload\"L\n" +
743
+ "\n" +
744
+ "TensorData\x12\x12\n" +
745
+ "\x04data\x18\x01 \x01(\fR\x04data\x12\x14\n" +
746
+ "\x05dtype\x18\x02 \x01(\tR\x05dtype\x12\x14\n" +
747
+ "\x05shape\x18\x03 \x03(\x05R\x05shape\"\x1f\n" +
748
+ "\tImageData\x12\x12\n" +
749
+ "\x04data\x18\x01 \x01(\fR\x04data\"\x1e\n" +
750
+ "\bTextData\x12\x12\n" +
751
+ "\x04data\x18\x01 \x01(\tR\x04data\"]\n" +
752
+ "\bFileData\x12\x18\n" +
753
+ "\acontent\x18\x01 \x01(\fR\acontent\x12\x1a\n" +
754
+ "\bfilename\x18\x02 \x01(\tR\bfilename\x12\x1b\n" +
755
+ "\tmime_type\x18\x03 \x01(\tR\bmimeType\"\x8e\x01\n" +
756
+ "\n" +
757
+ "StatUpdate\x12\x17\n" +
758
+ "\apeer_id\x18\x01 \x01(\tR\x06peerId\x12\x1b\n" +
759
+ "\tstat_name\x18\x02 \x01(\tR\bstatName\x12\x1c\n" +
760
+ "\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\x12,\n" +
761
+ "\x05value\x18\x04 \x01(\v2\x16.google.protobuf.ValueR\x05value\"6\n" +
762
+ "\tStatBatch\x12)\n" +
763
+ "\aupdates\x18\x01 \x03(\v2\x0f.p2p.StatUpdateR\aupdatesB\fZ\n" +
764
+ "./proto-gob\x06proto3"
765
+
766
+ var (
767
+ file_message_proto_rawDescOnce sync.Once
768
+ file_message_proto_rawDescData []byte
769
+ )
770
+
771
+ func file_message_proto_rawDescGZIP() []byte {
772
+ file_message_proto_rawDescOnce.Do(func() {
773
+ file_message_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_message_proto_rawDesc), len(file_message_proto_rawDesc)))
774
+ })
775
+ return file_message_proto_rawDescData
776
+ }
777
+
778
+ var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
779
+ var file_message_proto_goTypes = []any{
780
+ (*Message)(nil), // 0: p2p.Message
781
+ (*StreamSampleContent)(nil), // 1: p2p.StreamSampleContent
782
+ (*StreamSample)(nil), // 2: p2p.StreamSample
783
+ (*SampleData)(nil), // 3: p2p.SampleData
784
+ (*TensorData)(nil), // 4: p2p.TensorData
785
+ (*ImageData)(nil), // 5: p2p.ImageData
786
+ (*TextData)(nil), // 6: p2p.TextData
787
+ (*FileData)(nil), // 7: p2p.FileData
788
+ (*StatUpdate)(nil), // 8: p2p.StatUpdate
789
+ (*StatBatch)(nil), // 9: p2p.StatBatch
790
+ nil, // 10: p2p.StreamSampleContent.SamplesEntry
791
+ (*structpb.Value)(nil), // 11: google.protobuf.Value
792
+ }
793
+ var file_message_proto_depIdxs = []int32{
794
+ 1, // 0: p2p.Message.stream_sample:type_name -> p2p.StreamSampleContent
795
+ 9, // 1: p2p.Message.stats_update:type_name -> p2p.StatBatch
796
+ 10, // 2: p2p.StreamSampleContent.samples:type_name -> p2p.StreamSampleContent.SamplesEntry
797
+ 3, // 3: p2p.StreamSample.data:type_name -> p2p.SampleData
798
+ 4, // 4: p2p.SampleData.tensor_data:type_name -> p2p.TensorData
799
+ 5, // 5: p2p.SampleData.image_data:type_name -> p2p.ImageData
800
+ 6, // 6: p2p.SampleData.text_data:type_name -> p2p.TextData
801
+ 7, // 7: p2p.SampleData.file_data:type_name -> p2p.FileData
802
+ 11, // 8: p2p.StatUpdate.value:type_name -> google.protobuf.Value
803
+ 8, // 9: p2p.StatBatch.updates:type_name -> p2p.StatUpdate
804
+ 2, // 10: p2p.StreamSampleContent.SamplesEntry.value:type_name -> p2p.StreamSample
805
+ 11, // [11:11] is the sub-list for method output_type
806
+ 11, // [11:11] is the sub-list for method input_type
807
+ 11, // [11:11] is the sub-list for extension type_name
808
+ 11, // [11:11] is the sub-list for extension extendee
809
+ 0, // [0:11] is the sub-list for field type_name
810
+ }
811
+
812
+ func init() { file_message_proto_init() }
813
+ func file_message_proto_init() {
814
+ if File_message_proto != nil {
815
+ return
816
+ }
817
+ file_message_proto_msgTypes[0].OneofWrappers = []any{
818
+ (*Message_StreamSample)(nil),
819
+ (*Message_JsonContent)(nil),
820
+ (*Message_StatsUpdate)(nil),
821
+ }
822
+ file_message_proto_msgTypes[2].OneofWrappers = []any{}
823
+ file_message_proto_msgTypes[3].OneofWrappers = []any{
824
+ (*SampleData_TensorData)(nil),
825
+ (*SampleData_ImageData)(nil),
826
+ (*SampleData_TextData)(nil),
827
+ (*SampleData_FileData)(nil),
828
+ }
829
+ type x struct{}
830
+ out := protoimpl.TypeBuilder{
831
+ File: protoimpl.DescBuilder{
832
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
833
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_message_proto_rawDesc), len(file_message_proto_rawDesc)),
834
+ NumEnums: 0,
835
+ NumMessages: 11,
836
+ NumExtensions: 0,
837
+ NumServices: 0,
838
+ },
839
+ GoTypes: file_message_proto_goTypes,
840
+ DependencyIndexes: file_message_proto_depIdxs,
841
+ MessageInfos: file_message_proto_msgTypes,
842
+ }.Build()
843
+ File_message_proto = out.File
844
+ file_message_proto_goTypes = nil
845
+ file_message_proto_depIdxs = nil
846
+ }