Errors sending to UI

notifying client of AI model conversion
This commit is contained in:
dzaitsev
2025-05-07 17:32:29 +03:00
committed by Alex Bezdieniezhnykh
42 changed files with 630 additions and 363 deletions
@@ -3,7 +3,7 @@
namespace Azaion.CommonSecurity.DTO.Commands;
[MessagePackObject]
public class RemoteCommand(CommandType commandType, byte[]? data = null)
public class RemoteCommand(CommandType commandType, byte[]? data = null, string? message = null)
{
[Key("CommandType")]
public CommandType CommandType { get; set; } = commandType;
@@ -11,11 +11,14 @@ public class RemoteCommand(CommandType commandType, byte[]? data = null)
[Key("Data")]
public byte[]? Data { get; set; } = data;
[Key("Message")]
public string? Message { get; set; } = message;
public static RemoteCommand Create(CommandType commandType) =>
new(commandType);
public static RemoteCommand Create<T>(CommandType commandType, T data) where T : class =>
new(commandType, MessagePackSerializer.Serialize(data));
public static RemoteCommand Create<T>(CommandType commandType, T data, string? message = null) where T : class =>
new(commandType, MessagePackSerializer.Serialize(data), message);
}
[MessagePackObject]
@@ -34,7 +37,12 @@ public enum CommandType
None = 0,
Login = 10,
Load = 20,
DataBytes = 25,
Inference = 30,
InferenceData = 35,
StopInference = 40,
Exit = 100
AIAvailabilityCheck = 80,
AIAvailabilityResult = 85,
Error = 90,
Exit = 100,
}
@@ -10,7 +10,7 @@ public abstract class ExternalClientConfig
public class InferenceClientConfig : ExternalClientConfig
{
public string ApiUrl { get; set; }
public string ApiUrl { get; set; } = null!;
}
public class GpsDeniedClientConfig : ExternalClientConfig
@@ -1,4 +1,4 @@
namespace Azaion.Common.Extensions;
namespace Azaion.CommonSecurity.DTO;
public static class EnumerableExtensions
{
+1 -3
View File
@@ -1,6 +1,4 @@
using Azaion.Common.Extensions;
namespace Azaion.CommonSecurity.DTO;
namespace Azaion.CommonSecurity.DTO;
public enum RoleEnum
{