mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 21:46:30 +00:00
def7aad833
incorrect pass / hw handling in a loader
56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using MessagePack;
|
|
|
|
namespace Azaion.Common.DTO;
|
|
|
|
[MessagePackObject]
|
|
public class RemoteCommand(CommandType commandType, byte[]? data = null, string? message = null)
|
|
{
|
|
[Key("CommandType")]
|
|
public CommandType CommandType { get; set; } = commandType;
|
|
|
|
[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, string? message = null) where T : class =>
|
|
new(commandType, MessagePackSerializer.Serialize(data), message);
|
|
|
|
public override string ToString() => $"({CommandType.ToString().ToUpper()}: Data: {Data?.Length ?? 0} bytes. Message: {Message})";
|
|
}
|
|
|
|
[MessagePackObject]
|
|
public class LoadFileData(string filename, string? folder = null )
|
|
{
|
|
[Key(nameof(Folder))]
|
|
public string? Folder { get; set; } = folder;
|
|
|
|
[Key(nameof(Filename))]
|
|
public string Filename { get; set; } = filename;
|
|
}
|
|
|
|
|
|
public enum CommandType
|
|
{
|
|
None = 0,
|
|
Ok = 3,
|
|
Login = 10,
|
|
CheckResource = 12,
|
|
ListRequest = 15,
|
|
ListFiles = 18,
|
|
Load = 20,
|
|
LoadBigSmall = 22,
|
|
UploadBigSmall = 24,
|
|
DataBytes = 25,
|
|
Inference = 30,
|
|
InferenceData = 35,
|
|
StopInference = 40,
|
|
AIAvailabilityCheck = 80,
|
|
AIAvailabilityResult = 85,
|
|
Error = 90,
|
|
Exit = 100,
|
|
} |