mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-18 16:44:33 -04:00
7699f5432d
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
2.5 KiB
2.5 KiB
id, title, sidebar_label, sidebar_position, custom_edit_url
| id | title | sidebar_label | sidebar_position | custom_edit_url |
|---|---|---|---|---|
| ContextChatEngine | Class: ContextChatEngine | ContextChatEngine | 0 | null |
ContextChatEngine uses the Index to get the appropriate context for each query. The context is stored in the system prompt, and the chat history is preserved, ideally allowing the appropriate context to be surfaced for each query.
Implements
Constructors
constructor
• new ContextChatEngine(init)
Parameters
| Name | Type |
|---|---|
init |
Object |
init.chatHistory? |
ChatMessage[] |
init.chatModel? |
OpenAI |
init.retriever |
BaseRetriever |
Defined in
Properties
chatHistory
• chatHistory: ChatMessage[]
Defined in
chatModel
• chatModel: OpenAI
Defined in
retriever
• retriever: BaseRetriever
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
reset
▸ reset(): void
Resets the chat history so that it's empty.
Returns
void