mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:16:30 +00:00
d92da6afa4
notifying client of AI model conversion
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using MessagePack;
|
|
|
|
namespace Azaion.CommonSecurity.DTO.Commands;
|
|
|
|
[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);
|
|
}
|
|
|
|
[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,
|
|
Login = 10,
|
|
Load = 20,
|
|
DataBytes = 25,
|
|
Inference = 30,
|
|
InferenceData = 35,
|
|
StopInference = 40,
|
|
AIAvailabilityCheck = 80,
|
|
AIAvailabilityResult = 85,
|
|
Error = 90,
|
|
Exit = 100,
|
|
} |