Class: SummaryChatHistory
A ChatHistory is used to keep the state of back and forth chat messages
Hierarchy
-
↳
SummaryChatHistory
Constructors
constructor
• new SummaryChatHistory(init?
): SummaryChatHistory
Parameters
Name | Type |
---|---|
init? | Partial <SummaryChatHistory > |
Returns
Overrides
Defined in
packages/core/src/ChatHistory.ts:78
Properties
llm
• llm: LLM
Defined in
packages/core/src/ChatHistory.ts:75
messages
• messages: ChatMessage
[]
Overrides
Defined in
packages/core/src/ChatHistory.ts:73
messagesBefore
• Private
messagesBefore: number
Defined in
packages/core/src/ChatHistory.ts:76
summaryPrompt
• summaryPrompt: (__namedParameters
: { context
: undefined
| string
= "" }) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | undefined |
› context | undefined | string | "" |
Returns
string
Defined in
packages/core/src/ChatHistory.ts:74
tokenizer
• tokenizer: (text
: string
) => Uint32Array
= globalsHelper.defaultTokenizer.encode
Tokenizer function that converts text to tokens, this is used to calculate the number of tokens in a message.
Type declaration
▸ (text
): Uint32Array
Parameters
Name | Type |
---|---|
text | string |
Returns
Uint32Array
Defined in
packages/core/src/ChatHistory.ts:70
tokensToSummarize
• tokensToSummarize: number
Defined in
packages/core/src/ChatHistory.ts:72
Accessors
nonSystemMessages
• get
nonSystemMessages(): ChatMessage
[]
Returns
Defined in
packages/core/src/ChatHistory.ts:148
systemMessages
• get
systemMessages(): ChatMessage
[]