Table of Contents

Class AIGenerative<TOptions, TProfile, TInput, TOutput>

public abstract class AIGenerative<TOptions, TProfile, TInput, TOutput> : AIComponent where TOptions : GenerativeOptions, new() where TProfile : GenerativeProfile<TOptions>

Type Parameters

TOptions
TProfile
TInput
TOutput
Inheritance
object
AIGenerative<TOptions, TProfile, TInput, TOutput>
Derived
Inherited Members

Fields

onReceiveGeneratedContent

public UnityEvent<TOutput> onReceiveGeneratedContent

Field Value

UnityEvent<TOutput>

onSendRequest

[FoldableFieldAttribute]
public UnityEvent<TInput> onSendRequest

Field Value

UnityEvent<TInput>

outputPath

protected string outputPath

Field Value

string

saveOutput

protected bool saveOutput

Field Value

bool

Properties

Api

public override Api Api { get; }

Property Value

Api

Options

public TOptions Options { get; protected set; }

Property Value

TOptions

SaveFolderPath

public string SaveFolderPath { get; set; }

Property Value

string

SaveGeneratedContents

public bool SaveGeneratedContents { get; set; }

Property Value

bool

Methods

Awake()

protected override void 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.

public void Generate(TInput prompt)

Parameters

prompt TInput

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.

public abstract UniTask<TOutput> GenerateAsync(TInput prompt)

Parameters

prompt TInput

Returns

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.

public void InitializeSubcomponent(TOptions options)

Parameters

options TOptions