lmstudio-js supports in-place Chat history editing via:
- offering both mutable and immutable chat history and chat message instances via an internal mutability flag (using the
MaybeMutable base class)
- the
.replaceText() method on saved messages (there are also .appendFile() and appendText() methods on messages)
- the
.replaceSystemPrompt() method to remove all previously added system prompt messages and insert the given prompt at the start of the chat history
- the
.filterInPlace() method to process all currently saved messages with the given filtering callback
- the
.pop() method
- supporting direct iteration over and indexed access to the messages saved in the chat history
The Python SDK should offer similar capabilities (although the exact spelling may differ).
lmstudio-jssupports in-place Chat history editing via:MaybeMutablebase class).replaceText()method on saved messages (there are also.appendFile()andappendText()methods on messages).replaceSystemPrompt()method to remove all previously added system prompt messages and insert the given prompt at the start of the chat history.filterInPlace()method to process all currently saved messages with the given filtering callback.pop()methodThe Python SDK should offer similar capabilities (although the exact spelling may differ).