AI Dev Kit
Search Results for

    Show / Hide Table of Contents

    Class GENChatTask

    Task for generating text using an LLM model. Supports instructions and role-based prompts.

    Inheritance
    object
    GENTask<GENChatTask, ChatMessage, ChatCompletion>
    GENChatTask
    Implements
    IGENTask
    Inherited Members
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.token
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.enableHistory
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.isCanceled
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.outputMimeType
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.Cancel()
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetOption(string, object)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.TryGetOption<T>(string, out T)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetModel(Model)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetCount(int)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetOutputPath(string)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetSender(string)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetIgnoreLogs(bool)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.EnablePromptHistory(bool)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.SetCancellationToken(CancellationToken)
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.ExecuteAsyncINTERNAL()
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.ExecuteAsync()
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.ExecuteAsync<T>()
    Namespace: Glitch9.AIDevKit.Advanced.Chat
    Assembly: .dll
    Syntax
    public class GENChatTask : GENTask<GENChatTask, ChatMessage, ChatCompletion>, IGENTask

    Constructors

    GENChatTask(ChatSession, ChatMessage)

    Declaration
    public GENChatTask(ChatSession chatSession, ChatMessage chatMessage)
    Parameters
    Type Name Description
    ChatSession chatSession
    ChatMessage chatMessage

    Methods

    AddFunctions(params FunctionCall[])

    Declaration
    public GENChatTask AddFunctions(params FunctionCall[] functions)
    Parameters
    Type Name Description
    FunctionCall[] functions
    Returns
    Type Description
    GENChatTask

    AddTools(params ToolCall[])

    Declaration
    public GENChatTask AddTools(params ToolCall[] tools)
    Parameters
    Type Name Description
    ToolCall[] tools
    Returns
    Type Description
    GENChatTask

    ExecuteAsyncINTERNAL()

    Executes the task and returns the generated result.

    Declaration
    protected override UniTask<ChatCompletion> ExecuteAsyncINTERNAL()
    Returns
    Type Description
    UniTask<ChatCompletion>
    Overrides
    GENTask<GENChatTask, ChatMessage, ChatCompletion>.ExecuteAsyncINTERNAL()

    GetStreamHandler()

    Declaration
    protected ChatCompletionStreamHandler GetStreamHandler()
    Returns
    Type Description
    ChatCompletionStreamHandler

    OnStreamDone(Action<ChatCompletion>)

    Declaration
    public GENChatTask OnStreamDone(Action<ChatCompletion> onDone)
    Parameters
    Type Name Description
    Action<ChatCompletion> onDone
    Returns
    Type Description
    GENChatTask

    OnStreamError(Action<string>)

    Declaration
    public GENChatTask OnStreamError(Action<string> onError)
    Parameters
    Type Name Description
    Action<string> onError
    Returns
    Type Description
    GENChatTask

    OnStreamText(Action<string>, Action<string>)

    Declaration
    public GENChatTask OnStreamText(Action<string> onReceiveText, Action<string> onReceiveRefusal = null)
    Parameters
    Type Name Description
    Action<string> onReceiveText
    Action<string> onReceiveRefusal
    Returns
    Type Description
    GENChatTask

    OnStreamToolCalls(Action<ToolCall[]>)

    Declaration
    public GENChatTask OnStreamToolCalls(Action<ToolCall[]> onToolCalls)
    Parameters
    Type Name Description
    Action<ToolCall[]> onToolCalls
    Returns
    Type Description
    GENChatTask

    SetFunctions(params FunctionCall[])

    Declaration
    public GENChatTask SetFunctions(params FunctionCall[] functions)
    Parameters
    Type Name Description
    FunctionCall[] functions
    Returns
    Type Description
    GENChatTask

    SetTools(params ToolCall[])

    Declaration
    public GENChatTask SetTools(params ToolCall[] tools)
    Parameters
    Type Name Description
    ToolCall[] tools
    Returns
    Type Description
    GENChatTask

    StreamAsync(IChatCompletionStreamHandler)

    Declaration
    public UniTask StreamAsync(IChatCompletionStreamHandler streamHandler = null)
    Parameters
    Type Name Description
    IChatCompletionStreamHandler streamHandler
    Returns
    Type Description
    UniTask

    Implements

    IGENTask

    Extension Methods

    FluentAPIExtensions.SetAspectRatio<TTask>(TTask, AspectRatio)
    FluentAPIExtensions.SetPersonGeneration<TTask>(TTask, PersonGeneration)
    FluentAPIExtensions.SetSize<T>(T, ImageSize)
    In this article
    Back to top Generated by DocFX