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

Chat History does not restore Assistant Messages (with custom Data Layer) #1577

Open
adrianliechti opened this issue Dec 9, 2024 · 1 comment
Labels
bug Something isn't working data layer Pertains to data layers. needs-triage

Comments

@adrianliechti
Copy link

adrianliechti commented Dec 9, 2024

Hi Chainlit Community

I started with a very simple file based data layer as PoC inspired by the E2E Test.
The idea was to store structures as they are

My problem is, that when I refresh/restart the browser, the history only shows user messages - but no assistant messages.
Interestingly, if I edit a message; the assistant message will be shown.

I'm thankful for any help! And if of interest, I would trim this PoC to something more productive ready for small installations.

Thanks a ton!

data_layer.txt

132ee4c3-bcbb-4649-8dcc-8fdbd8400fb6.json

@dosubot dosubot bot added bug Something isn't working data layer Pertains to data layers. labels Dec 9, 2024
@adrianliechti
Copy link
Author

adrianliechti commented Dec 9, 2024

If I set parentId to null on the assistant message, it appears:

def save_step(entry : StepDict):
   # ...    

    entry["parentId"] = None

    if entry.get("type", None) not in get_args(MessageStepType):
        return
    
    #...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data layer Pertains to data layers. needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant