josephrocca / OpenCharacters

Simple little web interface for creating characters and chatting with them. It's basically a single HTML file - no server. Share characters using a link (character data is stored within the URL itself). All chat data is stored in your browser using IndexedDB. Currently supports OpenAI APIs and ~any Hugging Face model.
https://josephrocca.github.io/OpenCharacters
MIT License
364 stars 60 forks source link

[Feature Request] Add a marker that shows the part of the conversation that is being summarized #51

Open kickahaota opened 1 year ago

kickahaota commented 1 year ago

Once the conversation gets long enough to require summarization, it would be nice if there were a way to quickly tell what part of the start of the conversation is being summarized. For regular users, this could be a cue to mention important story elements every so often; for more sophisticated users, it could be a reminder to check the summary/memories/lore. A user can currently see this information by clicking the brain icon for the most recent AI response; but it could definitely be more elegant. A possibility: A "Summarization ends here" message displayed between the last summarized message and the first non-summarized one, displayed in the same way that the reminder message is displayed before the most recent the AI response.

kickahaota commented 1 year ago

I've been looking at the code, and I see a clean way to implement the UI aspect of this. But the whole summary/lore/memory mechanism is still pretty much a black box to me.

If you're interested in implementing this feature, then perhaps you could add a placeholder function like this:

async function placeSummaryEndMarker(threadId, idxLastSummarizedMessage) {
    // todo
}

and call it when the summary is regenerated. Then I could give you some proposed code to place and move the marker in the UX.

If you're not interested, that's obviously more than fine too. 😀