ai.muna.muna 0.0.48 → 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 -5
  83. package/package.json +1 -1
@@ -0,0 +1,313 @@
1
+ //
2
+ // FXNConfiguration.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 FXNAcceleration
17
+
18
+ @abstract Hardware acceleration used for predictions.
19
+
20
+ @constant FXN_ACCELERATION_AUTO
21
+ Use the optimal acceleration for the current device.
22
+
23
+ @constant FXN_ACCELERATION_CPU
24
+ Use the CPU.
25
+
26
+ @constant FXN_ACCELERATION_GPU
27
+ Use the GPU.
28
+
29
+ @constant FXN_ACCELERATION_NPU
30
+ Use the neural processing unit.
31
+ */
32
+ enum FXNAcceleration {
33
+ FXN_ACCELERATION_AUTO = 0,
34
+ FXN_ACCELERATION_CPU = 1 << 0,
35
+ FXN_ACCELERATION_GPU = 1 << 1,
36
+ FXN_ACCELERATION_NPU = 1 << 2,
37
+ };
38
+ typedef enum FXNAcceleration FXNAcceleration;
39
+ #pragma endregion
40
+
41
+
42
+ #pragma region --Types--
43
+ /*!
44
+ @struct FXNConfiguration
45
+
46
+ @abstract Opaque type for predictor configuration.
47
+ */
48
+ struct FXNConfiguration;
49
+ typedef struct FXNConfiguration FXNConfiguration;
50
+
51
+ /*!
52
+ @typedef FXNConfigurationAddResourceHandler
53
+
54
+ @abstract Callback invoked when a configuration resource has been loaded.
55
+
56
+ @param context
57
+ User context.
58
+
59
+ @param status
60
+ Result status.
61
+ */
62
+ typedef void (*FXNConfigurationAddResourceHandler)(
63
+ void* context,
64
+ FXNStatus status
65
+ );
66
+ #pragma endregion
67
+
68
+
69
+ #pragma region --Lifecycle--
70
+ /*!
71
+ @function FXNConfigurationGetUniqueID
72
+
73
+ @abstract Get the configuration unique identifier.
74
+
75
+ @discussion Get the configuration unique identifier.
76
+
77
+ @param identifier
78
+ Configuration unique identifier.
79
+
80
+ @param size
81
+ Identifier size.
82
+ */
83
+ FXN_API FXNStatus FXNConfigurationGetUniqueID(
84
+ char* identifier,
85
+ int32_t size
86
+ );
87
+
88
+ /*!
89
+ @function FXNConfigurationGetClientID
90
+
91
+ @abstract Get the configuration client identifier.
92
+
93
+ @discussion Get the configuration client identifier.
94
+
95
+ @param identifier
96
+ Configuration client identifier.
97
+
98
+ @param size
99
+ Identifier size.
100
+ */
101
+ FXN_API FXNStatus FXNConfigurationGetClientID(
102
+ char* identifier,
103
+ int32_t size
104
+ );
105
+
106
+ /*!
107
+ @function FXNConfigurationCreate
108
+
109
+ @abstract Create a predictor configuration.
110
+
111
+ @discussion Create a predictor configuration.
112
+
113
+ @param configuration
114
+ Created configuration. MUST NOT be `NULL`.
115
+ */
116
+ FXN_API FXNStatus FXNConfigurationCreate(FXNConfiguration** configuration);
117
+
118
+ /*!
119
+ @function FXNConfigurationRelease
120
+
121
+ @abstract Release the predictor configuration.
122
+
123
+ @discussion Release the predictor configuration.
124
+
125
+ @param configuration
126
+ Predictor configuration.
127
+ */
128
+ FXN_API FXNStatus FXNConfigurationRelease(FXNConfiguration* configuration);
129
+ #pragma endregion
130
+
131
+
132
+ #pragma region --Configuration--
133
+ /*!
134
+ @function FXNConfigurationGetTag
135
+
136
+ @abstract Get the predictor tag.
137
+
138
+ @discussion Get the predictor tag.
139
+
140
+ @param configuration
141
+ Predictor configuration.
142
+
143
+ @param tag
144
+ Destination buffer.
145
+
146
+ @param size
147
+ Size of destination buffer.
148
+ */
149
+ FXN_API FXNStatus FXNConfigurationGetTag(
150
+ FXNConfiguration* configuration,
151
+ char* tag,
152
+ int32_t size
153
+ );
154
+
155
+ /*!
156
+ @function FXNConfigurationSetTag
157
+
158
+ @abstract Set the predictor tag.
159
+
160
+ @discussion Set the predictor tag.
161
+ This is requried for Function to load the predictor.
162
+
163
+ @param configuration
164
+ Predictor configuration.
165
+
166
+ @param tag
167
+ Predictor tag.
168
+ */
169
+ FXN_API FXNStatus FXNConfigurationSetTag(
170
+ FXNConfiguration* configuration,
171
+ const char* tag
172
+ );
173
+
174
+ /*!
175
+ @function FXNConfigurationGetToken
176
+
177
+ @abstract Get the configuration token.
178
+
179
+ @discussion Get the configuration token.
180
+
181
+ @param configuration
182
+ Predictor configuration.
183
+
184
+ @param token
185
+ Destination buffer.
186
+
187
+ @param size
188
+ Size of destination buffer.
189
+ */
190
+ FXN_API FXNStatus FXNConfigurationGetToken(
191
+ FXNConfiguration* configuration,
192
+ char* token,
193
+ int32_t size
194
+ );
195
+
196
+ /*!
197
+ @function FXNConfigurationSetToken
198
+
199
+ @abstract Set the configuration token.
200
+
201
+ @discussion Set the configuration token.
202
+ This is requried for Function to load the predictor.
203
+
204
+ @param configuration
205
+ Predictor configuration.
206
+
207
+ @param token
208
+ Configuration token.
209
+ */
210
+ FXN_API FXNStatus FXNConfigurationSetToken(
211
+ FXNConfiguration* configuration,
212
+ const char* token
213
+ );
214
+
215
+ /*!
216
+ @function FXNConfigurationGetAcceleration
217
+
218
+ @abstract Get the acceleration used for making predictions.
219
+
220
+ @discussion Get the acceleration used for making predictions.
221
+
222
+ @param configuration
223
+ Predictor configuration.
224
+
225
+ @param acceleration
226
+ Acceleration.
227
+ */
228
+ FXN_API FXNStatus FXNConfigurationGetAcceleration(
229
+ FXNConfiguration* configuration,
230
+ FXNAcceleration* acceleration
231
+ );
232
+
233
+ /*!
234
+ @function FXNConfigurationSetAcceleration
235
+
236
+ @abstract Specify the acceleration used for making predictions.
237
+
238
+ @discussion Specify the acceleration used for making predictions.
239
+
240
+ @param configuration
241
+ Predictor configuration.
242
+
243
+ @param acceleration
244
+ Acceleration used for making predictions predictions.
245
+ */
246
+ FXN_API FXNStatus FXNConfigurationSetAcceleration(
247
+ FXNConfiguration* configuration,
248
+ FXNAcceleration acceleration
249
+ );
250
+
251
+ /*!
252
+ @function FXNConfigurationGetDevice
253
+
254
+ @abstract Get the compute device used for compute acceleration.
255
+
256
+ @discussion Get the compute device used for compute acceleration.
257
+
258
+ @param configuration
259
+ Predictor configuration.
260
+
261
+ @param device
262
+ Compute device.
263
+ The type of this device is platform-dependent.
264
+ See https://docs.fxn.ai/workflows/realtime#specifying-the-acceleration-device for more information.
265
+ */
266
+ FXN_API FXNStatus FXNConfigurationGetDevice(
267
+ FXNConfiguration* configuration,
268
+ void** device
269
+ );
270
+
271
+ /*!
272
+ @function FXNConfigurationSetDevice
273
+
274
+ @abstract Specify the compute device used for compute acceleration.
275
+
276
+ @discussion Specify the compute device used for compute acceleration.
277
+
278
+ @param configuration
279
+ Predictor configuration.
280
+
281
+ @param device
282
+ Compute device.
283
+ The type of this device is platform-dependent.
284
+ Pass `NULL` to use the default compute device.
285
+ See https://docs.fxn.ai/workflows/realtime#specifying-the-acceleration-device for more information.
286
+ */
287
+ FXN_API FXNStatus FXNConfigurationSetDevice(
288
+ FXNConfiguration* configuration,
289
+ void* device
290
+ );
291
+
292
+ /*!
293
+ @function FXNConfigurationAddResource
294
+
295
+ @abstract Add a prediction resource.
296
+
297
+ @discussion Add a prediction resource.
298
+
299
+ @param configuration
300
+ Predictor configuration.
301
+
302
+ @param type
303
+ Resource type.
304
+
305
+ @param path
306
+ Resource path.
307
+ */
308
+ FXN_API FXNStatus FXNConfigurationAddResource(
309
+ FXNConfiguration* configuration,
310
+ const char* type,
311
+ const char* path
312
+ );
313
+ #pragma endregion
@@ -0,0 +1,165 @@
1
+ //
2
+ // FXNPrediction.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 11/23/2023.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdint.h>
12
+ #include <Function/FXNValueMap.h>
13
+
14
+ #pragma region --Types--
15
+ /*!
16
+ @struct FXNPrediction
17
+
18
+ @abstract Prediction.
19
+
20
+ @discussion Prediction.
21
+ */
22
+ struct FXNPrediction;
23
+ typedef struct FXNPrediction FXNPrediction;
24
+ #pragma endregion
25
+
26
+
27
+ #pragma region --Lifecycle--
28
+ /*!
29
+ @function FXNPredictionRelease
30
+
31
+ @abstract Release a prediction.
32
+
33
+ @discussion Release a prediction.
34
+
35
+ @param prediction
36
+ Prediction.
37
+ */
38
+ FXN_API FXNStatus FXNPredictionRelease(FXNPrediction* prediction);
39
+ #pragma endregion
40
+
41
+
42
+ #pragma region --Operations--
43
+ /*!
44
+ @function FXNPredictionGetID
45
+
46
+ @abstract Get the prediction ID.
47
+
48
+ @discussion Get the prediction ID.
49
+
50
+ @param prediction
51
+ Prediction.
52
+
53
+ @param destination
54
+ Destination buffer.
55
+
56
+ @param size
57
+ Destination buffer size.
58
+ */
59
+ FXN_API FXNStatus FXNPredictionGetID(
60
+ FXNPrediction* prediction,
61
+ char* destination,
62
+ int32_t size
63
+ );
64
+
65
+ /*!
66
+ @function FXNPredictionGetLatency
67
+
68
+ @abstract Get the prediction latency.
69
+
70
+ @discussion Get the prediction latency.
71
+
72
+ @param prediction
73
+ Prediction.
74
+
75
+ @param latency
76
+ Prediction latency in milliseconds.
77
+ */
78
+ FXN_API FXNStatus FXNPredictionGetLatency(
79
+ FXNPrediction* prediction,
80
+ double* latency
81
+ );
82
+
83
+ /*!
84
+ @function FXNPredictionGetResults
85
+
86
+ @abstract Get the prediction results.
87
+
88
+ @discussion Get the prediction results.
89
+
90
+ @param prediction
91
+ Prediction.
92
+
93
+ @param map
94
+ Prediction output value map. Do NOT release this value map as it is owned by the prediction.
95
+ */
96
+ FXN_API FXNStatus FXNPredictionGetResults(
97
+ FXNPrediction* prediction,
98
+ FXNValueMap** map
99
+ );
100
+
101
+ /*!
102
+ @function FXNPredictionGetError
103
+
104
+ @abstract Get the prediction error.
105
+
106
+ @discussion Get the prediction error.
107
+
108
+ @param prediction
109
+ Prediction.
110
+
111
+ @param error
112
+ Destination buffer.
113
+
114
+ @param size
115
+ Destination buffer size.
116
+
117
+ @returns `FXN_OK` if an error has been copied.
118
+ `FXN_ERROR_INVALID_OPERATION` if no error exists.
119
+ */
120
+ FXN_API FXNStatus FXNPredictionGetError(
121
+ FXNPrediction* prediction,
122
+ char* error,
123
+ int32_t size
124
+ );
125
+
126
+ /*!
127
+ @function FXNPredictionGetLogs
128
+
129
+ @abstract Get the prediction logs.
130
+
131
+ @discussion Get the prediction logs.
132
+
133
+ @param prediction
134
+ Prediction.
135
+
136
+ @param logs
137
+ Destination buffer.
138
+
139
+ @param size
140
+ Destination buffer size.
141
+ */
142
+ FXN_API FXNStatus FXNPredictionGetLogs(
143
+ FXNPrediction* prediction,
144
+ char* logs,
145
+ int32_t size
146
+ );
147
+
148
+ /*!
149
+ @function FXNPredictionGetLogLength
150
+
151
+ @abstract Get the prediction log length.
152
+
153
+ @discussion Get the prediction log length.
154
+
155
+ @param prediction
156
+ Prediction.
157
+
158
+ @param length
159
+ Logs length.
160
+ */
161
+ FXN_API FXNStatus FXNPredictionGetLogLength(
162
+ FXNPrediction* prediction,
163
+ int32_t* length
164
+ );
165
+ #pragma endregion
@@ -0,0 +1,63 @@
1
+ //
2
+ // FXNPredictionStream.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 4/19/2024.
6
+ // Copyright © 2026 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <Function/FXNPrediction.h>
12
+
13
+ #pragma region --Types--
14
+ /*!
15
+ @struct FXNPredictionStream
16
+
17
+ @abstract Prediction stream.
18
+
19
+ @discussion Prediction stream.
20
+ */
21
+ struct FXNPredictionStream;
22
+ typedef struct FXNPredictionStream FXNPredictionStream;
23
+ #pragma endregion
24
+
25
+
26
+ #pragma region --Lifecycle--
27
+ /*!
28
+ @function FXNPredictionStreamRelease
29
+
30
+ @abstract Release a prediction stream.
31
+
32
+ @discussion Release a prediction stream.
33
+
34
+ @param stream
35
+ Prediction stream.
36
+ */
37
+ FXN_API FXNStatus FXNPredictionStreamRelease(FXNPredictionStream* stream);
38
+ #pragma endregion
39
+
40
+
41
+ #pragma region --Operations--
42
+ /*!
43
+ @function FXNPredictionStreamReadNext
44
+
45
+ @abstract Read the next prediction in the stream.
46
+
47
+ @discussion Read the next prediction in the stream.
48
+
49
+ @param stream
50
+ Prediction stream.
51
+
52
+ @param prediction
53
+ Prediction.
54
+ You MUST release the prediction with `FXNPredictionRelease` when no longer needed.
55
+
56
+ @returns `FXN_OK` a prediction was successfully read from the stream.
57
+ `FXN_ERROR_INVALID_OPERATION` if the stream has no more predictions.
58
+ */
59
+ FXN_API FXNStatus FXNPredictionStreamReadNext(
60
+ FXNPredictionStream* stream,
61
+ FXNPrediction** prediction
62
+ );
63
+ #pragma endregion
@@ -0,0 +1,108 @@
1
+ //
2
+ // FXNPredictor.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/FXNConfiguration.h>
12
+ #include <Function/FXNPrediction.h>
13
+ #include <Function/FXNPredictionStream.h>
14
+
15
+ #pragma region --Types--
16
+ /*!
17
+ @struct FXNPredictor
18
+
19
+ @abstract Predictor.
20
+
21
+ @discussion Predictor.
22
+ */
23
+ struct FXNPredictor;
24
+ typedef struct FXNPredictor FXNPredictor;
25
+ #pragma endregion
26
+
27
+
28
+ #pragma region --Lifecycle--
29
+ /*!
30
+ @function FXNPredictorCreate
31
+
32
+ @abstract Create a predictor.
33
+
34
+ @discussion Create a predictor.
35
+
36
+ @param configuration
37
+ Predictor configuration.
38
+
39
+ @param predictor
40
+ Created predictor.
41
+ */
42
+ FXN_API FXNStatus FXNPredictorCreate(
43
+ FXNConfiguration* configuration,
44
+ FXNPredictor** predictor
45
+ );
46
+
47
+ /*!
48
+ @function FXNPredictorRelease
49
+
50
+ @abstract Release a predictor.
51
+
52
+ @discussion Release a predictor.
53
+
54
+ @param predictor
55
+ Predictor.
56
+ */
57
+ FXN_API FXNStatus FXNPredictorRelease(FXNPredictor* predictor);
58
+ #pragma endregion
59
+
60
+
61
+ #pragma region --Operations--
62
+ /*!
63
+ @function FXNPredictorCreatePrediction
64
+
65
+ @abstract Create a prediction.
66
+
67
+ @discussion Create a prediction.
68
+
69
+ @param predictor
70
+ Predictor.
71
+
72
+ @param inputs
73
+ Prediction inputs.
74
+
75
+ @param prediction
76
+ Prediction.
77
+ You MUST release the prediction with `FXNPredictionRelease` when no longer needed.
78
+ */
79
+ FXN_API FXNStatus FXNPredictorCreatePrediction(
80
+ FXNPredictor* predictor,
81
+ FXNValueMap* inputs,
82
+ FXNPrediction** prediction
83
+ );
84
+
85
+ /*!
86
+ @function FXNPredictorStreamPrediction
87
+
88
+ @abstract Create a streaming prediction.
89
+
90
+ @discussion Create a streaming prediction.
91
+ NOTE: This API is currently experimental.
92
+
93
+ @param predictor
94
+ Predictor.
95
+
96
+ @param inputs
97
+ Prediction inputs.
98
+
99
+ @param prediction
100
+ Prediction stream.
101
+ You MUST release the prediction stream with `FXNPredictionStreamRelease` when no longer needed.
102
+ */
103
+ FXN_API FXNStatus FXNPredictorStreamPrediction(
104
+ FXNPredictor* predictor,
105
+ FXNValueMap* inputs,
106
+ FXNPredictionStream** stream
107
+ );
108
+ #pragma endregion
@@ -0,0 +1,42 @@
1
+ //
2
+ // FXNStatus.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
+ #ifdef __cplusplus
12
+ #define FXN_API extern "C"
13
+ #else
14
+ #define FXN_API extern
15
+ #endif
16
+
17
+ #pragma region --Enumerations--
18
+ /*!
19
+ @enum FXNStatus
20
+
21
+ @abstract Function status codes.
22
+
23
+ @constant FXN_OK
24
+ Successful operation.
25
+
26
+ @constant FXN_ERROR_INVALID_ARGUMENT
27
+ Provided argument is invalid.
28
+
29
+ @constant FXN_ERROR_INVALID_OPERATION
30
+ Operation is invalid in current state.
31
+
32
+ @constant FXN_ERROR_NOT_IMPLEMENTED
33
+ Operation has not been implemented.
34
+ */
35
+ enum FXNStatus {
36
+ FXN_OK = 0,
37
+ FXN_ERROR_INVALID_ARGUMENT = 1,
38
+ FXN_ERROR_INVALID_OPERATION = 2,
39
+ FXN_ERROR_NOT_IMPLEMENTED = 3,
40
+ };
41
+ typedef enum FXNStatus FXNStatus;
42
+ #pragma endregion