ai.muna.muna 0.0.44 → 0.0.45

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 (37) hide show
  1. package/Editor/MunaMenu.cs +11 -1
  2. package/Plugins/Android/Muna.aar +0 -0
  3. package/README.md +1 -1
  4. package/Runtime/API/DotNetClient.cs +0 -3
  5. package/Runtime/Beta/BetaClient.cs +14 -1
  6. package/Runtime/Beta/OpenAI/AudioService.cs +38 -0
  7. package/Runtime/Beta/OpenAI/AudioService.cs.meta +11 -0
  8. package/Runtime/Beta/OpenAI/ChatService.cs +38 -0
  9. package/Runtime/Beta/OpenAI/ChatService.cs.meta +11 -0
  10. package/Runtime/Beta/OpenAI/CompletionService.cs +117 -0
  11. package/Runtime/Beta/OpenAI/CompletionService.cs.meta +11 -0
  12. package/Runtime/Beta/OpenAI/EmbeddingService.cs +252 -0
  13. package/Runtime/Beta/OpenAI/EmbeddingService.cs.meta +11 -0
  14. package/Runtime/Beta/OpenAI/OpenAIClient.cs +50 -0
  15. package/Runtime/Beta/OpenAI/OpenAIClient.cs.meta +11 -0
  16. package/Runtime/Beta/OpenAI/SpeechService.cs +250 -0
  17. package/Runtime/Beta/OpenAI/SpeechService.cs.meta +11 -0
  18. package/Runtime/Beta/OpenAI/Types.cs +365 -0
  19. package/Runtime/Beta/OpenAI/Types.cs.meta +11 -0
  20. package/Runtime/Beta/OpenAI.meta +8 -0
  21. package/Runtime/Beta/Remote/RemotePredictionService.cs +45 -66
  22. package/Runtime/Beta/{Value.cs → Remote/Value.cs} +3 -4
  23. package/Runtime/C/Configuration.cs +1 -1
  24. package/Runtime/C/Function.cs +1 -1
  25. package/Runtime/C/Prediction.cs +1 -1
  26. package/Runtime/C/PredictionStream.cs +1 -1
  27. package/Runtime/C/Predictor.cs +1 -1
  28. package/Runtime/C/Value.cs +3 -2
  29. package/Runtime/C/ValueMap.cs +1 -1
  30. package/Runtime/Muna.cs +2 -2
  31. package/Runtime/Types/Parameter.cs +75 -0
  32. package/Runtime/Types/Parameter.cs.meta +11 -0
  33. package/Runtime/Types/Predictor.cs +0 -53
  34. package/Unity/API/PredictionCacheClient.cs +1 -1
  35. package/Unity/MunaUnity.cs +0 -1
  36. package/package.json +1 -1
  37. /package/Runtime/Beta/{Value.cs.meta → Remote/Value.cs.meta} +0 -0
@@ -39,7 +39,7 @@ namespace Muna.Beta.Services {
39
39
  await Configuration.InitializationTask;
40
40
  var inputMap = (await Task.WhenAll(inputs.Select(async pair => (
41
41
  name: pair.Key,
42
- value: await ToValue(pair.Value, pair.Key)
42
+ value: await ToValue(pair.Value)
43
43
  )))).ToDictionary(pair => pair.name, pair => pair.value);
44
44
  var prediction = (await client.Request<RemotePrediction>(
45
45
  method: @"POST",
@@ -69,51 +69,47 @@ namespace Muna.Beta.Services {
69
69
 
70
70
  internal RemotePredictionService(MunaClient client) => this.client = client;
71
71
 
72
- private async Task<Value> ToValue( // INCOMPLETE // Image
73
- object? value,
74
- string name,
75
- int maxDataUrlSize = 4 * 1024 * 1024
76
- ) => value switch {
72
+ private async Task<Value> ToValue(object? value) => value switch { // INCOMPLETE // Image
77
73
  null => new Value { type = Dtype.Null },
78
- float x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float32, shape = new int[0] },
79
- double x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float64, shape = new int[0] },
80
- sbyte x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int8, shape = new int[0] },
81
- short x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int16, shape = new int[0] },
82
- int x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int32, shape = new int[0] },
83
- long x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int64, shape = new int[0] },
84
- byte x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint8, shape = new int[0] },
85
- ushort x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint16, shape = new int[0] },
86
- uint x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint32, shape = new int[0] },
87
- ulong x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint64, shape = new int[0] },
88
- bool x => new Value { data = await Upload(new [] { x }.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Bool, shape = new int[0] },
89
- float[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float32, shape = new [] { x.Length } },
90
- double[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float64, shape = new [] { x.Length } },
91
- sbyte[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int8, shape = new [] { x.Length } },
92
- short[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int16, shape = new [] { x.Length } },
93
- int[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int32, shape = new [] { x.Length } },
94
- long[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int64, shape = new [] { x.Length } },
95
- byte[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint8, shape = new [] { x.Length } },
96
- ushort[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint16, shape = new [] { x.Length } },
97
- uint[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint32, shape = new [] { x.Length } },
98
- ulong[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint64, shape = new [] { x.Length } },
99
- bool[] x => new Value { data = await Upload(x.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Bool, shape = new [] { x.Length } },
100
- Tensor<float> x => new Value { data = await Upload(x.data.ToStream(),name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float32, shape = x.shape },
101
- Tensor<double> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Float64, shape = x.shape },
102
- Tensor<sbyte> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int8, shape = x.shape },
103
- Tensor<short> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int16, shape = x.shape },
104
- Tensor<int> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int32, shape = x.shape },
105
- Tensor<long> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Int64, shape = x.shape },
106
- Tensor<byte> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint8, shape = x.shape },
107
- Tensor<ushort> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint16, shape = x.shape },
108
- Tensor<uint> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint32, shape = x.shape },
109
- Tensor<ulong> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Uint64, shape = x.shape },
110
- Tensor<bool> x => new Value { data = await Upload(x.data.ToStream(), name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Bool, shape = x.shape },
111
- string x => new Value { data = await Upload(x.ToStream(), name, mime: @"text/plain", maxDataUrlSize: maxDataUrlSize), type = Dtype.String },
112
- IList x => new Value { data = await Upload(JsonConvert.SerializeObject(x).ToStream(), name, mime: @"application/json", maxDataUrlSize: maxDataUrlSize), type = Dtype.List },
113
- IDictionary x => new Value { data = await Upload(JsonConvert.SerializeObject(x).ToStream(), name, mime: @"application/json", maxDataUrlSize: maxDataUrlSize), type = Dtype.Dict },
74
+ float x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Float32, shape = new int[0] },
75
+ double x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Float64, shape = new int[0] },
76
+ sbyte x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Int8, shape = new int[0] },
77
+ short x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Int16, shape = new int[0] },
78
+ int x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Int32, shape = new int[0] },
79
+ long x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Int64, shape = new int[0] },
80
+ byte x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Uint8, shape = new int[0] },
81
+ ushort x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Uint16, shape = new int[0] },
82
+ uint x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Uint32, shape = new int[0] },
83
+ ulong x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Uint64, shape = new int[0] },
84
+ bool x => new Value { data = await Upload(new [] { x }.ToStream()), type = Dtype.Bool, shape = new int[0] },
85
+ float[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Float32, shape = new [] { x.Length } },
86
+ double[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Float64, shape = new [] { x.Length } },
87
+ sbyte[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Int8, shape = new [] { x.Length } },
88
+ short[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Int16, shape = new [] { x.Length } },
89
+ int[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Int32, shape = new [] { x.Length } },
90
+ long[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Int64, shape = new [] { x.Length } },
91
+ byte[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Uint8, shape = new [] { x.Length } },
92
+ ushort[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Uint16, shape = new [] { x.Length } },
93
+ uint[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Uint32, shape = new [] { x.Length } },
94
+ ulong[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Uint64, shape = new [] { x.Length } },
95
+ bool[] x => new Value { data = await Upload(x.ToStream()), type = Dtype.Bool, shape = new [] { x.Length } },
96
+ Tensor<float> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Float32, shape = x.shape },
97
+ Tensor<double> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Float64, shape = x.shape },
98
+ Tensor<sbyte> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Int8, shape = x.shape },
99
+ Tensor<short> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Int16, shape = x.shape },
100
+ Tensor<int> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Int32, shape = x.shape },
101
+ Tensor<long> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Int64, shape = x.shape },
102
+ Tensor<byte> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Uint8, shape = x.shape },
103
+ Tensor<ushort> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Uint16, shape = x.shape },
104
+ Tensor<uint> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Uint32, shape = x.shape },
105
+ Tensor<ulong> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Uint64, shape = x.shape },
106
+ Tensor<bool> x => new Value { data = await Upload(x.data.ToStream()), type = Dtype.Bool, shape = x.shape },
107
+ string x => new Value { data = await Upload(x.ToStream(), mime: @"text/plain"), type = Dtype.String },
108
+ IList x => new Value { data = await Upload(JsonConvert.SerializeObject(x).ToStream(), mime: @"application/json"), type = Dtype.List },
109
+ IDictionary x => new Value { data = await Upload(JsonConvert.SerializeObject(x).ToStream(), mime: @"application/json"), type = Dtype.Dict },
114
110
  Image x => new Value { data = "", type = Dtype.Image },
115
- Stream x => new Value { data = await Upload(x, name, maxDataUrlSize: maxDataUrlSize), type = Dtype.Binary },
116
- Enum x => await ToValue(x.ToObject(), name, maxDataUrlSize: maxDataUrlSize),
111
+ Stream x => new Value { data = await Upload(x), type = Dtype.Binary },
112
+ Enum x => await ToValue(x.ToObject()),
117
113
  _ => throw new InvalidOperationException($"Failed to serialize value '{value}' of type `{value.GetType()}` because it is not supported"),
118
114
  };
119
115
 
@@ -142,24 +138,13 @@ namespace Muna.Beta.Services {
142
138
  };
143
139
  }
144
140
 
145
- private async Task<string> Upload(
141
+ private Task<string> Upload(
146
142
  Stream stream,
147
- string name,
148
- string? mime = @"application/octet-stream",
149
- int maxDataUrlSize = 4 * 1024 * 1024
143
+ string? mime = @"application/octet-stream"
150
144
  ) {
151
- if (stream.Length <= maxDataUrlSize) {
152
- var data = Convert.ToBase64String(stream.ToArray<byte>());
153
- var result = $"data:{mime};base64,{data}";
154
- return result;
155
- }
156
- var value = await client.Request<CreateValueResponse>(
157
- method: @"POST",
158
- path: "/values",
159
- payload: new () { [@"name"] = name }
160
- );
161
- await client.Upload(stream, value!.uploadUrl!, mime: mime);
162
- return value.downloadUrl!;
145
+ var data = Convert.ToBase64String(stream.ToArray<byte>());
146
+ var result = $"data:{mime};base64,{data}";
147
+ return Task.FromResult(result);
163
148
  }
164
149
 
165
150
  private async Task<Stream> Download(string url) {
@@ -172,12 +157,6 @@ namespace Muna.Beta.Services {
172
157
  return await client.Download(url);
173
158
  }
174
159
 
175
- [Preserve, Serializable]
176
- private class CreateValueResponse {
177
- public string? uploadUrl;
178
- public string? downloadUrl;
179
- }
180
-
181
160
  [Preserve, Serializable]
182
161
  private class RemotePrediction : Prediction {
183
162
  public new Value[]? results;
@@ -5,7 +5,7 @@
5
5
 
6
6
  #nullable enable
7
7
 
8
- namespace Muna.Beta {
8
+ namespace Muna.Beta.Services {
9
9
 
10
10
  using System;
11
11
  using System.IO;
@@ -58,10 +58,9 @@ namespace Muna.Beta {
58
58
  public static unsafe Stream ToStream<T>(this T[] data) where T : unmanaged {
59
59
  if (data is byte[] raw)
60
60
  return new MemoryStream(raw);
61
- var size = data.Length * sizeof(T);
62
- var array = new byte[size];
61
+ var array = new byte[data.Length * sizeof(T)];
63
62
  fixed (void* src = data, dst = array)
64
- Buffer.MemoryCopy(src, dst, size, size);
63
+ Buffer.MemoryCopy(src, dst, array.Length, array.Length);
65
64
  return new MemoryStream(array);
66
65
  }
67
66
 
@@ -11,7 +11,7 @@ namespace Muna.C {
11
11
  using System.Runtime.InteropServices;
12
12
  using System.Text;
13
13
  using System.Threading.Tasks;
14
- using static Muna;
14
+ using static Function;
15
15
 
16
16
  public sealed class Configuration : IDisposable {
17
17
 
@@ -11,7 +11,7 @@ namespace Muna.C {
11
11
  using System.Runtime.InteropServices;
12
12
  using System.Text;
13
13
 
14
- internal static unsafe class Muna {
14
+ internal static unsafe class Function {
15
15
 
16
16
  public const string Assembly =
17
17
  #if (UNITY_IOS || UNITY_VISIONOS || UNITY_WEBGL) && !UNITY_EDITOR
@@ -9,7 +9,7 @@ namespace Muna.C {
9
9
 
10
10
  using System;
11
11
  using System.Text;
12
- using static Muna;
12
+ using static Function;
13
13
 
14
14
  public sealed class Prediction : IDisposable {
15
15
 
@@ -8,7 +8,7 @@
8
8
  namespace Muna.C {
9
9
 
10
10
  using System;
11
- using static Muna;
11
+ using static Function;
12
12
 
13
13
  public sealed class PredictionStream : IDisposable {
14
14
 
@@ -8,7 +8,7 @@
8
8
  namespace Muna.C {
9
9
 
10
10
  using System;
11
- using static Muna;
11
+ using static Function;
12
12
 
13
13
  public sealed class Predictor : IDisposable {
14
14
 
@@ -14,7 +14,7 @@ namespace Muna.C {
14
14
  using System.Runtime.InteropServices;
15
15
  using Newtonsoft.Json;
16
16
  using Newtonsoft.Json.Linq;
17
- using static Muna;
17
+ using static Function;
18
18
 
19
19
  public unsafe sealed class Value : IDisposable {
20
20
 
@@ -170,8 +170,9 @@ namespace Muna.C {
170
170
  private static unsafe T[] ToArray<T>(T* data, int[] shape) where T : unmanaged {
171
171
  var count = shape.Aggregate(1, (a, b) => a * b);
172
172
  var result = new T[count];
173
+ var size = count * sizeof(T);
173
174
  fixed (void* dst = result)
174
- Buffer.MemoryCopy(data, dst, count * sizeof(T), count * sizeof(T));
175
+ Buffer.MemoryCopy(data, dst, size, size);
175
176
  return result;
176
177
  }
177
178
 
@@ -9,7 +9,7 @@ namespace Muna.C {
9
9
 
10
10
  using System;
11
11
  using System.Text;
12
- using static Muna;
12
+ using static Function;
13
13
 
14
14
  public sealed class ValueMap : IDisposable {
15
15
 
package/Runtime/Muna.cs CHANGED
@@ -87,14 +87,14 @@ namespace Muna {
87
87
  this.Users = new UserService(client);
88
88
  this.Predictors = new PredictorService(client);
89
89
  this.Predictions = new PredictionService(client);
90
- this.Beta = new BetaClient(client);
90
+ this.Beta = new BetaClient(client, this.Predictors, this.Predictions);
91
91
  }
92
92
  #endregion
93
93
 
94
94
 
95
95
  #region --Operations--
96
96
  public readonly MunaClient client;
97
- public const string Version = @"0.0.44";
97
+ public const string Version = @"0.0.45";
98
98
  internal const string URL = @"https://api.muna.ai/v1";
99
99
  #endregion
100
100
  }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Muna
3
+ * Copyright © 2025 NatML Inc. All rights reserved.
4
+ */
5
+
6
+ #nullable enable
7
+ #pragma warning disable 8618
8
+
9
+ namespace Muna {
10
+
11
+ using System;
12
+
13
+ /// <summary>
14
+ /// Predictor parameter.
15
+ /// </summary>
16
+ [Preserve, Serializable]
17
+ public class Parameter {
18
+
19
+ /// <summary>
20
+ /// Parameter name.
21
+ /// </summary>
22
+ public string name;
23
+
24
+ /// <summary>
25
+ /// Parameter type.
26
+ /// </summary>
27
+ public Dtype type;
28
+
29
+ /// <summary>
30
+ /// Parameter description.
31
+ /// </summary>
32
+ public string? description;
33
+
34
+ /// <summary>
35
+ /// Parameter denotation.
36
+ /// </summary>
37
+ public string? denotation;
38
+
39
+ /// <summary>
40
+ /// Parameter is optional.
41
+ /// </summary>
42
+ public bool? optional;
43
+
44
+ /// <summary>
45
+ /// Parameter value range for numeric parameters.
46
+ /// </summary>
47
+ public float[]? range;
48
+
49
+ /// <summary>
50
+ /// Parameter value choices for enumeration parameters.
51
+ /// </summary>
52
+ public EnumerationMember[]? enumeration;
53
+
54
+ /// <summary>
55
+ /// Parameter audio sample rate.
56
+ /// </summary>
57
+ public int? sampleRate;
58
+ }
59
+
60
+ /// <summary>
61
+ /// Prediction parameter enumeration member.
62
+ /// </summary>
63
+ [Preserve, Serializable]
64
+ public class EnumerationMember {
65
+ /// <summary>
66
+ /// Enumeration member name.
67
+ /// </summary>
68
+ public string name;
69
+ /// <summary>
70
+ /// Enumeration member value.
71
+ /// This is usually a `string` or `int`.
72
+ /// </summary>
73
+ public object value;
74
+ }
75
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 624d8c36be04548b7ae5358fd8970639
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -94,59 +94,6 @@ namespace Muna {
94
94
  public Parameter[] outputs;
95
95
  }
96
96
 
97
- /// <summary>
98
- /// Predictor parameter.
99
- /// </summary>
100
- [Preserve, Serializable]
101
- public class Parameter {
102
-
103
- /// <summary>
104
- /// Parameter name.
105
- /// </summary>
106
- public string? name;
107
-
108
- /// <summary>
109
- /// Parameter type.
110
- /// </summary>
111
- public Dtype? type;
112
-
113
- /// <summary>
114
- /// Parameter description.
115
- /// </summary>
116
- public string? description;
117
-
118
- /// <summary>
119
- /// Parameter is optional.
120
- /// </summary>
121
- public bool? optional;
122
-
123
- /// <summary>
124
- /// Parameter value range for numeric parameters.
125
- /// </summary>
126
- public float[]? range;
127
-
128
- /// <summary>
129
- /// Parameter value choices for enumeration parameters.
130
- /// </summary>
131
- public EnumerationMember[]? enumeration;
132
- }
133
-
134
- /// <summary>
135
- /// Prediction parameter enumeration member.
136
- /// </summary>
137
- [Preserve, Serializable]
138
- public class EnumerationMember {
139
- /// <summary>
140
- /// Enumeration member name.
141
- /// </summary>
142
- public string name;
143
- /// <summary>
144
- /// Enumeration member value.
145
- /// This is usually a `string` or `int`.
146
- /// </summary>
147
- public object value;
148
- }
149
-
150
97
  /// <summary>
151
98
  /// Predictor access mode.
152
99
  /// </summary>
@@ -109,7 +109,7 @@ namespace Muna.API {
109
109
  Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), @".fxn") :
110
110
  Path.Combine(Application.persistentDataPath, @"fxn");
111
111
  private static string ResourceCachePath => Path.Combine(CacheRoot, @"cache");
112
- private static string PredictorCachePath => Path.Combine(CacheRoot, @"predictors");
112
+ internal static string PredictorCachePath => Path.Combine(CacheRoot, @"predictors");
113
113
 
114
114
  private async Task<PredictionResource> GetCachedResource(PredictionResource resource) {
115
115
  var path = PredictionService.GetResourcePath(resource, ResourceCachePath);
@@ -36,7 +36,6 @@ namespace Muna {
36
36
  /// </summary>
37
37
  /// <param name="accessKey">Muna access key. This defaults to your access key in Project Settings.</param>
38
38
  /// <param name="url">Muna API URL.</param>
39
- /// <param name="cachePath">Predictor cache path.</param>
40
39
  /// <returns>Muna client.</returns>
41
40
  public static Muna Create(
42
41
  string? accessKey = null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.muna.muna",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "displayName": "Muna",
5
5
  "description": "Run AI inference in Unity Engine.",
6
6
  "unity": "2022.3",