Table of Contents

Class AIBehaviour

Namespace
Glitch9.AIDevKit
public abstract class AIBehaviour : MonoBehaviour, IErrorHandler, IUsageHandler, IUniTaskQueueEventListener
Inheritance
object
AIBehaviour
Implements
IUniTaskQueueEventListener
Derived

Fields

m_IsInitialized

protected bool m_IsInitialized

Field Value

bool

m_IsTerminating

protected bool m_IsTerminating

Field Value

bool

onError

public UnityEvent<Exception> onError

Field Value

UnityEvent<Exception>

onUsageReceived

public UnityEvent<UsageMetadata> onUsageReceived

Field Value

UnityEvent<UsageMetadata>

Properties

Api

Selected AI model's provider API.

public abstract Api Api { get; }

Property Value

Api

AutoStart

public bool AutoStart { get; }

Property Value

bool

IsProcessing

public bool IsProcessing { get; }

Property Value

bool

LogLevel

public TraceLevel LogLevel { get; }

Property Value

TraceLevel

MaxQueueSize

public int MaxQueueSize { get; }

Property Value

int

RequestConflictResolution

public UniTaskConflictResolution RequestConflictResolution { get; }

Property Value

UniTaskConflictResolution

Tag

protected string Tag { get; }

Property Value

string

Methods

Awake()

protected virtual void Awake()

CancelAllRequests()

public void CancelAllRequests()

CancelLastRequest()

public void CancelLastRequest()

CheckInitialized()

protected bool CheckInitialized()

Returns

bool

Enqueue(Func<UniTask>)

protected void Enqueue(Func<UniTask> taskFactory)

Parameters

taskFactory Func<UniTask>

EnsureSubcomponent<T>(ref T)

protected void EnsureSubcomponent<T>(ref T target) where T : MonoBehaviour

Parameters

target T

Type Parameters

T

HandleError(Exception)

public virtual void HandleError(Exception e)

Parameters

e Exception

HandleUsage(UsageMetadata)

public void HandleUsage(UsageMetadata usage)

Parameters

usage UsageMetadata

InitializeAsync()

Initialize the component asynchronously. This method must be called before using the component.

public abstract UniTask InitializeAsync()

Returns

UniTask

IsInvalidPrompt(string)

protected bool IsInvalidPrompt(string promptText)

Parameters

promptText string

Returns

bool

LogError(string)

protected void LogError(string message)

Parameters

message string

LogInfo(string)

protected void LogInfo(string message)

Parameters

message string

LogVerbose(string)

protected void LogVerbose(string message)

Parameters

message string

LogWarning(string)

protected void LogWarning(string message)

Parameters

message string

NoRequiredComponent(object)

protected bool NoRequiredComponent(object component)

Parameters

component object

Returns

bool

OnDestroy()

protected virtual void OnDestroy()

OnQueueCanceled()

public virtual void OnQueueCanceled()

OnQueueCompleted()

public virtual void OnQueueCompleted()

OnQueueError(Exception)

public void OnQueueError(Exception e)

Parameters

e Exception

OnQueueStarted()

public virtual void OnQueueStarted()

Start()

protected virtual void Start()