ai.muna.muna 0.0.47 → 0.0.49

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 (83) hide show
  1. package/Plugins/Android/Muna.aar +0 -0
  2. package/Plugins/Linux/arm64/libFunction.so +0 -0
  3. package/Plugins/Linux/x86_64/libFunction.so +0 -0
  4. package/Plugins/Web/libFunction.a +0 -0
  5. package/Plugins/Windows/arm64/Function.dll +0 -0
  6. package/Plugins/Windows/x86_64/Function.dll +0 -0
  7. package/Plugins/iOS/Function.xcframework/Info.plist +10 -12
  8. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Function +0 -0
  9. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNConfiguration.h +15 -15
  10. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPrediction.h +8 -8
  11. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPredictionStream.h +3 -3
  12. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPredictor.h +5 -5
  13. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNStatus.h +1 -1
  14. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNValue.h +117 -33
  15. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNValueList.h +87 -0
  16. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNValueMap.h +8 -37
  17. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNVersion.h +3 -3
  18. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/Function.h +2 -1
  19. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Info.plist +0 -0
  20. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/_CodeSignature/CodeResources +30 -19
  21. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Function +0 -0
  22. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNConfiguration.h +313 -0
  23. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNPrediction.h +165 -0
  24. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNPredictionStream.h +63 -0
  25. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNPredictor.h +108 -0
  26. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNStatus.h +42 -0
  27. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNValue.h +479 -0
  28. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNValueList.h +87 -0
  29. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNValueMap.h +119 -0
  30. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/FXNVersion.h +26 -0
  31. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Headers/Function.h +19 -0
  32. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Info.plist +0 -0
  33. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/Modules/module.modulemap +6 -0
  34. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/PrivacyInfo.xcprivacy +36 -0
  35. package/Plugins/iOS/Function.xcframework/ios-arm64-simulator/Function.framework/_CodeSignature/CodeResources +234 -0
  36. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Function +0 -0
  37. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNConfiguration.h +15 -15
  38. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPrediction.h +8 -8
  39. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPredictionStream.h +3 -3
  40. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPredictor.h +5 -5
  41. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNStatus.h +1 -1
  42. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNValue.h +117 -33
  43. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNValueList.h +87 -0
  44. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNValueMap.h +8 -37
  45. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNVersion.h +3 -3
  46. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/Function.h +2 -1
  47. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Info.plist +0 -0
  48. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/_CodeSignature/CodeResources +30 -19
  49. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Function +0 -0
  50. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNConfiguration.h +313 -0
  51. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNPrediction.h +165 -0
  52. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNPredictionStream.h +63 -0
  53. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNPredictor.h +108 -0
  54. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNStatus.h +42 -0
  55. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNValue.h +479 -0
  56. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNValueList.h +87 -0
  57. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNValueMap.h +119 -0
  58. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/FXNVersion.h +26 -0
  59. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Headers/Function.h +19 -0
  60. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Info.plist +0 -0
  61. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/Modules/module.modulemap +6 -0
  62. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/PrivacyInfo.xcprivacy +36 -0
  63. package/Plugins/iOS/Function.xcframework/xros-arm64-simulator/Function.framework/_CodeSignature/CodeResources +234 -0
  64. package/Plugins/macOS/Function.dylib +0 -0
  65. package/README.md +1 -1
  66. package/Runtime/C/Configuration.cs +3 -3
  67. package/Runtime/C/Function.cs +25 -5
  68. package/Runtime/C/PredictionStream.cs +1 -1
  69. package/Runtime/C/Predictor.cs +1 -1
  70. package/Runtime/C/Value.cs +18 -4
  71. package/Runtime/C/ValueList.cs +40 -0
  72. package/Runtime/C/ValueList.cs.meta +2 -0
  73. package/Runtime/C/ValueMap.cs +2 -2
  74. package/Runtime/Muna.cs +1 -1
  75. package/Runtime/Types/Dtype.cs +29 -24
  76. package/Runtime/Types/Image.cs +1 -1
  77. package/Runtime/Types/Parameter.cs +1 -1
  78. package/Runtime/Types/Prediction.cs +1 -1
  79. package/Runtime/Types/Predictor.cs +1 -1
  80. package/Runtime/Types/Tensor.cs +1 -1
  81. package/Runtime/Types/User.cs +1 -1
  82. package/Unity/Internal/PredictionCache.cs +10 -9
  83. package/package.json +1 -1
@@ -0,0 +1,479 @@
1
+ //
2
+ // FXNValue.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 5/27/2023.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdint.h>
12
+ #include <Function/FXNStatus.h>
13
+
14
+ #pragma region --Enumerations--
15
+ /*!
16
+ @enum FXNDtype
17
+
18
+ @abstract Value data type.
19
+
20
+ @constant FXN_DTYPE_NULL
21
+ Null or undefined.
22
+
23
+ @constant FXN_DTYPE_FLOAT16
24
+ IEEE 754 half precision 16-bit float.
25
+
26
+ @constant FXN_DTYPE_FLOAT32
27
+ IEEE 754 single precision 32-bit float.
28
+
29
+ @constant FXN_DTYPE_FLOAT64
30
+ IEEE 754 double precision 64-bit float.
31
+
32
+ @constant FXN_DTYPE_INT8
33
+ Signed 8-bit integer.
34
+
35
+ @constant FXN_DTYPE_INT16
36
+ Signed 16-bit integer.
37
+
38
+ @constant FXN_DTYPE_INT32
39
+ Signed 32-bit integer.
40
+
41
+ @constant FXN_DTYPE_INT64
42
+ Signed 64-bit integer.
43
+
44
+ @constant FXN_DTYPE_UINT8
45
+ Unsigned 8-bit integer.
46
+
47
+ @constant FXN_DTYPE_UINT16
48
+ Unsigned 16-bit integer.
49
+
50
+ @constant FXN_DTYPE_UINT32
51
+ Unsigned 32-bit integer.
52
+
53
+ @constant FXN_DTYPE_UINT64
54
+ Unsigned 64-bit integer.
55
+
56
+ @constant FXN_DTYPE_BOOL
57
+ 8-bit boolean where zero is `false` and non-zero is `true`.
58
+
59
+ @constant FXN_DTYPE_STRING
60
+ UTF-8 encoded string.
61
+
62
+ @constant FXN_DTYPE_LIST
63
+ JSON-serializable list.
64
+
65
+ @constant FXN_DTYPE_DICT
66
+ JSON-serializable dictionary.
67
+
68
+ @constant FXN_DTYPE_IMAGE
69
+ Pixel buffer with 8 bits per intensity, interleaved by channel.
70
+
71
+ @constant FXN_DTYPE_BINARY
72
+ Binary blob.
73
+
74
+ @constant FXN_DTYPE_BFLOAT16
75
+ 16-bit brain float.
76
+
77
+ @constant FXN_DTYPE_VALUE_LIST
78
+ Prediction value list.
79
+
80
+ @constant FXN_DTYPE_VALUE_MAP
81
+ Prediction value map.
82
+ */
83
+ enum FXNDtype {
84
+ FXN_DTYPE_NULL = 0,
85
+ FXN_DTYPE_FLOAT16 = 1,
86
+ FXN_DTYPE_FLOAT32 = 2,
87
+ FXN_DTYPE_FLOAT64 = 3,
88
+ FXN_DTYPE_INT8 = 4,
89
+ FXN_DTYPE_INT16 = 5,
90
+ FXN_DTYPE_INT32 = 6,
91
+ FXN_DTYPE_INT64 = 7,
92
+ FXN_DTYPE_UINT8 = 8,
93
+ FXN_DTYPE_UINT16 = 9,
94
+ FXN_DTYPE_UINT32 = 10,
95
+ FXN_DTYPE_UINT64 = 11,
96
+ FXN_DTYPE_BOOL = 12,
97
+ FXN_DTYPE_STRING = 13,
98
+ FXN_DTYPE_LIST = 14,
99
+ FXN_DTYPE_DICT = 15,
100
+ FXN_DTYPE_IMAGE = 16,
101
+ FXN_DTYPE_BINARY = 17,
102
+ FXN_DTYPE_BFLOAT16 = 18,
103
+ FXN_DTYPE_VALUE_LIST = 19,
104
+ FXN_DTYPE_VALUE_MAP = 20,
105
+ };
106
+ typedef enum FXNDtype FXNDtype;
107
+
108
+ /*!
109
+ @enum FXNValueFlags
110
+
111
+ @abstract Value flags.
112
+
113
+ @constant FXN_VALUE_FLAG_NONE
114
+ No flags.
115
+
116
+ @constant FXN_VALUE_FLAG_COPY_DATA
117
+ Copy input data when creating the value.
118
+ When this flag is not set, the value data MUST remain valid for the lifetime of the created value.
119
+ */
120
+ enum FXNValueFlags {
121
+ FXN_VALUE_FLAG_NONE = 0,
122
+ FXN_VALUE_FLAG_COPY_DATA = 1,
123
+ };
124
+ typedef enum FXNValueFlags FXNValueFlags;
125
+ #pragma endregion
126
+
127
+
128
+ #pragma region --Types--
129
+ /*!
130
+ @struct FXNValue
131
+
132
+ @abstract Prediction input or output value.
133
+
134
+ @discussion Prediction input or output value.
135
+ */
136
+ struct FXNValue;
137
+ typedef struct FXNValue FXNValue;
138
+ #pragma endregion
139
+
140
+
141
+ #pragma region --Lifecycle--
142
+ /*!
143
+ @function FXNValueRelease
144
+
145
+ @abstract Release a value.
146
+
147
+ @discussion Release a value.
148
+
149
+ @param value
150
+ Value.
151
+ */
152
+ FXN_API FXNStatus FXNValueRelease(FXNValue* value);
153
+ #pragma endregion
154
+
155
+
156
+ #pragma region --Operations--
157
+ /*!
158
+ @function FXNValueGetData
159
+
160
+ @abstract Get the value data.
161
+
162
+ @discussion Get the value data.
163
+
164
+ @param value
165
+ Value.
166
+
167
+ @param data
168
+ Opaque pointer to value data.
169
+ */
170
+ FXN_API FXNStatus FXNValueGetData(
171
+ FXNValue* value,
172
+ void** data
173
+ );
174
+
175
+ /*!
176
+ @function FXNValueGetType
177
+
178
+ @abstract Get the data type of a given value.
179
+
180
+ @discussion Get the data type of a given valuie.
181
+
182
+ @param value
183
+ Value.
184
+
185
+ @param type
186
+ Value data type.
187
+ */
188
+ FXN_API FXNStatus FXNValueGetType(
189
+ FXNValue* value,
190
+ FXNDtype* type
191
+ );
192
+
193
+ /*!
194
+ @function FXNValueGetDimensions
195
+
196
+ @abstract Get the number of dimensions for a given value.
197
+
198
+ @discussion Get the number of dimensions for a given value.
199
+ If the type is not a tensor, this function will return zero.
200
+
201
+ @param value
202
+ Value.
203
+
204
+ @param dimensions
205
+ Number of dimensions for a given value.
206
+ */
207
+ FXN_API FXNStatus FXNValueGetDimensions(
208
+ FXNValue* value,
209
+ int32_t* dimensions
210
+ );
211
+
212
+ /*!
213
+ @function FXNValueGetShape
214
+
215
+ @abstract Get the shape of a given value.
216
+
217
+ @discussion Get the shape of a given value.
218
+
219
+ @param value
220
+ Value.
221
+
222
+ @param shape
223
+ Destination shape array.
224
+
225
+ @param shapeLen
226
+ Length of the destination array in elements.
227
+ */
228
+ FXN_API FXNStatus FXNValueGetShape(
229
+ FXNValue* value,
230
+ int32_t* shape,
231
+ int32_t shapeLen
232
+ );
233
+ #pragma endregion
234
+
235
+
236
+ #pragma region --Constructors--
237
+ /*!
238
+ @function FXNValueCreateArray
239
+
240
+ @abstract Create an array value from a data buffer.
241
+
242
+ @discussion Create an array value from a data buffer.
243
+
244
+ @param data
245
+ Array data.
246
+ Can be `NULL` in which case the value will allocate its own memory.
247
+
248
+ @param shape
249
+ Array shape.
250
+ Can be `NULL` for scalar values.
251
+
252
+ @param dims
253
+ Number of dimensions in `shape`.
254
+ Zero dims indicates a scalar value.
255
+
256
+ @param dtype
257
+ Value data type.
258
+
259
+ @param flags
260
+ Value creation flags.
261
+
262
+ @param value
263
+ Created value.
264
+ */
265
+ FXN_API FXNStatus FXNValueCreateArray(
266
+ void* data,
267
+ const int32_t* shape,
268
+ int32_t dims,
269
+ FXNDtype dtype,
270
+ FXNValueFlags flags,
271
+ FXNValue** value
272
+ );
273
+
274
+ /*!
275
+ @function FXNValueCreateString
276
+
277
+ @abstract Create a string value from a UTF-8 encoded string.
278
+
279
+ @discussion Create a string value from a UTF-8 encoded string.
280
+
281
+ @param data
282
+ UTF-8 encoded string.
283
+
284
+ @param value
285
+ Created value.
286
+ */
287
+ FXN_API FXNStatus FXNValueCreateString(
288
+ const char* data,
289
+ FXNValue** value
290
+ );
291
+
292
+ /*!
293
+ @function FXNValueCreateList
294
+
295
+ @abstract Create a list value from a JSON-encoded list.
296
+
297
+ @discussion Create a list value from a JSON-encoded list.
298
+
299
+ @param data
300
+ JSON-encoded list.
301
+
302
+ @param value
303
+ Created value.
304
+ */
305
+ FXN_API FXNStatus FXNValueCreateList(
306
+ const char* data,
307
+ FXNValue** value
308
+ );
309
+
310
+ /*!
311
+ @function FXNValueCreateDict
312
+
313
+ @abstract Create a dictionary value from a JSON-encoded dictionary.
314
+
315
+ @discussion Create a dictionary value from a JSON-encoded dictionary.
316
+
317
+ @param data
318
+ JSON-encoded dictionary.
319
+
320
+ @param value
321
+ Created value.
322
+ */
323
+ FXN_API FXNStatus FXNValueCreateDict(
324
+ const char* data,
325
+ FXNValue** value
326
+ );
327
+
328
+ /*!
329
+ @function FXNValueCreateImage
330
+
331
+ @abstract Create an image value from a pixel buffer.
332
+
333
+ @discussion Create an image value from a pixel buffer.
334
+ The pixel buffer MUST have an interleaved R8 (8bpp), RGB888 (24bpp), or RGBA8888 layout (32bpp).
335
+
336
+ @param pixelBuffer
337
+ Pixel buffer.
338
+
339
+ @param width
340
+ Pixel buffer width.
341
+
342
+ @param height
343
+ Pixel buffer height.
344
+
345
+ @param channels
346
+ Pixel buffer channels.
347
+ MUST be 1, 3, or 4.
348
+
349
+ @param flags
350
+ Value creation flags.
351
+
352
+ @param value
353
+ Created value.
354
+ The value `type` will be `FXN_DTYPE_IMAGE`.
355
+ The value `shape` will be `(H,W,C)`.
356
+ */
357
+ FXN_API FXNStatus FXNValueCreateImage(
358
+ const uint8_t* pixelBuffer,
359
+ int32_t width,
360
+ int32_t height,
361
+ int32_t channels,
362
+ FXNValueFlags flags,
363
+ FXNValue** value
364
+ );
365
+
366
+ /*!
367
+ @function FXNValueCreateBinary
368
+
369
+ @abstract Create a binary value from a raw buffer.
370
+
371
+ @discussion Create a binary value from a raw buffer.
372
+
373
+ @param buffer
374
+ Buffer.
375
+
376
+ @param bufferLen
377
+ Buffer length in bytes.
378
+
379
+ @param flags
380
+ Value creation flags.
381
+
382
+ @param value
383
+ Created value.
384
+ */
385
+ FXN_API FXNStatus FXNValueCreateBinary(
386
+ const void* buffer,
387
+ int32_t bufferLen, // CHECK // max buffer size becomes 2GB
388
+ FXNValueFlags flags,
389
+ FXNValue** value
390
+ );
391
+
392
+ /*!
393
+ @function FXNValueCreateNull
394
+
395
+ @abstract Create a null value.
396
+
397
+ @discussion Create a null value.
398
+
399
+ @param value
400
+ Created value.
401
+ */
402
+ FXN_API FXNStatus FXNValueCreateNull(FXNValue** value);
403
+
404
+ /*!
405
+ @function FXNValueCreateValueList
406
+
407
+ @abstract Create a value list.
408
+
409
+ @discussion Create a value list.
410
+
411
+ @param value
412
+ Created value.
413
+ */
414
+ FXN_API FXNStatus FXNValueCreateValueList(FXNValue** value);
415
+
416
+ /*!
417
+ @function FXNValueCreateValueMap
418
+
419
+ @abstract Create a value map.
420
+
421
+ @discussion Create a value map.
422
+
423
+ @param value
424
+ Created value.
425
+ */
426
+ FXN_API FXNStatus FXNValueCreateValueMap(FXNValue** value);
427
+
428
+ /*!
429
+ @function FXNValueCreateSerializedValue
430
+
431
+ @abstract Serialize a value.
432
+
433
+ @discussion Serialize a value.
434
+
435
+ @param value
436
+ Value.
437
+
438
+ @param mime
439
+ Target MIME type.
440
+ Pass `NULL` to use the default MIME type for the value type.
441
+
442
+ @param result
443
+ Serialized value.
444
+ */
445
+ FXN_API FXNStatus FXNValueCreateSerializedValue(
446
+ FXNValue* value,
447
+ const char* mime,
448
+ FXNValue** result
449
+ );
450
+
451
+ /*!
452
+ @function FXNValueCreateFromSerializedValue
453
+
454
+ @abstract Create a value by deserializing a serialized value.
455
+
456
+ @discussion Create a value by deserializing a serialized value.
457
+
458
+ For serialized image data, the value will have shape `(H,W,C)`.
459
+ Supported formats: PNG, JPEG (auto-detected from buffer).
460
+
461
+ For serialized audio data, the value will have shape `(F,C)`.
462
+ Audio samples are normalized to [-1.0, 1.0] in interleaved layout.
463
+ Supported formats: WAV, MP3, FLAC, AAC, Opus (auto-detected from buffer).
464
+
465
+ @param value
466
+ Value containing encoded data.
467
+
468
+ @param mime
469
+ Value MIME type.
470
+
471
+ @param result
472
+ Deserialized value.
473
+ */
474
+ FXN_API FXNStatus FXNValueCreateFromSerializedValue(
475
+ FXNValue* value,
476
+ const char* mime,
477
+ FXNValue** result
478
+ );
479
+ #pragma endregion
@@ -0,0 +1,87 @@
1
+ //
2
+ // FXNValueList.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 12/21/2025.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdbool.h>
12
+ #include <Function/FXNValue.h>
13
+
14
+ #pragma region --Types--
15
+ /*!
16
+ @struct FXNValueList
17
+
18
+ @abstract Prediction value list.
19
+
20
+ @discussion Prediction value list.
21
+ */
22
+ typedef FXNValue FXNValueList;
23
+ #pragma endregion
24
+
25
+
26
+ #pragma region --Operations--
27
+ /*!
28
+ @function FXNValueListGetSize
29
+
30
+ @abstract Get the size of the value list.
31
+
32
+ @discussion Get the size of the value list.
33
+
34
+ @param list
35
+ Prediction value list.
36
+
37
+ @param size
38
+ Output size. MUST NOT be `NULL`.
39
+ */
40
+ FXN_API FXNStatus FXNValueListGetSize(
41
+ FXNValueList* list,
42
+ int32_t* size
43
+ );
44
+
45
+ /*!
46
+ @function FXNValueListGetValue
47
+
48
+ @abstract Get the value for a given key in the value list.
49
+
50
+ @discussion Get the value for a given key in the value list.
51
+
52
+ @param list
53
+ Prediction value list.
54
+
55
+ @param index
56
+ Value index.
57
+
58
+ @param value
59
+ Output value. MUST NOT be `NULL`.
60
+ */
61
+ FXN_API FXNStatus FXNValueListGetValue(
62
+ FXNValueList* list,
63
+ int32_t index,
64
+ FXNValue** value
65
+ );
66
+
67
+ /*!
68
+ @function FXNValueListAppendValue
69
+
70
+ @abstract Append a value to a value list.
71
+
72
+ @discussion Append a value to a value list.
73
+
74
+ NOTE: The value list takes ownership of the value.
75
+ As such, you must not call `FXNValueRelease` on the value.
76
+
77
+ @param list
78
+ Prediction value map.
79
+
80
+ @param value
81
+ Value.
82
+ */
83
+ FXN_API FXNStatus FXNValueListAppendValue(
84
+ FXNValueList* list,
85
+ FXNValue* value
86
+ );
87
+ #pragma endregion
@@ -0,0 +1,119 @@
1
+ //
2
+ // FXNValueMap.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 10/14/2023.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdbool.h>
12
+ #include <Function/FXNValue.h>
13
+
14
+ #pragma region --Types--
15
+ /*!
16
+ @struct FXNValueMap
17
+
18
+ @abstract Prediction value map.
19
+
20
+ @discussion Prediction value map.
21
+ */
22
+ typedef FXNValue FXNValueMap;
23
+ #pragma endregion
24
+
25
+
26
+ #pragma region --Operations--
27
+ /*!
28
+ @function FXNValueMapGetSize
29
+
30
+ @abstract Get the size of the value map.
31
+
32
+ @discussion Get the size of the value map.
33
+
34
+ @param map
35
+ Prediction value map.
36
+
37
+ @param size
38
+ Output size. MUST NOT be `NULL`.
39
+ */
40
+ FXN_API FXNStatus FXNValueMapGetSize(
41
+ FXNValueMap* map,
42
+ int32_t* size
43
+ );
44
+
45
+ /*!
46
+ @function FXNValueMapGetKey
47
+
48
+ @abstract Get the key at a given index in the value map.
49
+
50
+ @discussion Get the key at a given index in the value map.
51
+
52
+ @param map
53
+ Prediction value map.
54
+
55
+ @param index
56
+ Key index. Must be less than the value map size.
57
+
58
+ @param key
59
+ Destination UTF-8 encoded key string.
60
+
61
+ @param size
62
+ Size of destination buffer.
63
+ */
64
+ FXN_API FXNStatus FXNValueMapGetKey(
65
+ FXNValueMap* map,
66
+ int32_t index,
67
+ char* key,
68
+ int32_t size
69
+ );
70
+
71
+ /*!
72
+ @function FXNValueMapGetValue
73
+
74
+ @abstract Get the value for a given key in the value map.
75
+
76
+ @discussion Get the value for a given key in the value map.
77
+
78
+ @param map
79
+ Prediction value map.
80
+
81
+ @param key
82
+ Value key.
83
+
84
+ @param value
85
+ Output value. MUST NOT be `NULL`.
86
+
87
+ @returns `FXN_OK` if the value map contains a value for the given key else `FXN_ERROR_INVALID_ARGUMENT`.
88
+ */
89
+ FXN_API FXNStatus FXNValueMapGetValue(
90
+ FXNValueMap* map,
91
+ const char* key,
92
+ FXNValue** value
93
+ );
94
+
95
+ /*!
96
+ @function FXNValueMapSetValue
97
+
98
+ @abstract Set the value for a given key in the value map.
99
+
100
+ @discussion Set the value for a given key in the value map.
101
+
102
+ NOTE: The value map takes ownership of the value.
103
+ As such, you must not call `FXNValueRelease` on the value.
104
+
105
+ @param map
106
+ Prediction value map.
107
+
108
+ @param key
109
+ Value key.
110
+
111
+ @param value
112
+ Value. Pass `NULL` to remove the value from the map if present.
113
+ */
114
+ FXN_API FXNStatus FXNValueMapSetValue(
115
+ FXNValueMap* map,
116
+ const char* key,
117
+ FXNValue* value
118
+ );
119
+ #pragma endregion
@@ -0,0 +1,26 @@
1
+ //
2
+ // FXNVersion.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 10/14/2023.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <Function/FXNStatus.h>
12
+
13
+ #define FXN_VERSION_MAJOR 0
14
+ #define FXN_VERSION_MINOR 0
15
+ #define FXN_VERSION_PATCH 39
16
+
17
+ /*!
18
+ @function FXNGetVersion
19
+
20
+ @abstract Get the Function version.
21
+
22
+ @discussion Get the Function version.
23
+
24
+ @returns Function version string.
25
+ */
26
+ FXN_API const char* FXNGetVersion();
@@ -0,0 +1,19 @@
1
+ //
2
+ // Function.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 5/27/2023.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <Function/FXNStatus.h>
12
+ #include <Function/FXNValue.h>
13
+ #include <Function/FXNValueList.h>
14
+ #include <Function/FXNValueMap.h>
15
+ #include <Function/FXNConfiguration.h>
16
+ #include <Function/FXNPrediction.h>
17
+ #include <Function/FXNPredictionStream.h>
18
+ #include <Function/FXNPredictor.h>
19
+ #include <Function/FXNVersion.h>