Class AIBehaviour
public abstract class AIBehaviour : MonoBehaviour, IErrorHandler, IUsageHandler, IUniTaskQueueEventListener
- Inheritance
-
objectAIBehaviour
- 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
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
taskFactoryFunc<UniTask>
EnsureSubcomponent<T>(ref T)
protected void EnsureSubcomponent<T>(ref T target) where T : MonoBehaviour
Parameters
targetT
Type Parameters
T
HandleError(Exception)
public virtual void HandleError(Exception e)
Parameters
eException
HandleUsage(UsageMetadata)
public void HandleUsage(UsageMetadata usage)
Parameters
usageUsageMetadata
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
promptTextstring
Returns
- bool
LogError(string)
protected void LogError(string message)
Parameters
messagestring
LogInfo(string)
protected void LogInfo(string message)
Parameters
messagestring
LogVerbose(string)
protected void LogVerbose(string message)
Parameters
messagestring
LogWarning(string)
protected void LogWarning(string message)
Parameters
messagestring
NoRequiredComponent(object)
protected bool NoRequiredComponent(object component)
Parameters
componentobject
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
eException
OnQueueStarted()
public virtual void OnQueueStarted()
Start()
protected virtual void Start()