Class: ChatHistory<AdditionalMessageOptions>
A ChatHistory is used to keep the state of back and forth chat messages
Type parameters
Name | Type |
---|---|
AdditionalMessageOptions | extends object = object |
Hierarchy
-
ChatHistory
Constructors
constructor
• new ChatHistory<AdditionalMessageOptions
>(): ChatHistory
<AdditionalMessageOptions
>
Type parameters
Name | Type |
---|---|
AdditionalMessageOptions | extends object = object |
Returns
ChatHistory
<AdditionalMessageOptions
>
Accessors
messages
• get
messages(): ChatMessage
<AdditionalMessageOptions
>[]
Returns
ChatMessage
<AdditionalMessageOptions
>[]
Defined in
packages/core/src/ChatHistory.ts:14
Methods
addMessage
▸ addMessage(message
): void
Adds a message to the chat history.
Parameters
Name | Type |
---|---|
message | ChatMessage <AdditionalMessageOptions > |