Class AIGenerative<TOptions, TProfile, TInput, TOutput>
Inheritance
object
AIGenerative<TOptions, TProfile, TInput, TOutput>
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
saveOutput
Declaration
protected bool saveOutput
Field Value
Properties
Api
Declaration
public override Api Api { get; }
Property Value
Overrides
Options
Declaration
public TOptions Options { get; protected set; }
Property Value
Type |
Description |
TOptions |
|
SaveFolderPath
Declaration
public string SaveFolderPath { get; set; }
Property Value
SaveGeneratedContents
Declaration
public bool SaveGeneratedContents { get; set; }
Property Value
Methods
Awake()
Declaration
protected override void Awake()
Overrides
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 |
|