smwebsdk.conversation
Home > @soulmachines/smwebsdk > Conversation
Conversation class
Stores content cards and conversation state
Signature:
export declare class Conversation
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(logger, conversationState, contentCardFormatter) | Constructs a new instance of the Conversation class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
activeCardIds | Set<string> | ||
activeCards | readonly | ContentCardRawData[] | |
autoClearCards | boolean | Automatically clear active content cards each conversation turn | |
cardData | Map<string, ContentCardRawData> | ||
onCardChanged | readonly | SmEvent | A callback function which fires when active cards are changed |
onConversationStateUpdated | readonly | SmEvent | A callback function which fires when conversation state changes |
Methods
Method | Modifiers | Description |
---|---|---|
clearActiveCards() | Clears active card ids. Emits a card changed event | |
onConversationResult(messageBody) | Stores content card data contained in conversation result messages | |
onSpeechMarker(messageBody) | Handles speech marker messages and updates the active card state | |
processRecognizeResultsMessage(message) | ||
processStateMessage(message) | ||
reset() | Clears active card ids and data. Emits a card changed event |