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

[ENH] - Automatically Handle Unprepared Chats in the UI #448

Open
arjxn-py opened this issue Jul 11, 2024 · 0 comments
Open

[ENH] - Automatically Handle Unprepared Chats in the UI #448

arjxn-py opened this issue Jul 11, 2024 · 0 comments
Labels
type: enhancement 💅 New feature or request

Comments

@arjxn-py
Copy link
Contributor

Feature description

Currently, if a chat is created via the API but not prepared, it can lead to an intermediate state where the chat appears empty and unprepared in the UI. This situation arises because creating a chat through the API is a two-step process:

  1. Creating the chat:

    chat = (
    client.post(
    "/chats",
    json={
    "name": "Test chat",
    "documents": documents[:2],
    "source_storage": "Ragna/DemoSourceStorage",
    "assistant": "Ragna/DemoAssistant",
    "params": {},
    },
    )
    .raise_for_status()
    .json()
    )

  2. Preparing the chat:

    client.post(f"/chats/{chat['id']}/prepare").raise_for_status()

In the UI, these steps are performed back-to-back, ensuring the user is not left in an intermediate state. However, if the UI is started after creating the chat via the API and the chat has not been prepared, the user will see an empty chat that is unprepared and can further cause errors while handling the chats.

Proposed Solution

Automatic preparation: Implement functionality in the UI to detect when an unprepared chat is selected and trigger the preparation process automatically.

Value and/or benefit

Automatically handling unprepared chats in the UI prevents errors and improves UX

Anything else?

Originally been discussed by @pmeier in 445#comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement 💅 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant