CondenseQuestionChatEngine
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:33
CondenseQuestionChatEngine is used in conjunction with a Index (for example VectorStoreIndex). It does two steps on taking a user’s chat message: first, it condenses the chat message with the previous chat history into a question with more context. Then, it queries the underlying Index using the new question with context and returns the response. CondenseQuestionChatEngine performs well when the input is primarily questions about the underlying data. It performs less well when the chat messages are not questions about the data, or are very referential to previous context.
Extends
Section titled “Extends”BaseChatEngine
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CondenseQuestionChatEngine(
init
):CondenseQuestionChatEngine
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:43
Parameters
Section titled “Parameters”queryEngine
Section titled “queryEngine”BaseQueryEngine
chatHistory
Section titled “chatHistory”ChatMessage
[]
condenseMessagePrompt?
Section titled “condenseMessagePrompt?”CondenseQuestionPrompt
Returns
Section titled “Returns”CondenseQuestionChatEngine
Overrides
Section titled “Overrides”BaseChatEngine.constructor
Properties
Section titled “Properties”queryEngine
Section titled “queryEngine”queryEngine:
BaseQueryEngine
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:34
memory
Section titled “memory”memory:
Memory
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:35
llm:
LLM
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:36
condenseMessagePrompt
Section titled “condenseMessagePrompt”condenseMessagePrompt:
CondenseQuestionPrompt
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:37
Accessors
Section titled “Accessors”chatHistory
Section titled “chatHistory”Get Signature
Section titled “Get Signature”get chatHistory():
Promise
<ChatMessage
[]>
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:39
Returns
Section titled “Returns”Promise
<ChatMessage
[]>
Overrides
Section titled “Overrides”BaseChatEngine.chatHistory
Methods
Section titled “Methods”_getPromptModules()
Section titled “_getPromptModules()”
protected
_getPromptModules():ModuleRecord
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:57
Returns
Section titled “Returns”ModuleRecord
_getPrompts()
Section titled “_getPrompts()”
protected
_getPrompts():object
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:61
Returns
Section titled “Returns”object
condenseMessagePrompt
Section titled “condenseMessagePrompt”condenseMessagePrompt:
CondenseQuestionPrompt
_updatePrompts()
Section titled “_updatePrompts()”
protected
_updatePrompts(promptsDict
):void
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:67
Parameters
Section titled “Parameters”promptsDict
Section titled “promptsDict”condenseMessagePrompt
Section titled “condenseMessagePrompt”CondenseQuestionPrompt
Returns
Section titled “Returns”void
chat()
Section titled “chat()”Call Signature
Section titled “Call Signature”chat(
params
):Promise
<EngineResponse
>
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:86
Parameters
Section titled “Parameters”params
Section titled “params”NonStreamingChatEngineParams
Returns
Section titled “Returns”Promise
<EngineResponse
>
Overrides
Section titled “Overrides”BaseChatEngine.chat
Call Signature
Section titled “Call Signature”chat(
params
):Promise
<AsyncIterable
<EngineResponse
,any
,any
>>
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:87
Parameters
Section titled “Parameters”params
Section titled “params”StreamingChatEngineParams
Returns
Section titled “Returns”Promise
<AsyncIterable
<EngineResponse
, any
, any
>>
Overrides
Section titled “Overrides”BaseChatEngine.chat
reset()
Section titled “reset()”reset():
void
Defined in: .build/typescript/packages/llamaindex/src/engines/chat/CondenseQuestionChatEngine.ts:132
Returns
Section titled “Returns”void