AI DevKit
Search Results for

    Show / Hide Table of Contents

    Class GENTask<TSelf, TOptions, TPrompt, TResult>

    Abstract base class for all generative AI tasks (text, image, audio). Supports text, image, and audio prompts with fluent configuration methods.

    Inheritance
    object
    TaskBase<TSelf, TResult>
    GENTask<TSelf, TOptions, TPrompt, TResult>
    GENAudioGenerationTask<TSelf, TOptions, TPrompt>
    GENAudioRecordingTask<TSelf, TResult>
    GENImageGenerationTask<TTask, TPrompt>
    GENModerationTask
    GENPixelArtGenerationTask<TSelf, TOptions, TPrompt, TResult>
    GENTextGenerationTask<TSelf, TResult>
    GENVideoTask
    Implements
    IGENTask
    Inherited Members
    TaskBase<TSelf, TResult>.Method
    TaskBase<TSelf, TResult>.Cts
    TaskBase<TSelf, TResult>.Token
    TaskBase<TSelf, TResult>.Api
    TaskBase<TSelf, TResult>.Sender
    TaskBase<TSelf, TResult>.IgnoreLogs
    TaskBase<TSelf, TResult>.IsCanceled
    TaskBase<TSelf, TResult>.RequestMimeType
    TaskBase<TSelf, TResult>.ResponseMimeType
    TaskBase<TSelf, TResult>.IsWrapperTask
    TaskBase<TSelf, TResult>.SetSender(string)
    TaskBase<TSelf, TResult>.SetIgnoreLogs(bool)
    TaskBase<TSelf, TResult>.SetCancellationToken(CancellationToken)
    TaskBase<TSelf, TResult>.ExecuteAsync()
    TaskBase<TSelf, TResult>.ExecuteAsyncINTERNAL()
    TaskBase<TSelf, TResult>.ExecuteAsync<T>()
    TaskBase<TSelf, TResult>.CancelTask()
    Namespace: Glitch9.AIDevKit
    Assembly: .dll
    Syntax
    public abstract class GENTask<TSelf, TOptions, TPrompt, TResult> : TaskBase<TSelf, TResult>, IGENTask where TSelf : GENTask<TSelf, TOptions, TPrompt, TResult> where TOptions : IGENOptions where TResult : IGeneratedResult
    Type Parameters
    Name Description
    TSelf
    TOptions
    TPrompt
    TResult

    Constructors

    GENTask()

    Declaration
    protected GENTask()

    GENTask(TPrompt)

    Declaration
    protected GENTask(TPrompt prompt)
    Parameters
    Type Name Description
    TPrompt prompt

    Properties

    Api

    Declaration
    public override Api Api { get; set; }
    Property Value
    Type Description
    Api
    Overrides
    TaskBase<TSelf, TResult>.Api

    MaxN

    Declaration
    public int MaxN { get; }
    Property Value
    Type Description
    int

    ModelId

    Declaration
    public string ModelId { get; }
    Property Value
    Type Description
    string

    N

    Declaration
    public int N { get; }
    Property Value
    Type Description
    int

    Options

    Declaration
    public TOptions Options { get; set; }
    Property Value
    Type Description
    TOptions

    OutputFileNote

    Declaration
    public string OutputFileNote { get; }
    Property Value
    Type Description
    string

    OutputFilePath

    Declaration
    public string OutputFilePath { get; }
    Property Value
    Type Description
    string

    Prompt

    Declaration
    public TPrompt Prompt { get; set; }
    Property Value
    Type Description
    TPrompt

    RecordHistory

    Declaration
    public bool RecordHistory { get; }
    Property Value
    Type Description
    bool

    SaveGeneratedContents

    Declaration
    public bool SaveGeneratedContents { get; }
    Property Value
    Type Description
    bool

    Methods

    CreateMergedHistoryRecordINTERNAL(List<TResult>)

    Declaration
    protected void CreateMergedHistoryRecordINTERNAL(List<TResult> results)
    Parameters
    Type Name Description
    List<TResult> results

    EnablePromptHistory(bool)

    Enables or disables prompt history for this task.

    Declaration
    public TSelf EnablePromptHistory(bool enablePromptHistory = true)
    Parameters
    Type Name Description
    bool enablePromptHistory
    Returns
    Type Description
    TSelf

    ExecuteAsync()

    Executes the task and returns the output of type TResult. This is the main entry point for executing the task.

    Declaration
    public override UniTask<TResult> ExecuteAsync()
    Returns
    Type Description
    UniTask<TResult>
    Overrides
    TaskBase<TSelf, TResult>.ExecuteAsync()

    GetPrompt()

    Declaration
    public IPrompt GetPrompt()
    Returns
    Type Description
    IPrompt

    ResolveOutputPath(Api?, string)

    Declaration
    protected virtual TSelf ResolveOutputPath(Api? apiOverride = null, string keyword = null)
    Parameters
    Type Name Description
    Api? apiOverride
    string keyword
    Returns
    Type Description
    TSelf

    SaveContentsTo(string, string)

    Sets the download path for the generated content(s). This is the path where the generated content(s) will be saved.

    Declaration
    public TSelf SaveContentsTo(string outputFilePath = null, string outputFileNote = null)
    Parameters
    Type Name Description
    string outputFilePath

    The path where the generated content(s) will be saved.

    string outputFileNote
    Returns
    Type Description
    TSelf

    SetCount(int)

    Sets the number of outputs to generate (e.g., number of images or responses).

    Declaration
    public TSelf SetCount(int count)
    Parameters
    Type Name Description
    int count
    Returns
    Type Description
    TSelf

    SetModel(Api, string)

    Added new on 2025.07.17 Sets the AI model with API and model ID.

    Declaration
    public TSelf SetModel(Api api, string modelId)
    Parameters
    Type Name Description
    Api api
    string modelId
    Returns
    Type Description
    TSelf

    SetModel(Model)

    Sets the AI model to be used for generation.

    Declaration
    public TSelf SetModel(Model model)
    Parameters
    Type Name Description
    Model model
    Returns
    Type Description
    TSelf

    SetOptions(TOptions)

    Declaration
    public TSelf SetOptions(TOptions apiOptions)
    Parameters
    Type Name Description
    TOptions apiOptions
    Returns
    Type Description
    TSelf

    SetRequestMimeType(MIMEType)

    Declaration
    public TSelf SetRequestMimeType(MIMEType mimeType)
    Parameters
    Type Name Description
    MIMEType mimeType
    Returns
    Type Description
    TSelf

    SetResponseMimeType(MIMEType)

    Sets a custom MIME type for the output.

    Declaration
    public TSelf SetResponseMimeType(MIMEType mimeType)
    Parameters
    Type Name Description
    MIMEType mimeType
    Returns
    Type Description
    TSelf

    YieldAsync()

    Allows to set N more than the selected model allows. This is useful for streaming the responses one by one.

    Declaration
    public IAsyncEnumerable<TResult> YieldAsync()
    Returns
    Type Description
    IAsyncEnumerable<TResult>

    YieldAsyncINTERNAL()

    Declaration
    protected virtual IAsyncEnumerable<TResult> YieldAsyncINTERNAL()
    Returns
    Type Description
    IAsyncEnumerable<TResult>

    Implements

    IGENTask
    In this article
    Back to top Generated by DocFX