BotSharp/src/Infrastructure/BotSharp.OpenAPI/ViewModels/Instructs/Request/InstructBaseRequest.cs

85 lines
2.2 KiB
C#
Raw Normal View History

2025-05-28 16:57:25 +00:00
using BotSharp.OpenAPI.ViewModels.Instructs.Request;
2024-08-27 15:42:48 +00:00
using System.Text.Json.Serialization;
namespace BotSharp.Abstraction.Instructs.Models;
public class InstructBaseRequest
{
[JsonPropertyName("provider")]
public virtual string? Provider { get; set; } = null;
[JsonPropertyName("model")]
public virtual string? Model { get; set; } = null;
2025-02-13 18:06:15 +00:00
[JsonPropertyName("agent_id")]
public virtual string? AgentId { get; set; }
2025-03-31 20:16:46 +00:00
[JsonPropertyName("template_name")]
public virtual string? TemplateName { get; set; }
2024-08-27 15:42:48 +00:00
[JsonPropertyName("states")]
2025-05-28 16:57:25 +00:00
public List<InstructState> States { get; set; } = [];
2024-08-27 15:42:48 +00:00
}
public class MultiModalRequest : InstructBaseRequest
{
[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;
2025-05-28 02:23:20 +00:00
}
2024-08-27 15:42:48 +00:00
2025-05-28 02:23:20 +00:00
public class MultiModalFileRequest : MultiModalRequest
{
2024-08-27 15:42:48 +00:00
[JsonPropertyName("files")]
2025-03-31 20:16:46 +00:00
public List<InstructFileModel> Files { get; set; } = [];
2024-08-27 15:42:48 +00:00
}
public class ImageGenerationRequest : InstructBaseRequest
{
[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;
}
public class ImageVariationRequest : InstructBaseRequest
{
[JsonPropertyName("file")]
2024-08-27 17:12:17 +00:00
public InstructFileModel File { get; set; }
2024-08-27 15:42:48 +00:00
}
public class ImageEditRequest : InstructBaseRequest
{
[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;
[JsonPropertyName("file")]
2025-09-11 22:36:20 +00:00
public InstructFileModel? File { get; set; }
[JsonPropertyName("image_converter_provider")]
public string? ImageConverterProvider { get; set; } = "file-handler";
2024-08-27 15:42:48 +00:00
}
public class ImageMaskEditRequest : InstructBaseRequest
{
[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;
[JsonPropertyName("file")]
2024-08-27 17:12:17 +00:00
public InstructFileModel File { get; set; }
2024-08-27 15:42:48 +00:00
[JsonPropertyName("mask")]
2024-08-27 17:12:17 +00:00
public InstructFileModel Mask { get; set; }
2024-08-27 15:42:48 +00:00
}
2024-08-28 16:08:12 +00:00
public class SpeechToTextRequest : InstructBaseRequest
2024-08-27 15:42:48 +00:00
{
2024-08-28 16:08:12 +00:00
[JsonPropertyName("text")]
public string? Text { get; set; }
2024-08-27 15:42:48 +00:00
[JsonPropertyName("file")]
2024-08-27 17:12:17 +00:00
public InstructFileModel File { get; set; }
2024-08-28 18:43:37 +00:00
}
public class TextToSpeechRequest : InstructBaseRequest
{
[JsonPropertyName("text")]
public string Text { get; set; }
2024-08-27 15:42:48 +00:00
}