Class Chatbot
- Namespace
- Glitch9.AIDevKit.Components
public abstract class Chatbot : AIAssistant
- Inheritance
-
objectChatbot
- Derived
- Inherited Members
Fields
contentModerator
protected ContentModerator contentModerator
Field Value
imageGenerator
protected ImageGenerator imageGenerator
Field Value
onSendMessage
Event triggered when a message is sent.
This is useful for logging or UI updates when a message is sent to the chatbot.
[FoldableFieldAttribute]
public UnityEvent_OnSendMessage onSendMessage
Field Value
speechGenerator
protected SpeechGenerator speechGenerator
Field Value
speechTranscriber
protected SpeechTranscriber speechTranscriber
Field Value
Properties
Api
The API associated with this chatbot.
This property provides access to the API used by the chatbot for processing requests and responses.
public override Api Api { get; }
Property Value
IsStreamEnabled
Indicates whether streaming mode is enabled for the chatbot.
When enabled, the chatbot will stream responses in real-time, allowing for immediate updates to the UI or other components.
This property can be set to enable or disable streaming mode.
public virtual bool IsStreamEnabled { get; set; }
Property Value
- bool
Messages
The list of messages in the chatbot's conversation history.
This property should be set to the messages that the chatbot has processed, including user messages and responses.
It is used to maintain the context of the conversation and provide a history of interactions.
public abstract List<ChatMessage> Messages { get; }
Property Value
- List<ChatMessage>
Model
The model used by the chatbot for processing requests and generating responses.
This property should be set to the model that provides the necessary capabilities for the chatbot.
public abstract Model Model { get; set; }
Property Value
Name
The name of the chatbot.
public abstract string Name { get; set; }
Property Value
- string
Profile
public abstract ChatbotProfile Profile { get; }
Property Value
UtilityModel
The utility model used for resolving intents and processing requests.
This property should be set to the model that provides the necessary capabilities for the chatbot.
public abstract Model UtilityModel { get; set; }
Property Value
Methods
AttachFile(IFile)
public void AttachFile(IFile attachedFile)
Parameters
attachedFileIFile
AttachFiles(IList<IFile>)
public void AttachFiles(IList<IFile> attachedFiles)
Parameters
attachedFilesIList<IFile>
EnterChatMessage(ChatMessage)
public void EnterChatMessage(ChatMessage inputMessage)
Parameters
inputMessageChatMessage
EnterChatText(string)
public void EnterChatText(string inputText)
Parameters
inputTextstring
InitializeAsync()
public override UniTask InitializeAsync()
Returns
- UniTask
IsInvalidResponse(ChatMessage)
protected bool IsInvalidResponse(ChatMessage response)
Parameters
responseChatMessage
Returns
- bool
IsNotInitialized()
protected bool IsNotInitialized()
Returns
- bool
OnReceiveMessage(ChatMessage)
protected virtual void OnReceiveMessage(ChatMessage response)
Parameters
responseChatMessage
ProcessChatRequestAsyncINTERNAL(ChatMessage)
protected abstract UniTask<ChatMessage> ProcessChatRequestAsyncINTERNAL(ChatMessage inputMessage)
Parameters
inputMessageChatMessage
Returns
- UniTask<ChatMessage>
ProcessPendingMessageAsyncINTERNAL()
protected UniTask<ChatMessage> ProcessPendingMessageAsyncINTERNAL()
Returns
- UniTask<ChatMessage>
StartRecording()
public void StartRecording()
StopRecording()
public void StopRecording()