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

Maintain data over multiple sessions. #976

Open
mrmps opened this issue Feb 15, 2024 · 0 comments
Open

Maintain data over multiple sessions. #976

mrmps opened this issue Feb 15, 2024 · 0 comments
Labels
ai/ui enhancement New feature or request

Comments

@mrmps
Copy link

mrmps commented Feb 15, 2024

Feature Description

Currently, handling additional data for the chat is extremely difficult, especially when this data needs to be persisted over multiple sessions. Maybe I'm missing something here, but my current issue is that I need to do some gymnastics to persist the data.

Some of the main issues are:
a) Data is not accessible from the backend. There is no getData function in experimental_Streamdata, only an append function. This makes it very difficult to save data to a kv db along with the rest of our conversation.
b) There is no initial_Data prop, only initial_messages. This makes it difficult to set the initial data when recovering a chat from history.
c) Currently, I have to do some pretty shady stuff to attach data to a message, such as pass sendExtraMessageFields and then filter out the ids when making a request to OpenAI.
d) Of course, I know that there is work being done to add individual data to each message. But as a user, it's frustrating that I'll likely have to refactor my code once this is implemented. I suspect many other devs are avoiding this lib for this reason, which is a shame because otherwise, it is extremely useful.

If anyone has a better solution for persisted data/attach data to individual messages, please let me know!

for a) I propose the following as a temporary measure:

export class experimental_StreamData {
    // ... existing code ...

    // Public method to get current state of data
    public getCurrentDataState(): JSONValue[] {
        return [...this.data];
    }

    // ... existing code ...
}

Use Case

No response

Additional context

No response

@lgrammel lgrammel added enhancement New feature or request ai/ui labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/ui enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants