Class GENTask<TSelf, TPrompt, TOutput>
Abstract base class for all generative AI tasks (text, image, audio).
Supports text, image, and audio prompts with fluent configuration methods.
Inheritance
object
GENTask<TSelf, TPrompt, TOutput>
Assembly: .dll
Syntax
public abstract class GENTask<TSelf, TPrompt, TOutput> : IGENTask where TSelf : GENTask<TSelf, TPrompt, TOutput>
Type Parameters
Name |
Description |
TSelf |
|
TPrompt |
|
TOutput |
|
Constructors
GENTask()
Declaration
GENTask(TPrompt, Object)
Declaration
protected GENTask(TPrompt prompt, UnityEngine.Object target = null)
Parameters
Type |
Name |
Description |
TPrompt |
prompt |
|
Object |
target |
|
Properties
enableHistory
Declaration
public bool enableHistory { get; }
Property Value
isCanceled
Declaration
public bool isCanceled { get; }
Property Value
outputMimeType
Declaration
public virtual MIMEType outputMimeType { get; set; }
Property Value
Type |
Description |
MIMEType |
|
token
Declaration
public CancellationToken token { get; }
Property Value
Type |
Description |
CancellationToken |
|
Methods
Cancel()
Declaration
EnablePromptHistory(bool)
Declaration
public TSelf EnablePromptHistory(bool enableHistory = true)
Parameters
Type |
Name |
Description |
bool |
enableHistory |
|
Returns
ExecuteAsync()
Executes the task and returns the generated result.
Declaration
public abstract UniTask<TOutput> ExecuteAsync()
Returns
Type |
Description |
UniTask<TOutput> |
|
SetAudioToTarget(GeneratedAudio)
Declaration
protected void SetAudioToTarget(GeneratedAudio audio)
Parameters
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
SetIgnoreLogs(bool)
Declaration
public TSelf SetIgnoreLogs(bool ignoreLogs)
Parameters
Type |
Name |
Description |
bool |
ignoreLogs |
|
Returns
SetImageToTarget(GeneratedImage)
Declaration
protected void SetImageToTarget(GeneratedImage image)
Parameters
SetModel(Model)
Sets the AI model to be used for generation.
Declaration
public TSelf SetModel(Model model)
Parameters
Type |
Name |
Description |
Model |
model |
|
Returns
SetOption(string, object)
Declaration
public void SetOption(string key, object value)
Parameters
Type |
Name |
Description |
string |
key |
|
object |
value |
|
SetOutputPath(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 SetOutputPath(string outputPath)
Parameters
Type |
Name |
Description |
string |
outputPath |
The path where the generated content(s) will be saved.
|
Returns
SetSender(string)
Sets the sender ID for tracking or attribution purposes.
Declaration
public TSelf SetSender(string sender)
Parameters
Type |
Name |
Description |
string |
sender |
|
Returns
SetTextToTarget(GeneratedText)
Declaration
protected void SetTextToTarget(GeneratedText text)
Parameters
TryGetOption<T>(string, out T)
Declaration
public bool TryGetOption<T>(string key, out T value)
Parameters
Type |
Name |
Description |
string |
key |
|
T |
value |
|
Returns
Type Parameters
Implements
Extension Methods