Open cebtenzzre opened 3 weeks ago
One thing I want to do in the future is split up chatviewtextprocessor so that we no longer use QTextDocument for all the rendering of ChatItem regardless of the content type. What I'd like to do instead is detect the content type in C++ as the llm generates it. So if we see a code block begins ```cpp then we know it is a code block.
Essentially, I envision the chat item containing the raw model response. But also exposing a qabstractlistmodel that splits that raw response into content types. The qml can then display using qml items appropriate for it rather than all the rendering happening in a custom QTextDocument
I started working on a polymorphic replacement for ChatItem, which differentiates between prompts and responses structurally. The name MessageContent isn't really relevant, that was chosen before it became a full replacement.
Fields that only belong to prompts or responses would no longer have their own roles (columns) in the ChatModel; instead there would be direct access to the ChatItem instance in order to interact with its properties.
I envision this to be less of a struct and more of a self-contained class; everything a ChatItem needs to do (such as being serialized as Datalake JSON) should happen in this cpp file.