Method ClearHistory
ClearHistory()
Clears the conversation history while keeping loaded documents.
public void ClearHistory()
Examples
using var chat = new PdfChat(chatModel, embeddingModel);
await chat.LoadDocumentAsync("report.pdf");
await chat.SubmitAsync("What is this about?");
// Start a new conversation about the same documents
chat.ClearHistory();
await chat.SubmitAsync("List the main topics covered.");
Remarks
Call this method to start a new conversation about the same documents without reloading them.
Exceptions
- ObjectDisposedException
Thrown if this instance has been disposed.