In theory this will stop the API docs thrashing on every build. Of course, there is a drawback in that if main changes but we haven't released a new version of the docs yet the links will go out of date. So longer term we might want to investigate some kind of variable where we can continue to have up to date revs but keep the rev in a single variable somewhere: https://github.com/facebook/docusaurus/issues/395 In the meantime much smaller commits will be a relief
3.8 KiB
id, title, sidebar_label, sidebar_position, custom_edit_url
| id | title | sidebar_label | sidebar_position | custom_edit_url |
|---|---|---|---|---|
| CondenseQuestionChatEngine | Class: CondenseQuestionChatEngine | CondenseQuestionChatEngine | 0 | null |
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.
Implements
Constructors
constructor
• new CondenseQuestionChatEngine(init)
Parameters
| Name | Type |
|---|---|
init |
Object |
init.chatHistory |
ChatMessage[] |
init.condenseMessagePrompt? |
SimplePrompt |
init.queryEngine |
BaseQueryEngine |
init.serviceContext? |
ServiceContext |
Defined in
Properties
chatHistory
• chatHistory: ChatMessage[]
Defined in
condenseMessagePrompt
• condenseMessagePrompt: SimplePrompt
Defined in
queryEngine
• queryEngine: BaseQueryEngine
Defined in
serviceContext
• serviceContext: ServiceContext
Defined in
Methods
chat
▸ chat(message, chatHistory?): Promise<Response>
Send message along with the class's current chat history to the LLM.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string |
|
chatHistory? |
ChatMessage[] |
optional chat history if you want to customize the chat history |
Returns
Promise<Response>
Implementation of
Defined in
condenseQuestion
▸ Private condenseQuestion(chatHistory, question): Promise<ChatResponse>
Parameters
| Name | Type |
|---|---|
chatHistory |
ChatMessage[] |
question |
string |
Returns
Promise<ChatResponse>
Defined in
reset
▸ reset(): void
Resets the chat history so that it's empty.
Returns
void