Class LocalChatbot
A full-featured chatbot component that integrates with the AIDevKit's chat system.
This component allows you to send messages, receive responses, and manage chat sessions.
It supports both streaming and non-streaming responses, and can handle function calls.
Inheritance
object
LocalChatbot
Assembly: .dll
Syntax
public class LocalChatbot : ChatbotBase<ChatSession, ChatMessage, ChatDelta>
Fields
profile
Declaration
protected LocalChatbotProfileBase profile
Field Value
sessionId
Declaration
protected string sessionId
Field Value
Properties
AutoSave
If enabled, the chatbot will automatically save the chat session after each message is sent or received.
This is useful for preserving chat history and ensuring that conversations are not lost.
Declaration
public bool AutoSave { get; set; }
Property Value
IsInitialized
Indicates whether the assistant is initialized and ready to process requests.
This property should be overridden by derived classes to provide specific initialization logic.
Declaration
public override bool IsInitialized { get; }
Property Value
Overrides
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.
Declaration
public override List<ChatMessage> Messages { get; }
Property Value
Overrides
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.
Declaration
public override Model Model { get; set; }
Property Value
Overrides
Name
Declaration
public override string Name { get; set; }
Property Value
Overrides
Profile
Declaration
public override ChatbotProfile Profile { get; }
Property Value
Overrides
Session
The chat session associated with this chatbot.
This session contains the chat history and is used to manage the conversation state.
Declaration
public ChatSession Session { get; }
Property Value
SessionId
The unique identifier for the chat session.
This ID is used to load or create a chat session and is essential for managing the chat history.
Declaration
public string SessionId { 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.
Declaration
public override Model UtilityModel { get; set; }
Property Value
Overrides
Methods
CreateConversationAsyncINTERNAL()
Declaration
protected override UniTask<ChatSession> CreateConversationAsyncINTERNAL()
Returns
Overrides
DeleteConversationAsyncINTERNAL(string)
Declaration
protected override UniTask<bool> DeleteConversationAsyncINTERNAL(string conversationId)
Parameters
Type |
Name |
Description |
string |
conversationId |
|
Returns
Type |
Description |
UniTask<bool> |
|
Overrides
InitializeAsync()
Declaration
public override UniTask InitializeAsync()
Returns
Overrides
LoadConversationAsyncINTERNAL(string)
Declaration
protected override UniTask<ChatSession> LoadConversationAsyncINTERNAL(string conversationId)
Parameters
Type |
Name |
Description |
string |
conversationId |
|
Returns
Overrides
OnReceiveMessage(ChatMessage)
Declaration
protected override void OnReceiveMessage(ChatMessage response)
Parameters
Overrides
ProcessChatRequestAsyncINTERNAL(ChatMessage)
Declaration
protected override UniTask<ChatMessage> ProcessChatRequestAsyncINTERNAL(ChatMessage inputMessage)
Parameters
Returns
Overrides
SaveConversationAsync()
Declaration
public UniTask SaveConversationAsync()
Returns