diff --git a/MyApp.ServiceInterface/AiServer/CreateAnswerTasksCommand.cs b/MyApp.ServiceInterface/AiServer/CreateAnswerTasksCommand.cs index cb5e79f..eac2984 100644 --- a/MyApp.ServiceInterface/AiServer/CreateAnswerTasksCommand.cs +++ b/MyApp.ServiceInterface/AiServer/CreateAnswerTasksCommand.cs @@ -94,7 +94,7 @@ protected override async Task RunAsync(CreateAnswerTasks request, CancellationTo log.LogInformation("Sending CreateOpenAiChat for Question {Id} Answer for {UserName}, replyTo: {ReplyTo}", question.Id, userName, replyTo); - var response = await client.PostAsync(new CreateOpenAiChat + var response = await client.PostAsync(new QueueOpenAiChatCompletion() { Tag = "pvq", ReplyTo = replyTo, diff --git a/MyApp.Tests/dtos.cs b/MyApp.Tests/dtos.cs index 4cd423e..23a9383 100644 --- a/MyApp.Tests/dtos.cs +++ b/MyApp.Tests/dtos.cs @@ -1,6 +1,6 @@ /* Options: -Date: 2024-06-27 11:27:42 -Version: 8.31 +Date: 2024-10-04 17:29:14 +Version: 8.41 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://localhost:5005 @@ -31,51 +31,154 @@ using System.Runtime.Serialization; using ServiceStack; using ServiceStack.DataAnnotations; +using System.IO; using AiServer.ServiceModel; using AiServer.ServiceModel.Types; +using ServiceStack.Jobs; +using AiServer.ServiceInterface; + +namespace AiServer.ServiceInterface +{ + public partial class CreateMediaTransform + : IReturn + { + [Validate("NotNull")] + public virtual MediaTransformArgs Request { get; set; } + + public virtual string Provider { get; set; } + public virtual string State { get; set; } + public virtual string ReplyTo { get; set; } + public virtual string RefId { get; set; } + } + + public partial class CreateTransformResponse + { + public virtual long Id { get; set; } + public virtual string RefId { get; set; } + } + + public partial class PopulateChatSummary + : IReturn, IGet + { + } + +} namespace AiServer.ServiceModel { - public partial class ApiModel + /// + ///Active Worker Models available in AI Server + /// + public partial class ActiveAiModels + : IReturn, IGet + { + } + + public partial class AdminAddModel + : IReturn, IPost + { + public AdminAddModel() + { + ApiTypes = new Dictionary{}; + ApiProviders = new Dictionary{}; + } + + [Validate("NotNull")] + public virtual AiModel Model { get; set; } + + public virtual Dictionary ApiTypes { get; set; } + public virtual Dictionary ApiProviders { get; set; } + } + + public partial class AdminData + : IReturn, IGet + { + } + + public partial class AdminDataResponse + { + public AdminDataResponse() + { + PageStats = new List{}; + } + + public virtual List PageStats { get; set; } + } + + public partial class AiModel { + public AiModel() + { + Tags = new List{}; + } + public virtual int Id { get; set; } public virtual string Name { get; set; } - public virtual string Parameters { get; set; } - public virtual int? ContextSize { get; set; } + public virtual List Tags { get; set; } + public virtual string Latest { get; set; } public virtual string Website { get; set; } - public virtual string Developer { get; set; } - public virtual string Notes { get; set; } + public virtual string Description { get; set; } + public virtual string Icon { get; set; } + } + + public enum AiProvider + { + OpenAiProvider, + GoogleAiProvider, + } + + public partial class AiProviderFileOutput + { + public virtual string FileName { get; set; } + public virtual string Url { get; set; } + } + + public partial class AiProviderTextOutput + { + public virtual string Text { get; set; } + } + + public enum AiTaskType + { + TextToImage = 1, + ImageToImage = 2, + ImageUpscale = 3, + ImageWithMask = 4, + ImageToText = 5, + TextToAudio = 6, + TextToSpeech = 7, + SpeechToText = 8, } public partial class ApiProvider { public ApiProvider() { - TaskPaths = new Dictionary{}; Models = new List{}; + SelectedModels = new List{}; } public virtual int Id { get; set; } public virtual string Name { get; set; } + public virtual string ApiBaseUrl { get; set; } public virtual int ApiTypeId { get; set; } + public virtual string ApiKeyVar { get; set; } public virtual string ApiKey { get; set; } public virtual string ApiKeyHeader { get; set; } - public virtual string ApiBaseUrl { get; set; } public virtual string HeartbeatUrl { get; set; } - public virtual Dictionary TaskPaths { get; set; } public virtual int Concurrency { get; set; } public virtual int Priority { get; set; } public virtual bool Enabled { get; set; } public virtual DateTime? OfflineDate { get; set; } public virtual DateTime CreatedDate { get; set; } - public virtual ApiType ApiType { get; set; } public virtual List Models { get; set; } + public virtual ApiType ApiType { get; set; } + [Ignore] + public virtual List SelectedModels { get; set; } } public partial class ApiProviderModel { - public virtual int Id { get; set; } - public virtual int ApiProviderId { get; set; } public virtual string Model { get; set; } public virtual string ApiModel { get; set; } } @@ -84,78 +187,77 @@ public partial class ApiType { public ApiType() { - TaskPaths = new Dictionary{}; ApiModels = new Dictionary{}; } public virtual int Id { get; set; } + public virtual AiProvider Provider { get; set; } public virtual string Name { get; set; } public virtual string Website { get; set; } public virtual string ApiBaseUrl { get; set; } public virtual string HeartbeatUrl { get; set; } - public virtual string OpenAiProvider { get; set; } - public virtual Dictionary TaskPaths { get; set; } + public virtual string Icon { get; set; } public virtual Dictionary ApiModels { get; set; } } - public partial class ChangeApiProviderStatus - : IReturn, IPost + /// + ///Output object for generated artifacts + /// + public partial class ArtifactOutput { - public virtual string Provider { get; set; } - public virtual bool Online { get; set; } - } + /// + ///URL to access the generated image + /// + [ApiMember(Description="URL to access the generated image")] + public virtual string Url { get; set; } - public partial class ChatApiProvider - : IReturn, IPost - { + /// + ///Filename of the generated image + /// + [ApiMember(Description="Filename of the generated image")] + public virtual string FileName { get; set; } + + /// + ///Provider used for image generation + /// + [ApiMember(Description="Provider used for image generation")] public virtual string Provider { get; set; } - public virtual string Model { get; set; } - public virtual OpenAiChat Request { get; set; } - public virtual string Prompt { get; set; } } - public partial class ChatFailedTasks - : IReturn, IPost + [DataContract] + public enum AudioFormat { - public ChatFailedTasks() - { - RequeueFailedTaskIds = new List{}; - } - - public virtual bool? ResetErrorState { get; set; } - public virtual List RequeueFailedTaskIds { get; set; } + [EnumMember(Value="mp3")] + MP3, + [EnumMember(Value="wav")] + WAV, + [EnumMember(Value="flac")] + FLAC, + [EnumMember(Value="ogg")] + OGG, } - public partial class ChatNotifyCompletedTasks - : IReturn, IPost + public partial class CancelWorker + : IReturn { - public ChatNotifyCompletedTasks() - { - Ids = new List{}; - } - [Validate("NotEmpty")] - public virtual List Ids { get; set; } + public virtual string Worker { get; set; } } - public partial class ChatNotifyCompletedTasksResponse + public partial class ChangeApiProviderStatus + : IReturn, IPost { - public ChatNotifyCompletedTasksResponse() - { - Errors = new Dictionary{}; - Results = new List{}; - } - - public virtual Dictionary Errors { get; set; } - public virtual List Results { get; set; } - public virtual ResponseStatus ResponseStatus { get; set; } + public virtual string Provider { get; set; } + public virtual bool Online { get; set; } } - public partial class ChatOperations - : IReturn, IPost + public partial class ChatApiProvider + : IReturn, IPost { - public virtual bool? ResetTaskQueue { get; set; } - public virtual bool? RequeueIncompleteTasks { get; set; } + public virtual string Provider { get; set; } + public virtual string Model { get; set; } + public virtual OpenAiChat Request { get; set; } + public virtual string Prompt { get; set; } } public partial class Choice @@ -206,13 +308,112 @@ public ChoiceMessage() public virtual string Role { get; set; } } - public partial class CompleteOpenAiChat - : IReturn, IPost + /// + ///Convert an audio file to a different format + /// + public partial class ConvertAudio + : IReturn, IMediaTransform { - public virtual long Id { get; set; } - public virtual string Provider { get; set; } - public virtual int DurationMs { get; set; } - public virtual OpenAiChatResponse Response { get; set; } + /// + ///The desired output format for the converted audio + /// + [ApiMember(Description="The desired output format for the converted audio", ParameterType="query")] + [Required] + public virtual AudioFormat OutputFormat { get; set; } + + [Required] + public virtual Stream Audio { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert an image to a different format + /// + public partial class ConvertImage + : IReturn, IPost + { + /// + ///The image file to be converted + /// + [ApiMember(Description="The image file to be converted", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The desired output format for the converted image + /// + [ApiMember(Description="The desired output format for the converted image", ParameterType="query")] + [Required] + public virtual ImageOutputFormat? OutputFormat { get; set; } + } + + /// + ///Convert a video to a different format + /// + public partial class ConvertVideo + : IReturn, IMediaTransform + { + /// + ///The desired output format for the converted video + /// + [ApiMember(Description="The desired output format for the converted video", ParameterType="query")] + [Required] + public virtual ConvertVideoOutputFormat OutputFormat { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + [DataContract] + public enum ConvertVideoOutputFormat + { + [EnumMember(Value="mp4")] + MP4, + [EnumMember(Value="avi")] + AVI, + [EnumMember(Value="mkv")] + MKV, + [EnumMember(Value="mov")] + MOV, + [EnumMember(Value="webm")] + WebM, + [EnumMember(Value="gif")] + GIF, } public partial class CreateApiKey @@ -253,30 +454,42 @@ public partial class CreateApiKeyResponse ///Different Models available for the API /// public partial class CreateApiModel - : IReturn, ICreateDb + : IReturn, ICreateDb { public virtual string Name { get; set; } - public virtual string Parameters { get; set; } public virtual string Website { get; set; } - public virtual int? ContextSize { get; set; } - public virtual string Developer { get; set; } - public virtual string Notes { get; set; } + public virtual List Tags { get; set; } + public virtual string Latest { get; set; } + public virtual string Description { get; set; } + public virtual string Icon { get; set; } } /// - ///Create an API Provider that can process AI Tasks + ///Add an API Provider to process AI Requests /// public partial class CreateApiProvider : IReturn, ICreateDb { + /// + ///The Type of this API Provider + /// + [Validate("GreaterThan(0)")] + public virtual int ApiTypeId { get; set; } + + /// + ///The Base URL for the API Provider + /// + public virtual string ApiBaseUrl { get; set; } /// ///The unique name for this API Provider /// + [Validate("NotEmpty")] public virtual string Name { get; set; } + /// - ///The behavior for this API Provider + ///The API Key to use for this Provider /// - public virtual int ApiTypeId { get; set; } + public virtual string ApiKeyVar { get; set; } /// ///The API Key to use for this Provider /// @@ -286,15 +499,11 @@ public partial class CreateApiProvider /// public virtual string ApiKeyHeader { get; set; } /// - ///The Base URL for the API Provider - /// - public virtual string ApiBaseUrl { get; set; } - /// ///The URL to check if the API Provider is still online /// public virtual string HeartbeatUrl { get; set; } /// - ///Override API Paths for different AI Tasks + ///Override API Paths for different AI Requests /// public virtual Dictionary TaskPaths { get; set; } /// @@ -310,93 +519,304 @@ public partial class CreateApiProvider /// public virtual bool Enabled { get; set; } /// - ///The models this API Provider can process + ///The models this API Provider should process /// public virtual List Models { get; set; } + /// + ///The selected models this API Provider should process + /// + public virtual List SelectedModels { get; set; } + } + + [Route("/generate", "POST")] + public partial class CreateGeneration + : IReturn + { + [Validate("NotNull")] + public virtual GenerationArgs Request { get; set; } + + public virtual string Provider { get; set; } + public virtual string State { get; set; } + public virtual string ReplyTo { get; set; } + public virtual string RefId { get; set; } } /// - ///Register a Model supported by an API Provider + ///Add an API Provider to Generation API Providers /// - public partial class CreateApiProviderModel - : IReturn, ICreateDb + public partial class CreateGenerationApiProvider + : IReturn, ICreateDb { /// - ///The ApiProvider Id + ///The name of the API Provider + /// + public virtual string Name { get; set; } + /// + ///The API Key to use for this Provider /// - public virtual int ApiProviderId { get; set; } + public virtual string ApiKey { get; set; } /// - ///Supported ApiModel Name + ///Send the API Key in the Header instead of Authorization Bearer /// - public virtual string Model { get; set; } + public virtual string ApiKeyHeader { get; set; } /// - ///Model to use when sending requests to the API Provider + ///Base URL for the Generation Provider /// - public virtual string ApiModel { get; set; } - } - - public partial class CreateOpenAiChat - : IReturn, ICreateDb - { - public virtual string RefId { get; set; } - public virtual string Provider { get; set; } - public virtual string ReplyTo { get; set; } - public virtual string Tag { get; set; } - public virtual OpenAiChat Request { get; set; } + public virtual string ApiBaseUrl { get; set; } + /// + ///Url to check if the API is online + /// + public virtual string HeartbeatUrl { get; set; } + /// + ///How many requests should be made concurrently + /// + public virtual int Concurrency { get; set; } + /// + ///What priority to give this Provider to use for processing models + /// + public virtual int Priority { get; set; } + /// + ///Whether the Provider is enabled + /// + public virtual bool Enabled { get; set; } + /// + ///The date the Provider was last online + /// + public virtual DateTime? OfflineDate { get; set; } + /// + ///Models this API Provider should process + /// + public virtual List Models { get; set; } + public virtual int? GenerationApiTypeId { get; set; } } - public partial class CreateOpenAiChatResponse + public partial class CreateGenerationResponse { public virtual long Id { get; set; } public virtual string RefId { get; set; } - public virtual ResponseStatus ResponseStatus { get; set; } } /// - ///Delete a Model supported by the API Provider + ///Crop an image to a specified area /// - public partial class DeleteApiProviderModel - : IReturn, IDeleteDb + public partial class CropImage + : IReturn, IPost { /// - ///The ApiProviderModel Id + ///The X-coordinate of the top-left corner of the crop area /// - public virtual int Id { get; set; } - } + [ApiMember(Description="The X-coordinate of the top-left corner of the crop area", ParameterType="query")] + public virtual int X { get; set; } - public partial class FetchOpenAiChatRequests - : IReturn, IPost - { - public FetchOpenAiChatRequests() - { - Models = new string[]{}; - } + /// + ///The Y-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The Y-coordinate of the top-left corner of the crop area", ParameterType="query")] + public virtual int Y { get; set; } - [Validate("NotEmpty")] - public virtual string[] Models { get; set; } + /// + ///The width of the crop area + /// + [ApiMember(Description="The width of the crop area", ParameterType="query")] + public virtual int Width { get; set; } - [Validate("NotEmpty")] - public virtual string Provider { get; set; } + /// + ///The height of the crop area + /// + [ApiMember(Description="The height of the crop area", ParameterType="query")] + public virtual int Height { get; set; } - public virtual string Worker { get; set; } - public virtual int? Take { get; set; } + /// + ///The image file to be cropped + /// + [ApiMember(Description="The image file to be cropped", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } } - public partial class FetchOpenAiChatRequestsResponse + /// + ///Crop a video to a specified area + /// + public partial class CropVideo + : IReturn, IMediaTransform { - public FetchOpenAiChatRequestsResponse() - { - Results = new OpenAiChatRequest[]{}; - } - - public virtual OpenAiChatRequest[] Results { get; set; } - public virtual ResponseStatus ResponseStatus { get; set; } - } + /// + ///The X-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The X-coordinate of the top-left corner of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int X { get; set; } - public partial class FirePeriodicTask - : IReturn, IPost + /// + ///The Y-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The Y-coordinate of the top-left corner of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Y { get; set; } + + /// + ///The width of the crop area + /// + [ApiMember(Description="The width of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Width { get; set; } + + /// + ///The height of the crop area + /// + [ApiMember(Description="The height of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Height { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Delete API Provider + /// + public partial class DeleteApiProvider + : IReturnVoid, IDeleteDb + { + public virtual int Id { get; set; } + } + + [Route("/files/{**Path}")] + public partial class DeleteFile + : IReturn, IDelete + { + [Validate("NotEmpty")] + public virtual string Path { get; set; } + } + + public partial class DeleteFiles + : IReturn, IPost + { + public DeleteFiles() + { + Paths = new List{}; + } + + public virtual List Paths { get; set; } + } + + public partial class DeleteFilesResponse + { + public DeleteFilesResponse() + { + Deleted = new List{}; + Missing = new List{}; + Failed = new List{}; + } + + public virtual List Deleted { get; set; } + public virtual List Missing { get; set; } + public virtual List Failed { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + /// + ///Delete a Generation API Provider + /// + public partial class DeleteGenerationApiProvider + : IReturn, IDeleteDb + { + public virtual int? Id { get; set; } + public virtual string Name { get; set; } + } + + public partial class GenerationArgs + { + public virtual string Model { get; set; } + public virtual int? Steps { get; set; } + public virtual int? BatchSize { get; set; } + public virtual int? Seed { get; set; } + public virtual string PositivePrompt { get; set; } + public virtual string NegativePrompt { get; set; } + public virtual Stream ImageInput { get; set; } + public virtual Stream SpeechInput { get; set; } + public virtual Stream MaskInput { get; set; } + public virtual Stream AudioInput { get; set; } + public virtual ComfySampler? Sampler { get; set; } + public virtual string Scheduler { get; set; } + public virtual double? CfgScale { get; set; } + public virtual double? Denoise { get; set; } + public virtual string UpscaleModel { get; set; } + public virtual int? Width { get; set; } + public virtual int? Height { get; set; } + public virtual AiTaskType? TaskType { get; set; } + public virtual string Clip { get; set; } + public virtual double? SampleLength { get; set; } + public virtual ComfyMaskSource MaskChannel { get; set; } + public virtual string AspectRatio { get; set; } + public virtual double? Quality { get; set; } + public virtual string Voice { get; set; } + public virtual string Language { get; set; } + } + + /// + ///Response object for generation requests + /// + public partial class GenerationResponse + { + public GenerationResponse() + { + Outputs = new List{}; + TextOutputs = new List{}; + } + + /// + ///List of generated outputs + /// + [ApiMember(Description="List of generated outputs")] + public virtual List Outputs { get; set; } + + /// + ///List of generated text outputs + /// + [ApiMember(Description="List of generated text outputs")] + public virtual List TextOutputs { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] + public virtual ResponseStatus ResponseStatus { get; set; } + } + + public partial class GenerationResult { - public virtual PeriodicFrequency Frequency { get; set; } + public GenerationResult() + { + TextOutputs = new List{}; + Outputs = new List{}; + } + + public virtual List TextOutputs { get; set; } + public virtual List Outputs { get; set; } + public virtual string Error { get; set; } } public partial class GetActiveProviders @@ -415,19 +835,163 @@ public GetActiveProvidersResponse() public virtual ResponseStatus ResponseStatus { get; set; } } - public partial class GetApiWorkerStats - : IReturn, IGet + [Route("/artifacts/{**Path}")] + public partial class GetArtifact + : IReturn, IGet + { + [Validate("NotEmpty")] + public virtual string Path { get; set; } + } + + public partial class GetComfyModelMappings + : IReturn { } - public partial class GetApiWorkerStatsResponse + public partial class GetComfyModelMappingsResponse { - public GetApiWorkerStatsResponse() + public GetComfyModelMappingsResponse() { - Results = new List{}; + Models = new Dictionary{}; } - public virtual List Results { get; set; } + public virtual Dictionary Models { get; set; } + } + + public partial class GetComfyModels + : IReturn + { + public virtual string ApiBaseUrl { get; set; } + public virtual string ApiKey { get; set; } + } + + public partial class GetComfyModelsResponse + { + public GetComfyModelsResponse() + { + Results = new List{}; + } + + public virtual List Results { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + [Route("/generation/{Id}", "GET")] + [Route("/generation/ref/{RefId}", "GET")] + public partial class GetGeneration + : IReturn + { + public virtual int? Id { get; set; } + public virtual string RefId { get; set; } + } + + public partial class GetGenerationResponse + { + public GetGenerationResponse() + { + Outputs = new List{}; + TextOutputs = new List{}; + } + + public virtual GenerationArgs Request { get; set; } + public virtual GenerationResult Result { get; set; } + public virtual List Outputs { get; set; } + public virtual List TextOutputs { get; set; } + } + + /// + ///Get job status + /// + [Api(Description="Get job status")] + public partial class GetJobStatus + : IReturn + { + /// + ///Unique identifier of the background job + /// + [ApiMember(Description="Unique identifier of the background job", ParameterType="query")] + public virtual long? JobId { get; set; } + + /// + ///Client-provided identifier for the request + /// + [ApiMember(Description="Client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + } + + public partial class GetJobStatusResponse + { + public GetJobStatusResponse() + { + Outputs = new List{}; + TextOutputs = new List{}; + } + + /// + ///Unique identifier of the background job + /// + [ApiMember(Description="Unique identifier of the background job")] + public virtual long JobId { get; set; } + + /// + ///Client-provided identifier for the request + /// + [ApiMember(Description="Client-provided identifier for the request")] + public virtual string RefId { get; set; } + + /// + ///Current state of the background job + /// + [ApiMember(Description="Current state of the background job")] + public virtual BackgroundJobState JobState { get; set; } + + /// + ///Current status of the generation request + /// + [ApiMember(Description="Current status of the generation request")] + public virtual string Status { get; set; } + + /// + ///List of generated outputs + /// + [ApiMember(Description="List of generated outputs")] + public virtual List Outputs { get; set; } + + /// + ///List of generated text outputs + /// + [ApiMember(Description="List of generated text outputs")] + public virtual List TextOutputs { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] + public virtual ResponseStatus ResponseStatus { get; set; } + } + + [Route("/icons/models/{Model}", "GET")] + public partial class GetModelImage + : IReturn, IGet + { + public virtual string Model { get; set; } + } + + public partial class GetOllamaModels + : IReturn, IGet + { + [Validate("NotEmpty")] + public virtual string ApiBaseUrl { get; set; } + } + + public partial class GetOllamaModelsResponse + { + public GetOllamaModelsResponse() + { + Results = new List{}; + } + + public virtual List Results { get; set; } public virtual ResponseStatus ResponseStatus { get; set; } } @@ -440,8 +1004,54 @@ public partial class GetOpenAiChat public partial class GetOpenAiChatResponse { - public virtual OpenAiChatTask Result { get; set; } + public virtual BackgroundJobBase Result { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + public partial class GetOpenAiChatStatus + : IReturn, IGet + { + public virtual long JobId { get; set; } + public virtual string RefId { get; set; } + } + + public partial class GetOpenAiChatStatusResponse + { + /// + ///Unique identifier of the background job + /// + [ApiMember(Description="Unique identifier of the background job")] + public virtual long JobId { get; set; } + + /// + ///Client-provided identifier for the request + /// + [ApiMember(Description="Client-provided identifier for the request")] + public virtual string RefId { get; set; } + + /// + ///Current state of the background job + /// + [ApiMember(Description="Current state of the background job")] + public virtual BackgroundJobState JobState { get; set; } + + /// + ///Current status of the generation request + /// + [ApiMember(Description="Current status of the generation request")] + public virtual string Status { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] public virtual ResponseStatus ResponseStatus { get; set; } + + /// + ///Chat response + /// + [ApiMember(Description="Chat response")] + public virtual OpenAiChatResponse ChatResponse { get; set; } } public partial class GetSummaryStats @@ -465,6 +1075,35 @@ public GetSummaryStatsResponse() public virtual List MonthStats { get; set; } } + [Route("/variants/{Variant}/{**Path}")] + public partial class GetVariant + : IReturn, IGet + { + [Validate("NotEmpty")] + public virtual string Variant { get; set; } + + [Validate("NotEmpty")] + public virtual string Path { get; set; } + } + + public partial class GetWorkerStats + : IReturn, IGet + { + } + + public partial class GetWorkerStatsResponse + { + public GetWorkerStatsResponse() + { + Results = new List{}; + QueueCounts = new Dictionary{}; + } + + public virtual List Results { get; set; } + public virtual Dictionary QueueCounts { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + [Route("/hello/{Name}")] public partial class Hello : IReturn, IGet @@ -477,76 +1116,511 @@ public partial class HelloResponse public virtual string Result { get; set; } } + public partial interface IGeneration + { + string RefId { get; set; } + string ReplyTo { get; set; } + string State { get; set; } + string Tag { get; set; } + } + + [DataContract] + public enum ImageOutputFormat + { + [EnumMember(Value="jpg")] + Jpg, + [EnumMember(Value="png")] + Png, + [EnumMember(Value="gif")] + Gif, + [EnumMember(Value="bmp")] + Bmp, + [EnumMember(Value="tiff")] + Tiff, + [EnumMember(Value="webp")] + Webp, + } + /// - ///Given a list of messages comprising a conversation, the model will return a response. + ///Generate image from another image /// - [DataContract] - public partial class OpenAiChat + [Api(Description="Generate image from another image")] + public partial class ImageToImage + : IReturn, IGeneration { - public OpenAiChat() - { - Messages = new List{}; - LogitBias = new Dictionary{}; - Stop = new List{}; - Tools = new List{}; - } - /// - ///A list of messages comprising the conversation so far. + ///The image to use as input /// - [DataMember(Name="messages")] - public virtual List Messages { get; set; } + [ApiMember(Description="The image to use as input", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } /// - ///ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API + ///Prompt describing the desired output /// - [DataMember(Name="model")] - public virtual string Model { get; set; } + [ApiMember(Description="Prompt describing the desired output", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } /// - ///Number between `-2.0` and `2.0`. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + ///Negative prompt describing what should not be in the image /// - [DataMember(Name="frequency_penalty")] - public virtual double? FrequencyPenalty { get; set; } + [ApiMember(Description="Negative prompt describing what should not be in the image", ParameterType="body")] + public virtual string NegativePrompt { get; set; } /// - ///Modify the likelihood of specified tokens appearing in the completion. + ///Optional specific amount of denoise to apply /// - [DataMember(Name="logit_bias")] - public virtual Dictionary LogitBias { get; set; } + [ApiMember(Description="Optional specific amount of denoise to apply", ParameterType="query")] + public virtual float? Denoise { get; set; } /// - ///Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. + ///Number of images to generate in a single batch /// - [DataMember(Name="logprobs")] - public virtual bool? LogProbs { get; set; } + [ApiMember(Description="Number of images to generate in a single batch", ParameterType="query")] + public virtual int? BatchSize { get; set; } /// - ///An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. + ///Optional seed for reproducible results in image generation /// - [DataMember(Name="top_logprobs")] - public virtual int? TopLogProbs { get; set; } + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } /// - ///The maximum number of tokens that can be generated in the chat completion. + ///Optional client-provided identifier for the request /// - [DataMember(Name="max_tokens")] - public virtual int? MaxTokens { get; set; } + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } /// - ///How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + ///Optional queue or topic to reply to /// - [DataMember(Name="n")] - public virtual int? N { get; set; } + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } /// - ///Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + ///Tag to identify the request /// - [DataMember(Name="presence_penalty")] - public virtual double? PresencePenalty { get; set; } + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } /// - ///An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. Setting Type to ResponseFormat.JsonObject enables JSON mode, which guarantees the message the model generates is valid JSON. + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Convert image to text + /// + [Api(Description="Convert image to text")] + public partial class ImageToText + : IReturn, IGeneration + { + /// + ///The image to convert to text + /// + [ApiMember(Description="The image to convert to text", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Upscale an image + /// + [Api(Description="Upscale an image")] + public partial class ImageUpscale + : IReturn, IGeneration + { + /// + ///The image to upscale + /// + [ApiMember(Description="The image to upscale", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Optional seed for reproducible results in image generation + /// + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Generate image with masked area + /// + [Api(Description="Generate image with masked area")] + public partial class ImageWithMask + : IReturn, IGeneration + { + /// + ///Prompt describing the desired output in the masked area + /// + [ApiMember(Description="Prompt describing the desired output in the masked area", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } + + /// + ///Negative prompt describing what should not be in the masked area + /// + [ApiMember(Description="Negative prompt describing what should not be in the masked area", ParameterType="body")] + public virtual string NegativePrompt { get; set; } + + /// + ///The image to use as input + /// + [ApiMember(Description="The image to use as input", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The mask to use as input + /// + [ApiMember(Description="The mask to use as input", ParameterType="body")] + [Required] + public virtual Stream Mask { get; set; } + + /// + ///Optional specific amount of denoise to apply + /// + [ApiMember(Description="Optional specific amount of denoise to apply", ParameterType="query")] + public virtual float? Denoise { get; set; } + + /// + ///Optional seed for reproducible results in image generation + /// + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + public partial interface IMediaTransform + { + string RefId { get; set; } + string Tag { get; set; } + string ReplyTo { get; set; } + } + + /// + ///Base class for queue generation requests + /// + public partial interface IQueueGeneration + { + string RefId { get; set; } + string ReplyTo { get; set; } + string Tag { get; set; } + string State { get; set; } + } + + public partial interface IQueueMediaTransform + { + string RefId { get; set; } + string Tag { get; set; } + string ReplyTo { get; set; } + } + + [DataContract] + public enum MediaOutputFormat + { + [EnumMember(Value="mp4")] + MP4, + [EnumMember(Value="avi")] + AVI, + [EnumMember(Value="mkv")] + MKV, + [EnumMember(Value="mov")] + MOV, + [EnumMember(Value="webm")] + WebM, + [EnumMember(Value="gif")] + GIF, + [EnumMember(Value="mp3")] + MP3, + [EnumMember(Value="wav")] + WAV, + [EnumMember(Value="flac")] + FLAC, + } + + public partial class MediaTransformArgs + { + public virtual MediaTransformTaskType? TaskType { get; set; } + public virtual Stream VideoInput { get; set; } + public virtual Stream AudioInput { get; set; } + public virtual Stream ImageInput { get; set; } + public virtual Stream WatermarkInput { get; set; } + public virtual string VideoFileName { get; set; } + public virtual string AudioFileName { get; set; } + public virtual string ImageFileName { get; set; } + public virtual string WatermarkFileName { get; set; } + public virtual MediaOutputFormat? OutputFormat { get; set; } + public virtual ImageOutputFormat? ImageOutputFormat { get; set; } + public virtual int? ScaleWidth { get; set; } + public virtual int? ScaleHeight { get; set; } + public virtual int? CropX { get; set; } + public virtual int? CropY { get; set; } + public virtual int? CropWidth { get; set; } + public virtual int? CropHeight { get; set; } + public virtual float? CutStart { get; set; } + public virtual float? CutEnd { get; set; } + public virtual Stream WatermarkFile { get; set; } + public virtual string WatermarkPosition { get; set; } + public virtual string WatermarkScale { get; set; } + public virtual string AudioCodec { get; set; } + public virtual string VideoCodec { get; set; } + public virtual string AudioBitrate { get; set; } + public virtual int? AudioSampleRate { get; set; } + } + + /// + ///Response object for transform requests + /// + public partial class MediaTransformResponse + { + public MediaTransformResponse() + { + Outputs = new List{}; + TextOutputs = new List{}; + } + + /// + ///List of generated outputs + /// + [ApiMember(Description="List of generated outputs")] + public virtual List Outputs { get; set; } + + /// + ///List of generated text outputs + /// + [ApiMember(Description="List of generated text outputs")] + public virtual List TextOutputs { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] + public virtual ResponseStatus ResponseStatus { get; set; } + } + + public enum MediaTransformTaskType + { + ImageScale, + VideoScale, + ImageConvert, + AudioConvert, + VideoConvert, + ImageCrop, + VideoCrop, + VideoCut, + AudioCut, + WatermarkImage, + WatermarkVideo, + } + + public partial class MigrateArtifact + : IReturn, IPost + { + public virtual string Path { get; set; } + public virtual DateTime? Date { get; set; } + } + + public partial class MigrateArtifactResponse + { + public virtual string FilePath { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + [DataContract] + public partial class OllamaModel + { + [DataMember(Name="name")] + public virtual string Name { get; set; } + + [DataMember(Name="model")] + public virtual string Model { get; set; } + + [DataMember(Name="modified_at")] + public virtual DateTime ModifiedAt { get; set; } + + [DataMember(Name="size")] + public virtual long Size { get; set; } + + [DataMember(Name="digest")] + public virtual string Digest { get; set; } + + [DataMember(Name="details")] + public virtual OllamaModelDetails Details { get; set; } + } + + [DataContract] + public partial class OllamaModelDetails + { + public OllamaModelDetails() + { + Families = new List{}; + } + + [DataMember(Name="parent_model")] + public virtual string ParentModel { get; set; } + + [DataMember(Name="format")] + public virtual string Format { get; set; } + + [DataMember(Name="family")] + public virtual string Family { get; set; } + + [DataMember(Name="families")] + public virtual List Families { get; set; } + + [DataMember(Name="parameter_size")] + public virtual string ParameterSize { get; set; } + + [DataMember(Name="quantization_level")] + public virtual string QuantizationLevel { get; set; } + } + + /// + ///Given a list of messages comprising a conversation, the model will return a response. + /// + [DataContract] + public partial class OpenAiChat + { + public OpenAiChat() + { + Messages = new List{}; + LogitBias = new Dictionary{}; + Stop = new List{}; + Tools = new List{}; + } + + /// + ///A list of messages comprising the conversation so far. + /// + [DataMember(Name="messages")] + public virtual List Messages { get; set; } + + /// + ///ID of the model to use. See the model endpoint compatibility table for details on which models work with the Chat API + /// + [DataMember(Name="model")] + public virtual string Model { get; set; } + + /// + ///Number between `-2.0` and `2.0`. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + /// + [DataMember(Name="frequency_penalty")] + public virtual double? FrequencyPenalty { get; set; } + + /// + ///Modify the likelihood of specified tokens appearing in the completion. + /// + [DataMember(Name="logit_bias")] + public virtual Dictionary LogitBias { get; set; } + + /// + ///Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. + /// + [DataMember(Name="logprobs")] + public virtual bool? LogProbs { get; set; } + + /// + ///An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. + /// + [DataMember(Name="top_logprobs")] + public virtual int? TopLogProbs { get; set; } + + /// + ///The maximum number of tokens that can be generated in the chat completion. + /// + [DataMember(Name="max_tokens")] + public virtual int? MaxTokens { get; set; } + + /// + ///How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + /// + [DataMember(Name="n")] + public virtual int? N { get; set; } + + /// + ///Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + /// + [DataMember(Name="presence_penalty")] + public virtual double? PresencePenalty { get; set; } + + /// + ///An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`. Setting Type to ResponseFormat.JsonObject enables JSON mode, which guarantees the message the model generates is valid JSON. /// [DataMember(Name="response_format")] public virtual OpenAiResponseFormat ResponseFormat { get; set; } @@ -579,7 +1653,7 @@ public OpenAiChat() ///An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. /// [DataMember(Name="top_p")] - public virtual double TopP { get; set; } + public virtual double? TopP { get; set; } /// ///A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. @@ -594,6 +1668,18 @@ public OpenAiChat() public virtual string User { get; set; } } + /// + ///Given a list of messages comprising a conversation, the model will return a response. + /// + [Route("/v1/chat/completions", "POST")] + public partial class OpenAiChatCompletion + : OpenAiChat, IReturn, IPost + { + public virtual string RefId { get; set; } + public virtual string Provider { get; set; } + public virtual string Tag { get; set; } + } + [DataContract] public partial class OpenAiChatResponse { @@ -643,6 +1729,9 @@ public OpenAiChatResponse() /// [DataMember(Name="usage")] public virtual OpenAiUsage Usage { get; set; } + + [DataMember(Name="responseStatus")] + public virtual ResponseStatus ResponseStatus { get; set; } } /// @@ -687,332 +1776,2033 @@ public OpenAiMessage() public virtual string ToolCallId { get; set; } } - [DataContract] - public partial class OpenAiResponseFormat + [DataContract] + public partial class OpenAiResponseFormat + { + /// + ///An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. + /// + [DataMember(Name="response_format")] + public virtual ResponseFormat Type { get; set; } + } + + [DataContract] + public partial class OpenAiTools + { + /// + ///The type of the tool. Currently, only function is supported. + /// + [DataMember(Name="type")] + public virtual OpenAiToolType Type { get; set; } + } + + public enum OpenAiToolType + { + [EnumMember(Value="function")] + Function, + } + + /// + ///Usage statistics for the completion request. + /// + [DataContract] + public partial class OpenAiUsage + { + /// + ///Number of tokens in the generated completion. + /// + [DataMember(Name="completion_tokens")] + public virtual int CompletionTokens { get; set; } + + /// + ///Number of tokens in the prompt. + /// + [DataMember(Name="prompt_tokens")] + public virtual int PromptTokens { get; set; } + + /// + ///Total number of tokens used in the request (prompt + completion). + /// + [DataMember(Name="total_tokens")] + public virtual int TotalTokens { get; set; } + } + + public partial class PageStats + { + public virtual string Label { get; set; } + public virtual int Total { get; set; } + } + + /// + ///Different Models available in AI Server + /// + public partial class QueryApiModels + : QueryDb, IReturn> + { + } + + /// + ///API Providers + /// + public partial class QueryApiProviders + : QueryDb, IReturn> + { + public virtual string Name { get; set; } + } + + /// + ///The Type and behavior of different API Providers + /// + public partial class QueryApiTypes + : QueryDb, IReturn> + { + } + + /// + ///Media Providers + /// + public partial class QueryGenerationApiProviders + : QueryDb, IReturn> + { + public virtual int? Id { get; set; } + public virtual string Name { get; set; } + } + + /// + ///Media Model Settings + /// + public partial class QueryGenerationModelSettings + : QueryDb, IReturn> + { + public virtual string Id { get; set; } + } + + /// + ///Convert an audio file to a different format + /// + public partial class QueueConvertAudio + : IReturn, IQueueMediaTransform + { + /// + ///The desired output format for the converted audio + /// + [ApiMember(Description="The desired output format for the converted audio", ParameterType="query")] + [Required] + public virtual AudioFormat OutputFormat { get; set; } + + [Required] + public virtual Stream Audio { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert an image to a different format + /// + public partial class QueueConvertImage + : IReturn, IQueueMediaTransform, IPost + { + /// + ///The image file to be converted + /// + [ApiMember(Description="The image file to be converted", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The desired output format for the converted image + /// + [ApiMember(Description="The desired output format for the converted image", ParameterType="query")] + [Required] + public virtual ImageOutputFormat? OutputFormat { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert a video to a different format + /// + public partial class QueueConvertVideo + : IReturn, IQueueMediaTransform + { + /// + ///The desired output format for the converted video + /// + [ApiMember(Description="The desired output format for the converted video", ParameterType="query")] + [Required] + public virtual ConvertVideoOutputFormat OutputFormat { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Crop an image to a specified area + /// + public partial class QueueCropImage + : IReturn, IQueueMediaTransform, IPost + { + /// + ///The X-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The X-coordinate of the top-left corner of the crop area", ParameterType="query")] + public virtual int X { get; set; } + + /// + ///The Y-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The Y-coordinate of the top-left corner of the crop area", ParameterType="query")] + public virtual int Y { get; set; } + + /// + ///The width of the crop area + /// + [ApiMember(Description="The width of the crop area", ParameterType="query")] + public virtual int Width { get; set; } + + /// + ///The height of the crop area + /// + [ApiMember(Description="The height of the crop area", ParameterType="query")] + public virtual int Height { get; set; } + + /// + ///The image file to be cropped + /// + [ApiMember(Description="The image file to be cropped", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Crop a video to a specified area + /// + public partial class QueueCropVideo + : IReturn, IQueueMediaTransform + { + /// + ///The X-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The X-coordinate of the top-left corner of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int X { get; set; } + + /// + ///The Y-coordinate of the top-left corner of the crop area + /// + [ApiMember(Description="The Y-coordinate of the top-left corner of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Y { get; set; } + + /// + ///The width of the crop area + /// + [ApiMember(Description="The width of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Width { get; set; } + + /// + ///The height of the crop area + /// + [ApiMember(Description="The height of the crop area", ParameterType="query")] + [Validate("GreaterThan(0)")] + [Required] + public virtual int Height { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + public partial class QueueGenerationResponse + { + /// + ///Unique identifier of the background job + /// + [ApiMember(Description="Unique identifier of the background job")] + public virtual long JobId { get; set; } + + /// + ///Client-provided identifier for the request + /// + [ApiMember(Description="Client-provided identifier for the request")] + public virtual string RefId { get; set; } + + /// + ///Current state of the background job + /// + [ApiMember(Description="Current state of the background job")] + public virtual BackgroundJobState JobState { get; set; } + + /// + ///Current status of the generation request + /// + [ApiMember(Description="Current status of the generation request")] + public virtual string Status { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] + public virtual ResponseStatus ResponseStatus { get; set; } + } + + /// + ///Generate image from another image + /// + [Api(Description="Generate image from another image")] + public partial class QueueImageToImage + : IReturn, IQueueGeneration + { + /// + ///The image to use as input + /// + [ApiMember(Description="The image to use as input", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Prompt describing the desired output + /// + [ApiMember(Description="Prompt describing the desired output", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } + + /// + ///Negative prompt describing what should not be in the image + /// + [ApiMember(Description="Negative prompt describing what should not be in the image", ParameterType="body")] + public virtual string NegativePrompt { get; set; } + + /// + ///Optional specific amount of denoise to apply + /// + [ApiMember(Description="Optional specific amount of denoise to apply", ParameterType="query")] + public virtual float? Denoise { get; set; } + + /// + ///Number of images to generate in a single batch + /// + [ApiMember(Description="Number of images to generate in a single batch", ParameterType="query")] + public virtual int? BatchSize { get; set; } + + /// + ///Optional seed for reproducible results in image generation + /// + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert image to text + /// + [Api(Description="Convert image to text")] + public partial class QueueImageToText + : IReturn, IQueueGeneration + { + /// + ///The image to convert to text + /// + [ApiMember(Description="The image to convert to text", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Upscale an image + /// + [Api(Description="Upscale an image")] + public partial class QueueImageUpscale + : IReturn, IQueueGeneration + { + /// + ///The image to upscale + /// + [ApiMember(Description="The image to upscale", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Optional seed for reproducible results in image generation + /// + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Generate image with masked area + /// + [Api(Description="Generate image with masked area")] + public partial class QueueImageWithMask + : IReturn, IQueueGeneration + { + /// + ///Prompt describing the desired output in the masked area + /// + [ApiMember(Description="Prompt describing the desired output in the masked area", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } + + /// + ///Negative prompt describing what should not be in the masked area + /// + [ApiMember(Description="Negative prompt describing what should not be in the masked area", ParameterType="body")] + public virtual string NegativePrompt { get; set; } + + /// + ///The image to use as input + /// + [ApiMember(Description="The image to use as input", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The mask to use as input + /// + [ApiMember(Description="The mask to use as input", ParameterType="body")] + [Required] + public virtual Stream Mask { get; set; } + + /// + ///Optional specific amount of denoise to apply + /// + [ApiMember(Description="Optional specific amount of denoise to apply", ParameterType="query")] + public virtual float? Denoise { get; set; } + + /// + ///Optional seed for reproducible results in image generation + /// + [ApiMember(Description="Optional seed for reproducible results in image generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Base class for queueable transformation requests + /// + public partial class QueueMediaTransformResponse + { + /// + ///Unique identifier of the background job + /// + [ApiMember(Description="Unique identifier of the background job")] + public virtual long JobId { get; set; } + + /// + ///Client-provided identifier for the request + /// + [ApiMember(Description="Client-provided identifier for the request")] + public virtual string RefId { get; set; } + + /// + ///Current state of the background job + /// + [ApiMember(Description="Current state of the background job")] + public virtual BackgroundJobState JobState { get; set; } + + /// + ///Current status of the transformation request + /// + [ApiMember(Description="Current status of the transformation request")] + public virtual string Status { get; set; } + + /// + ///Detailed response status information + /// + [ApiMember(Description="Detailed response status information")] + public virtual ResponseStatus ResponseStatus { get; set; } + } + + public partial class QueueOpenAiChatCompletion + : IReturn + { + public virtual string RefId { get; set; } + public virtual string Provider { get; set; } + public virtual string ReplyTo { get; set; } + public virtual string Tag { get; set; } + public virtual OpenAiChat Request { get; set; } + } + + public partial class QueueOpenAiChatResponse + { + public virtual long Id { get; set; } + public virtual string RefId { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + /// + ///Scale an image to a specified size + /// + public partial class QueueScaleImage + : IReturn, IPost + { + /// + ///The image file to be scaled + /// + [ApiMember(Description="The image file to be scaled", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Desired width of the scaled image + /// + [ApiMember(Description="Desired width of the scaled image", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the scaled image + /// + [ApiMember(Description="Desired height of the scaled image", ParameterType="query")] + public virtual int? Height { get; set; } + } + + /// + ///Scale video + /// + [Api(Description="Scale video")] + public partial class QueueScaleVideo + : IReturn, IQueueMediaTransform + { + /// + ///The video file to be scaled + /// + [ApiMember(Description="The video file to be scaled", ParameterType="body")] + [Required] + public virtual Stream Video { get; set; } + + /// + ///Desired width of the scaled video + /// + [ApiMember(Description="Desired width of the scaled video", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the scaled video + /// + [ApiMember(Description="Desired height of the scaled video", ParameterType="query")] + public virtual int? Height { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert speech to text + /// + [Api(Description="Convert speech to text")] + public partial class QueueSpeechToText + : IReturn, IQueueGeneration + { + /// + ///The audio stream containing the speech to be transcribed + /// + [ApiMember(Description="The audio stream containing the speech to be transcribed", ParameterType="body")] + [Required] + public virtual Stream Speech { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Generate image from text description + /// + [Api(Description="Generate image from text description")] + public partial class QueueTextToImage + : IReturn, IQueueGeneration + { + /// + ///The main prompt describing the desired image + /// + [ApiMember(Description="The main prompt describing the desired image", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } + + /// + ///Optional prompt specifying what should not be in the image + /// + [ApiMember(Description="Optional prompt specifying what should not be in the image", ParameterType="body")] + public virtual string NegativePrompt { get; set; } + + /// + ///Desired width of the generated image + /// + [ApiMember(Description="Desired width of the generated image", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the generated image + /// + [ApiMember(Description="Desired height of the generated image", ParameterType="query")] + public virtual int? Height { get; set; } + + /// + ///Number of images to generate in a single batch + /// + [ApiMember(Description="Number of images to generate in a single batch", ParameterType="query")] + public virtual int? BatchSize { get; set; } + + /// + ///The AI model to use for image generation + /// + [ApiMember(Description="The AI model to use for image generation", ParameterType="query")] + public virtual string Model { get; set; } + + /// + ///Optional seed for reproducible results + /// + [ApiMember(Description="Optional seed for reproducible results", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Convert text to speech + /// + [Api(Description="Convert text to speech")] + public partial class QueueTextToSpeech + : IReturn, IQueueGeneration + { + /// + ///The text to be converted to speech + /// + [ApiMember(Description="The text to be converted to speech", ParameterType="body")] + [Required] + public virtual string Text { get; set; } + + /// + ///Optional seed for reproducible results in speech generation + /// + [ApiMember(Description="Optional seed for reproducible results in speech generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///The AI model to use for speech generation + /// + [ApiMember(Description="The AI model to use for speech generation", ParameterType="query")] + public virtual string Model { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Trim a video to a specified duration via start and end times + /// + public partial class QueueTrimVideo + : IReturn, IQueueMediaTransform + { + /// + ///The start time of the trimmed video (format: HH:MM:SS) + /// + [ApiMember(Description="The start time of the trimmed video (format: HH:MM:SS)", ParameterType="query")] + [Required] + public virtual string StartTime { get; set; } + + /// + ///The end time of the trimmed video (format: HH:MM:SS) + /// + [ApiMember(Description="The end time of the trimmed video (format: HH:MM:SS)", ParameterType="query")] + public virtual string EndTime { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Add a watermark to an image + /// + public partial class QueueWatermarkImage + : IReturn, IQueueMediaTransform, IPost + { + /// + ///The image file to be watermarked + /// + [ApiMember(Description="The image file to be watermarked", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The position of the watermark on the image + /// + [ApiMember(Description="The position of the watermark on the image", ParameterType="query")] + public virtual WatermarkPosition Position { get; set; } + + /// + ///The opacity of the watermark (0.0 to 1.0) + /// + [ApiMember(Description="The opacity of the watermark (0.0 to 1.0)", ParameterType="query")] + public virtual float Opacity { get; set; } + + /// + ///Scale of the watermark relative + /// + [ApiMember(Description="Scale of the watermark relative", ParameterType="query")] + public virtual float WatermarkScale { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Watermark video + /// + [Api(Description="Watermark video")] + public partial class QueueWatermarkVideo + : IReturn, IQueueMediaTransform + { + /// + ///The video file to be watermarked + /// + [ApiMember(Description="The video file to be watermarked", ParameterType="body")] + [Required] + public virtual Stream Video { get; set; } + + /// + ///The image file to use as a watermark + /// + [ApiMember(Description="The image file to use as a watermark", ParameterType="body")] + [Required] + public virtual Stream Watermark { get; set; } + + /// + ///Position of the watermark + /// + [ApiMember(Description="Position of the watermark", ParameterType="query")] + public virtual WatermarkPosition? Position { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + public partial class Reload + : IReturn, IPost + { + } + + public enum ResponseFormat + { + [EnumMember(Value="text")] + Text, + [EnumMember(Value="json_object")] + JsonObject, + } + + /// + ///Scale an image to a specified size + /// + public partial class ScaleImage + : IReturn, IPost + { + /// + ///The image file to be scaled + /// + [ApiMember(Description="The image file to be scaled", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///Desired width of the scaled image + /// + [ApiMember(Description="Desired width of the scaled image", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the scaled image + /// + [ApiMember(Description="Desired height of the scaled image", ParameterType="query")] + public virtual int? Height { get; set; } + } + + /// + ///Scale video + /// + [Api(Description="Scale video")] + public partial class ScaleVideo + : IReturn, IMediaTransform + { + /// + ///The video file to be scaled + /// + [ApiMember(Description="The video file to be scaled", ParameterType="body")] + [Required] + public virtual Stream Video { get; set; } + + /// + ///Desired width of the scaled video + /// + [ApiMember(Description="Desired width of the scaled video", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the scaled video + /// + [ApiMember(Description="Desired height of the scaled video", ParameterType="query")] + public virtual int? Height { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + /// + ///Convert speech to text + /// + [Api(Description="Convert speech to text")] + public partial class SpeechToText + : IReturn, IGeneration + { + /// + ///The audio stream containing the speech to be transcribed + /// + [ApiMember(Description="The audio stream containing the speech to be transcribed", ParameterType="body")] + [Required] + public virtual Stream Speech { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + public partial class SummaryStats + { + public virtual string Name { get; set; } + public virtual int Total { get; set; } + public virtual int TotalPromptTokens { get; set; } + public virtual int TotalCompletionTokens { get; set; } + public virtual double TotalMinutes { get; set; } + public virtual double TokensPerSecond { get; set; } + } + + public enum TaskType + { + OpenAiChat = 1, + Comfy = 2, + } + + /// + ///Output object for generated text + /// + public partial class TextOutput + { + /// + ///The generated text + /// + [ApiMember(Description="The generated text")] + public virtual string Text { get; set; } + } + + /// + ///Generate image from text description + /// + [Api(Description="Generate image from text description")] + public partial class TextToImage + : IReturn, IGeneration + { + /// + ///The main prompt describing the desired image + /// + [ApiMember(Description="The main prompt describing the desired image", ParameterType="body")] + [Validate("NotEmpty")] + public virtual string PositivePrompt { get; set; } + + /// + ///Optional prompt specifying what should not be in the image + /// + [ApiMember(Description="Optional prompt specifying what should not be in the image", ParameterType="body")] + public virtual string NegativePrompt { get; set; } + + /// + ///Desired width of the generated image + /// + [ApiMember(Description="Desired width of the generated image", ParameterType="query")] + public virtual int? Width { get; set; } + + /// + ///Desired height of the generated image + /// + [ApiMember(Description="Desired height of the generated image", ParameterType="query")] + public virtual int? Height { get; set; } + + /// + ///Number of images to generate in a single batch + /// + [ApiMember(Description="Number of images to generate in a single batch", ParameterType="query")] + public virtual int? BatchSize { get; set; } + + /// + ///The AI model to use for image generation + /// + [ApiMember(Description="The AI model to use for image generation", ParameterType="query")] + public virtual string Model { get; set; } + + /// + ///Optional seed for reproducible results + /// + [ApiMember(Description="Optional seed for reproducible results", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///Convert text to speech + /// + [Api(Description="Convert text to speech")] + public partial class TextToSpeech + : IReturn, IGeneration + { + /// + ///The text to be converted to speech + /// + [ApiMember(Description="The text to be converted to speech", ParameterType="body")] + [Required] + public virtual string Text { get; set; } + + /// + ///Optional seed for reproducible results in speech generation + /// + [ApiMember(Description="Optional seed for reproducible results in speech generation", ParameterType="query")] + public virtual int? Seed { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + + /// + ///Optional state to associate with the request + /// + [ApiMember(Description="Optional state to associate with the request", ParameterType="query")] + public virtual string State { get; set; } + } + + /// + ///The tool calls generated by the model, such as function calls. + /// + [DataContract] + public partial class ToolCall + { + /// + ///The ID of the tool call. + /// + [DataMember(Name="id")] + public virtual string Id { get; set; } + + /// + ///The type of the tool. Currently, only `function` is supported. + /// + [DataMember(Name="type")] + public virtual string Type { get; set; } + + /// + ///The function that the model called. + /// + [DataMember(Name="function")] + public virtual string Function { get; set; } + } + + /// + ///Trim a video to a specified duration via start and end times + /// + public partial class TrimVideo + : IReturn, IMediaTransform + { + /// + ///The start time of the trimmed video (format: HH:MM:SS) + /// + [ApiMember(Description="The start time of the trimmed video (format: HH:MM:SS)", ParameterType="query")] + [Required] + public virtual string StartTime { get; set; } + + /// + ///The end time of the trimmed video (format: HH:MM:SS) + /// + [ApiMember(Description="The end time of the trimmed video (format: HH:MM:SS)", ParameterType="query")] + public virtual string EndTime { get; set; } + + [Required] + public virtual Stream Video { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + + public partial class UpdateApiModel + : IReturn, IPatchDb + { + public virtual string Name { get; set; } + public virtual string Website { get; set; } + public virtual List Tags { get; set; } + public virtual string Latest { get; set; } + public virtual string Description { get; set; } + public virtual string Icon { get; set; } + } + + public partial class UpdateApiProvider + : IReturn, IPatchDb + { + public virtual int Id { get; set; } + /// + ///The Type of this API Provider + /// + public virtual int? ApiTypeId { get; set; } + /// + ///The Base URL for the API Provider + /// + public virtual string ApiBaseUrl { get; set; } + /// + ///The unique name for this API Provider + /// + public virtual string Name { get; set; } + /// + ///The API Key to use for this Provider + /// + public virtual string ApiKeyVar { get; set; } + /// + ///The API Key to use for this Provider + /// + public virtual string ApiKey { get; set; } + /// + ///Send the API Key in the Header instead of Authorization Bearer + /// + public virtual string ApiKeyHeader { get; set; } + /// + ///The URL to check if the API Provider is still online + /// + public virtual string HeartbeatUrl { get; set; } + /// + ///Override API Paths for different AI Requests + /// + public virtual Dictionary TaskPaths { get; set; } + /// + ///How many requests should be made concurrently + /// + public virtual int? Concurrency { get; set; } + /// + ///What priority to give this Provider to use for processing models + /// + public virtual int? Priority { get; set; } + /// + ///Whether the Provider is enabled + /// + public virtual bool? Enabled { get; set; } + /// + ///The models this API Provider should process + /// + public virtual List Models { get; set; } + /// + ///The selected models this API Provider should process + /// + public virtual List SelectedModels { get; set; } + } + + /// + ///Update a Generation API Provider + /// + public partial class UpdateGenerationApiProvider + : IReturn, IPatchDb + { + public virtual int Id { get; set; } + /// + ///The API Key to use for this Provider + /// + public virtual string ApiKey { get; set; } + /// + ///Send the API Key in the Header instead of Authorization Bearer + /// + public virtual string ApiKeyHeader { get; set; } + /// + ///Override Base URL for the Generation Provider + /// + public virtual string ApiBaseUrl { get; set; } + /// + ///Url to check if the API is online + /// + public virtual string HeartbeatUrl { get; set; } + /// + ///How many requests should be made concurrently + /// + public virtual int? Concurrency { get; set; } + /// + ///What priority to give this Provider to use for processing models + /// + public virtual int? Priority { get; set; } + /// + ///Whether the Provider is enabled + /// + public virtual bool? Enabled { get; set; } + /// + ///The models this API Provider should process + /// + public virtual List Models { get; set; } + } + + public partial class WaitForOpenAiChat + : IReturn, IGet + { + public virtual int? Id { get; set; } + public virtual string RefId { get; set; } + } + + /// + ///Add a watermark to an image + /// + public partial class WatermarkImage + : IReturn, IPost + { + /// + ///The image file to be watermarked + /// + [ApiMember(Description="The image file to be watermarked", ParameterType="body")] + [Required] + public virtual Stream Image { get; set; } + + /// + ///The position of the watermark on the image + /// + [ApiMember(Description="The position of the watermark on the image", ParameterType="query")] + public virtual WatermarkPosition Position { get; set; } + + /// + ///Scale of the watermark relative + /// + [ApiMember(Description="Scale of the watermark relative", ParameterType="query")] + public virtual float WatermarkScale { get; set; } + + /// + ///The opacity of the watermark (0.0 to 1.0) + /// + [ApiMember(Description="The opacity of the watermark (0.0 to 1.0)", ParameterType="query")] + public virtual float Opacity { get; set; } + } + + public enum WatermarkPosition + { + TopLeft, + TopRight, + BottomLeft, + BottomRight, + Center, + } + + /// + ///Watermark video + /// + [Api(Description="Watermark video")] + public partial class WatermarkVideo + : IReturn, IMediaTransform + { + /// + ///The video file to be watermarked + /// + [ApiMember(Description="The video file to be watermarked", ParameterType="body")] + [Required] + public virtual Stream Video { get; set; } + + /// + ///The image file to use as a watermark + /// + [ApiMember(Description="The image file to use as a watermark", ParameterType="body")] + [Required] + public virtual Stream Watermark { get; set; } + + /// + ///Position of the watermark + /// + [ApiMember(Description="Position of the watermark", ParameterType="query")] + public virtual WatermarkPosition? Position { get; set; } + + /// + ///Optional client-provided identifier for the request + /// + [ApiMember(Description="Optional client-provided identifier for the request", ParameterType="query")] + public virtual string RefId { get; set; } + + /// + ///Optional queue or topic to reply to + /// + [ApiMember(Description="Optional queue or topic to reply to", ParameterType="query")] + public virtual string ReplyTo { get; set; } + + /// + ///Tag to identify the request + /// + [ApiMember(Description="Tag to identify the request", ParameterType="query")] + public virtual string Tag { get; set; } + } + +} + +namespace AiServer.ServiceModel.Types +{ + public partial class AiProviderBase + : ApiProviderBase + { + public AiProviderBase() + { + Models = new List{}; + } + + public virtual List Models { get; set; } + } + + public enum AiServiceProvider + { + Replicate, + Comfy, + OpenAi, + } + + public partial class ApiProviderBase + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + public virtual string ApiKeyVar { get; set; } + public virtual string ApiKey { get; set; } + public virtual string ApiKeyHeader { get; set; } + public virtual string ApiBaseUrl { get; set; } + public virtual string HeartbeatUrl { get; set; } + public virtual int Concurrency { get; set; } + public virtual int Priority { get; set; } + public virtual bool Enabled { get; set; } + public virtual DateTime? OfflineDate { get; set; } + public virtual DateTime CreatedDate { get; set; } + } + + public partial class ApiTypeBase + { + public ApiTypeBase() + { + ApiModels = new Dictionary{}; + } + + public virtual int Id { get; set; } + public virtual string ApiBaseUrl { get; set; } + public virtual string ApiKeyHeader { get; set; } + public virtual string Name { get; set; } + public virtual string Website { get; set; } + public virtual string Icon { get; set; } + public virtual Dictionary ApiModels { get; set; } + public virtual AiServiceProvider Provider { get; set; } + } + + public enum ComfyMaskSource + { + red, + blue, + green, + alpha, + } + + public enum ComfySampler { - /// - ///An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106. - /// - [DataMember(Name="response_format")] - public virtual ResponseFormat Type { get; set; } + euler, + euler_cfg_pp, + euler_ancestral, + euler_ancestral_cfg_pp, + huen, + huenpp2, + dpm_2, + dpm_2_ancestral, + lms, + dpm_fast, + dpm_adaptive, + dpmpp_2s_ancestral, + dpmpp_sde, + dpmpp_sde_gpu, + dpmpp_2m, + dpmpp_2m_sde, + dpmpp_2m_sde_gpu, + dpmpp_3m_sde, + dpmpp_3m_sde_gpu, + ddpm, + lcm, + ddim, + uni_pc, + uni_pc_bh2, } - [DataContract] - public partial class OpenAiTools + public partial class GenerationApiProvider + : AiProviderBase { - /// - ///The type of the tool. Currently, only function is supported. - /// - [DataMember(Name="type")] - public virtual OpenAiToolType Type { get; set; } + [References(typeof(AiServer.ServiceModel.Types.GenerationApiType))] + public virtual int GenerationApiTypeId { get; set; } + + public virtual GenerationApiType Type { get; set; } } - public enum OpenAiToolType + public partial class GenerationApiType + : ApiTypeBase { - [EnumMember(Value="function")] - Function, } - /// - ///Usage statistics for the completion request. - /// - [DataContract] - public partial class OpenAiUsage + public enum ModelType { - /// - ///Number of tokens in the generated completion. - /// - [DataMember(Name="completion_tokens")] - public virtual int CompletionTokens { get; set; } + TextToImage, + TextEncoder, + ImageUpscale, + TextToSpeech, + TextToAudio, + SpeechToText, + ImageToText, + ImageToImage, + ImageWithMask, + VAE, + } - /// - ///Number of tokens in the prompt. - /// - [DataMember(Name="prompt_tokens")] - public virtual int PromptTokens { get; set; } + public partial class ProviderModelDefaults + { + public ProviderModelDefaults() + { + ApiModels = new Dictionary{}; + } - /// - ///Total number of tokens used in the request (prompt + completion). - /// - [DataMember(Name="total_tokens")] - public virtual int TotalTokens { get; set; } + public virtual string Id { get; set; } + public virtual Dictionary ApiModels { get; set; } + public virtual string Url { get; set; } + public virtual double? Quality { get; set; } + public virtual string AspectRatio { get; set; } + public virtual double? CfgScale { get; set; } + public virtual string Scheduler { get; set; } + public virtual ComfySampler? Sampler { get; set; } + public virtual int? Width { get; set; } + public virtual int? Height { get; set; } + public virtual int? Steps { get; set; } + public virtual string NegativePrompt { get; set; } + public virtual ModelType? ModelType { get; set; } } - /// - ///Different Models available in AI Server - /// - public partial class QueryApiModels - : QueryDb, IReturn> + public partial class QueryGenerationApiTypes + : QueryDb, IReturn> { } - /// - ///View and API Provider Models - /// - public partial class QueryApiProviderModels - : QueryDb, IReturn> +} + +namespace ServiceStack.Jobs +{ + public partial class AdminCancelJobs + : IReturn, IGet { - public virtual int? ApiProviderId { get; set; } - public virtual string Model { get; set; } - public virtual string ApiModel { get; set; } + public AdminCancelJobs() + { + Ids = new List{}; + } + + public virtual List Ids { get; set; } + public virtual string Worker { get; set; } } - /// - ///API Providers that can process AI Tasks - /// - public partial class QueryApiProviders - : QueryDb, IReturn> + public partial class AdminCancelJobsResponse { - public virtual string Name { get; set; } + public AdminCancelJobsResponse() + { + Results = new List{}; + Errors = new Dictionary{}; + } + + public virtual List Results { get; set; } + public virtual Dictionary Errors { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } } - /// - ///The Type and behavior of different API Providers - /// - public partial class QueryApiType - : QueryDb, IReturn> + public partial class AdminGetJob + : IReturn, IGet { + public virtual long? Id { get; set; } + public virtual string RefId { get; set; } } - public partial class QueryCompletedChatTasks - : QueryDb, IReturn> + public partial class AdminGetJobProgress + : IReturn, IGet { - public virtual string Db { get; set; } - public virtual int? Id { get; set; } - public virtual string RefId { get; set; } + [Validate("GreaterThan(0)")] + public virtual long Id { get; set; } + + public virtual int? LogStart { get; set; } } - public partial class QueryFailedChatTasks - : QueryDb, IReturn> + public partial class AdminGetJobProgressResponse { - public virtual string Db { get; set; } + public virtual BackgroundJobState State { get; set; } + public virtual double? Progress { get; set; } + public virtual string Status { get; set; } + public virtual string Logs { get; set; } + public virtual int? DurationMs { get; set; } + public virtual ResponseStatus Error { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } } - public partial class QueryOpenAiChat - : QueryDb, IReturn> + public partial class AdminGetJobResponse { - public virtual int? Id { get; set; } - public virtual string RefId { get; set; } + public virtual JobSummary Result { get; set; } + public virtual BackgroundJob Queued { get; set; } + public virtual CompletedJob Completed { get; set; } + public virtual FailedJob Failed { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } } - public partial class QueryTaskSummary - : QueryDb, IReturn> + public partial class AdminJobDashboard + : IReturn, IGet { + public virtual DateTime? From { get; set; } + public virtual DateTime? To { get; set; } } - public partial class RerunCompletedTasks - : IReturn, IPost + public partial class AdminJobDashboardResponse { - public RerunCompletedTasks() + public AdminJobDashboardResponse() { - Ids = new List{}; + Commands = new List{}; + Apis = new List{}; + Workers = new List{}; + Today = new List{}; } - public virtual List Ids { get; set; } + public virtual List Commands { get; set; } + public virtual List Apis { get; set; } + public virtual List Workers { get; set; } + public virtual List Today { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } + } + + public partial class AdminJobInfo + : IReturn, IGet + { + public virtual DateTime? Month { get; set; } } - public partial class RerunCompletedTasksResponse + public partial class AdminJobInfoResponse { - public RerunCompletedTasksResponse() + public AdminJobInfoResponse() { - Errors = new Dictionary{}; - Results = new List{}; + MonthDbs = new List{}; + TableCounts = new Dictionary{}; } - public virtual Dictionary Errors { get; set; } - public virtual List Results { get; set; } + public virtual List MonthDbs { get; set; } + public virtual Dictionary TableCounts { get; set; } public virtual ResponseStatus ResponseStatus { get; set; } } - public partial class ResetActiveProviders - : IReturn, IGet + public partial class AdminQueryBackgroundJobs + : QueryDb, IReturn> { + public virtual int? Id { get; set; } + public virtual string RefId { get; set; } } - public enum ResponseFormat + public partial class AdminQueryCompletedJobs + : QueryDb, IReturn> { - [EnumMember(Value="text")] - Text, - [EnumMember(Value="json_object")] - JsonObject, + public virtual DateTime? Month { get; set; } } - public partial class RestartWorkers - : IReturn, IPost + public partial class AdminQueryFailedJobs + : QueryDb, IReturn> { + public virtual DateTime? Month { get; set; } } - public partial class StartWorkers - : IReturn, IPost + public partial class AdminQueryJobSummary + : QueryDb, IReturn> + { + public virtual int? Id { get; set; } + public virtual string RefId { get; set; } + } + + public partial class AdminQueryScheduledTasks + : QueryDb, IReturn> { } - public partial class StopWorkers - : IReturn, IPost + public partial class AdminRequeueFailedJobs + : IReturn { + public AdminRequeueFailedJobs() + { + Ids = new List{}; + } + + public virtual List Ids { get; set; } } - public partial class SummaryStats + public partial class AdminRequeueFailedJobsJobsResponse { - public virtual string Name { get; set; } - public virtual int TotalTasks { get; set; } - public virtual int TotalPromptTokens { get; set; } - public virtual int TotalCompletionTokens { get; set; } - public virtual double TotalMinutes { get; set; } - public virtual double TokensPerSecond { get; set; } + public AdminRequeueFailedJobsJobsResponse() + { + Results = new List{}; + Errors = new Dictionary{}; + } + + public virtual List Results { get; set; } + public virtual Dictionary Errors { get; set; } + public virtual ResponseStatus ResponseStatus { get; set; } } - public partial class TaskBase + public partial class BackgroundJob + : BackgroundJobBase { public virtual long Id { get; set; } - public virtual string Model { get; set; } - public virtual string Provider { get; set; } + } + + public partial class BackgroundJobBase + : IMeta + { + public BackgroundJobBase() + { + Args = new Dictionary{}; + Meta = new Dictionary{}; + } + + public virtual long Id { get; set; } + public virtual long? ParentId { get; set; } public virtual string RefId { get; set; } + public virtual string Worker { get; set; } public virtual string Tag { get; set; } - public virtual string ReplyTo { get; set; } + public virtual string BatchId { get; set; } + public virtual string Callback { get; set; } + public virtual long? DependsOn { get; set; } + public virtual DateTime? RunAfter { get; set; } public virtual DateTime CreatedDate { get; set; } public virtual string CreatedBy { get; set; } - public virtual string Worker { get; set; } - public virtual string WorkerIp { get; set; } public virtual string RequestId { get; set; } + public virtual string RequestType { get; set; } + public virtual string Command { get; set; } + public virtual string Request { get; set; } + public virtual string RequestBody { get; set; } + public virtual string UserId { get; set; } + public virtual string Response { get; set; } + public virtual string ResponseBody { get; set; } + public virtual BackgroundJobState State { get; set; } public virtual DateTime? StartedDate { get; set; } public virtual DateTime? CompletedDate { get; set; } - public virtual int DurationMs { get; set; } + public virtual DateTime? NotifiedDate { get; set; } public virtual int? RetryLimit { get; set; } - public virtual int Retries { get; set; } - public virtual DateTime? NotificationDate { get; set; } + public virtual int Attempts { get; set; } + public virtual int DurationMs { get; set; } + public virtual int? TimeoutSecs { get; set; } + public virtual double? Progress { get; set; } + public virtual string Status { get; set; } + public virtual string Logs { get; set; } + public virtual DateTime? LastActivityDate { get; set; } + public virtual string ReplyTo { get; set; } public virtual string ErrorCode { get; set; } public virtual ResponseStatus Error { get; set; } + public virtual Dictionary Args { get; set; } + public virtual Dictionary Meta { get; set; } } - public partial class TaskSummary + public partial class BackgroundJobOptions { - public virtual long Id { get; set; } - public virtual TaskType Type { get; set; } - public virtual string Model { get; set; } - public virtual string Provider { get; set; } + public BackgroundJobOptions() + { + Args = new Dictionary{}; + } + public virtual string RefId { get; set; } + public virtual long? ParentId { get; set; } + public virtual string Worker { get; set; } + public virtual DateTime? RunAfter { get; set; } + public virtual string Callback { get; set; } + public virtual long? DependsOn { get; set; } + public virtual string UserId { get; set; } + public virtual int? RetryLimit { get; set; } + public virtual string ReplyTo { get; set; } public virtual string Tag { get; set; } - public virtual int PromptTokens { get; set; } - public virtual int CompletionTokens { get; set; } - public virtual int DurationMs { get; set; } - public virtual DateTime CreatedDate { get; set; } + public virtual string BatchId { get; set; } + public virtual string CreatedBy { get; set; } + public virtual int? TimeoutSecs { get; set; } + public virtual TimeSpan? Timeout { get; set; } + public virtual Dictionary Args { get; set; } + public virtual bool? RunCommand { get; set; } } - public enum TaskType + public enum BackgroundJobState { - OpenAiChat = 1, + Queued, + Started, + Executed, + Completed, + Failed, + Cancelled, } - /// - ///The tool calls generated by the model, such as function calls. - /// - [DataContract] - public partial class ToolCall + public partial class CompletedJob + : BackgroundJobBase { - /// - ///The ID of the tool call. - /// - [DataMember(Name="id")] - public virtual string Id { get; set; } - - /// - ///The type of the tool. Currently, only `function` is supported. - /// - [DataMember(Name="type")] - public virtual string Type { get; set; } - - /// - ///The function that the model called. - /// - [DataMember(Name="function")] - public virtual string Function { get; set; } } - public partial class UpdateApiProvider - : IReturn, IPatchDb + public partial class FailedJob + : BackgroundJobBase { - public virtual int Id { get; set; } - public virtual string ApiKey { get; set; } - public virtual string ApiBaseUrl { get; set; } - public virtual string HeartbeatUrl { get; set; } - public virtual int? Concurrency { get; set; } - public virtual int? Priority { get; set; } - public virtual bool? Enabled { get; set; } } - /// - ///Update the Model supported by the API Provider - /// - public partial class UpdateApiProviderModel - : IReturn, IPatchDb + public partial class HourSummary { - /// - ///The ApiProviderModel Id - /// - public virtual int Id { get; set; } - /// - ///The ApiProvider Id - /// - public virtual int? ApiProviderId { get; set; } - /// - ///Supported ApiModel Name - /// - public virtual string Model { get; set; } - /// - ///Model to use when sending requests to the API Provider - /// - public virtual string ApiModel { get; set; } + public virtual string Hour { get; set; } + public virtual int Total { get; set; } + public virtual int Completed { get; set; } + public virtual int Failed { get; set; } + public virtual int Cancelled { get; set; } } - public partial class WorkerStats + public partial class JobStatSummary { public virtual string Name { get; set; } - public virtual long Queued { get; set; } - public virtual long Received { get; set; } - public virtual long Completed { get; set; } - public virtual long Retries { get; set; } - public virtual long Failed { get; set; } - public virtual DateTime? Offline { get; set; } - public virtual bool Running { get; set; } - } - -} - -namespace AiServer.ServiceModel.Types -{ - public partial class OpenAiChatCompleted - : OpenAiChatTask - { - } - - public partial class OpenAiChatFailed - : OpenAiChatTask - { - public virtual DateTime FailedDate { get; set; } + public virtual int Total { get; set; } + public virtual int Completed { get; set; } + public virtual int Retries { get; set; } + public virtual int Failed { get; set; } + public virtual int Cancelled { get; set; } } - public partial class OpenAiChatRequest + public partial class JobSummary { public virtual long Id { get; set; } - public virtual string Model { get; set; } - public virtual string Provider { get; set; } - public virtual OpenAiChat Request { get; set; } + public virtual long? ParentId { get; set; } + public virtual string RefId { get; set; } + public virtual string Worker { get; set; } + public virtual string Tag { get; set; } + public virtual string BatchId { get; set; } + public virtual DateTime CreatedDate { get; set; } + public virtual string CreatedBy { get; set; } + public virtual string RequestType { get; set; } + public virtual string Command { get; set; } + public virtual string Request { get; set; } + public virtual string Response { get; set; } + public virtual string UserId { get; set; } + public virtual string Callback { get; set; } + public virtual DateTime? StartedDate { get; set; } + public virtual DateTime? CompletedDate { get; set; } + public virtual BackgroundJobState State { get; set; } + public virtual int DurationMs { get; set; } + public virtual int Attempts { get; set; } + public virtual string ErrorCode { get; set; } + public virtual string ErrorMessage { get; set; } } - public partial class OpenAiChatTask - : TaskBase + public partial class ScheduledTask { - public virtual OpenAiChat Request { get; set; } - public virtual OpenAiChatResponse Response { get; set; } + public virtual long Id { get; set; } + public virtual string Name { get; set; } + public virtual TimeSpan? Interval { get; set; } + public virtual string CronExpression { get; set; } + public virtual string RequestType { get; set; } + public virtual string Command { get; set; } + public virtual string Request { get; set; } + public virtual string RequestBody { get; set; } + public virtual BackgroundJobOptions Options { get; set; } + public virtual DateTime? LastRun { get; set; } + public virtual long? LastJobId { get; set; } } - public enum PeriodicFrequency + public partial class WorkerStats { - Minute, - Hourly, - Daily, - Monthly, + public virtual string Name { get; set; } + public virtual long Queued { get; set; } + public virtual long Received { get; set; } + public virtual long Completed { get; set; } + public virtual long Retries { get; set; } + public virtual long Failed { get; set; } + public virtual long? RunningJob { get; set; } + public virtual TimeSpan? RunningTime { get; set; } } }