Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: polymorphic ChatItem replacement #3152

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

cebtenzzre
Copy link
Member

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.

@manyoso
Copy link
Collaborator

manyoso commented Oct 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants