AI DevKit
Search Results for

    Show / Hide Table of Contents

    Class AIGenerative<TOptions, TProfile, TInput, TOutput>

    Inheritance
    object
    AIComponent
    AIGenerative<TOptions, TProfile, TInput, TOutput>
    AIGenerativeRecorder<TOptions, TProfile, TOutput>
    ContentModerator
    ImageGenerator
    SpeechGenerator
    Inherited Members
    AIComponent.streaming
    AIComponent.onReceiveUsage
    AIComponent.onErrorOccured
    AIComponent.DebugMode
    AIComponent.Logger
    AIComponent.IsProcessing
    AIComponent.IsSubcomponent
    AIComponent.SetParentComponent(AIComponent)
    AIComponent.Enqueue(Func<UniTask>)
    AIComponent.CancelAllRequests()
    AIComponent.CancelLastRequest()
    AIComponent.OnReceiveUsageData(Usage)
    AIComponent.LogInfo(string)
    AIComponent.LogWarning(string)
    AIComponent.LogError(string)
    AIComponent.IsInvalidPrompt(string)
    AIComponent.IsInvalidFile(IFile)
    AIComponent.IsInvalidFiles(IList<IFile>)
    AIComponent.NoRequiredComponent(MonoBehaviour)
    AIComponent.IsInvalidPrompt<T>(T)
    AIComponent.IsInvalidPrompt(TextPrompt, List<ChatMessage>)
    Namespace: Glitch9.AIDevKit.Components
    Assembly: .dll
    Syntax
    public abstract class AIGenerative<TOptions, TProfile, TInput, TOutput> : AIComponent where TOptions : GenerativeOptions, new() where TProfile : GenerativeProfile<TOptions>
    Type Parameters
    Name Description
    TOptions
    TProfile
    TInput
    TOutput

    Fields

    onReceiveGeneratedContent

    Declaration
    public UnityEvent<TOutput> onReceiveGeneratedContent
    Field Value
    Type Description
    UnityEvent<TOutput>

    onSendRequest

    Declaration
    [FoldableFieldAttribute]
    public UnityEvent<TInput> onSendRequest
    Field Value
    Type Description
    UnityEvent<TInput>

    outputPath

    Declaration
    protected string outputPath
    Field Value
    Type Description
    string

    saveOutput

    Declaration
    protected bool saveOutput
    Field Value
    Type Description
    bool

    Properties

    Api

    Declaration
    public override Api Api { get; }
    Property Value
    Type Description
    Api
    Overrides
    AIComponent.Api

    Options

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

    SaveFolderPath

    Declaration
    public string SaveFolderPath { get; set; }
    Property Value
    Type Description
    string

    SaveGeneratedContents

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

    Methods

    Awake()

    Declaration
    protected override void Awake()
    Overrides
    AIComponent.Awake()

    Generate(TInput)

    Generates output based on the provided input prompt. This method enqueues the generation task and triggers the onSendRequest event. It should be called to start the generation process.

    Declaration
    public void Generate(TInput prompt)
    Parameters
    Type Name Description
    TInput prompt

    GenerateAsync(TInput)

    Asynchronously generates output based on the provided input prompt. This method should be overridden in derived classes to implement the actual generation logic. It returns a UniTask that resolves to the generated output. The onReceiveGeneratedContent event is triggered with the generated output once the task completes.

    Declaration
    public abstract UniTask<TOutput> GenerateAsync(TInput prompt)
    Parameters
    Type Name Description
    TInput prompt
    Returns
    Type Description
    UniTask<TOutput>

    InitializeSubcomponent(TOptions)

    Only call this method if you are using this component as a subcomponent of another component. It initializes the subcomponent with the provided profile. If the profile is null, it will log an error.

    Declaration
    public void InitializeSubcomponent(TOptions options)
    Parameters
    Type Name Description
    TOptions options
    In this article
    Back to top Generated by DocFX