hddevteam / Azure-chatGPT-demo

A fascinating demo website built with Node.js and Azure OpenAI gpt-35-turbo/gpt4 model. This project serves as a great starting point for developers who are interested in developing chatbot applications using JavaScript and Azure OpenAI API.
MIT License
31 stars 13 forks source link

Add feature to isolate individual Q&A sessions with the same AI Actor #1

Open Osiris-tevin opened 1 year ago

Osiris-tevin commented 1 year ago

Is your feature request related to a problem? Please describe. The current AI Q&A website based on the ChatGPT API does not differentiate between different Q&A sessions when using the same AI Actor. This results in content from one session influencing another, which can lead to confusion and lack of context specificity.

Describe the solution you'd like I propose a feature that will allow the website to distinguish and manage separate Q&A sessions, even when using the same AI Actor. This will ensure that content from one session does not affect another, providing a cleaner and more individualized experience for the user.

Describe alternatives you've considered The official ChatGPT website and Poe have resolved this issue by using a history-based approach. However, given the implementation logic of this project, we should seek other solutions.

Additional context This feature will greatly enhance the user experience and the functional integrity of the Q&A system. By isolating individual sessions, we can provide users with more relevant and context-specific interactions with the AI Actor. It will require a thoughtful design approach to efficiently implement this while keeping the existing logic of the project intact.

hddevteam commented 1 year ago

Thank you for raising this issue and suggesting a feature to improve the AI Q&A website based on the ChatGPT API. I understand that the lack of differentiation between different Q&A sessions can cause confusion and a lack of context specificity.

To address this, I recommend considering the following approaches and I would appreciate your input on which solution you prefer:

  1. Session Management: Implement a session management system that assigns a unique identifier to each Q&A session. This identifier can be stored in a cookie or passed as a parameter in API requests.

  2. Isolation of Sessions: Modify the backend logic to ensure that responses from the AI Actor are associated with the correct session identifier. This can be achieved by maintaining separate conversation history and context for each session.

  3. Contextual Switching: Provide a mechanism for users to switch between different sessions or create new ones. This can be done by adding a session selection dropdown or a create new session button in the user interface.

  4. Clear Session Termination: Clearly define the end of a session and handle session termination appropriately. This could involve providing a session end button or automatically terminating sessions after a specified period of inactivity.

Considering the existing logic of the project, it will be necessary to carefully design and implement these changes to ensure functional integrity. It may also be helpful to consult the ChatGPT API documentation for any specific guidelines or best practices related to session management.

Please let me know which solution you prefer, or if you have any other ideas or questions regarding the implementation. Your input will help us provide a more tailored and effective solution for the user experience.

Osiris-tevin commented 1 year ago

Undoubtedly, session management is the key to solving this problem, but the UI part of the website that interacts with the user is equally important, which also represents the importance of context switching, and session isolation complements the aforementioned two.

But for now, I think the first thing to be solved is the problem of context switching, because this will quickly improve the user's experience. Now I will describe the potential bugs that currently exist on the site in the context of this issue and you can try to reproduce by following the steps below to have a full understanding and judgment of the problem:

  1. First, open the website AI Assistant 007 and select Use default AI Actor and we can call it PageA.

  2. Next, open a new AI Assistant 007 in a new tab, again choosing to use the default AI Actor, which we'll call PageB. At this time, PageA and PageB should have the same session interception point, that is, there is no AI dialogue behavior after PageA and PageB are opened.

  3. Then, you can ask a question in PageA and wait for its answer. At this time, there should be a question and answer in PageA's conversation.

  4. Similarly, ask another question in PageB and wait for the answer. This is the only question and answer in the conversation of PageB.

  5. At this point, refresh PageB, and you will find that the content in PageA does not appear in the record, which means that this behavior has caused some contextual content to be overwritten or lost.

  6. If you choose to refresh PageA, you will find that the content in PageA will be overwritten by the content in PageB. The results in steps 4 and 5 will cause a bad experience for the user's context use.

  7. If the session expiration time points in PageA and PageB are different, then no matter refreshing PageA and PageB, the context of later expiration will be used. That is to say, once I use the same AI Actor to conduct two dialogues at the same time in a certain process, the cut-off time points of the two dialogues are inconsistent, and I accidentally refresh one of the pages, then I will have context confusion and the possibility of failure. At this time, if you want to restore the previous context, you can only do it through tedious and lengthy deletion and confirmation of deletion.

The above-mentioned bugs will bring extremely bad user experience to users. At the same time, it almost determines the fact that users cannot view a previous complete conversation, which will not only reduce the efficiency of users in solving some repetitive problems, but also reduce the user The use of patience.

Look forward to your attention and resolution to this issue!

hddevteam commented 1 year ago

Thank you for bringing up this issue and providing detailed steps to reproduce the problem. I can understand how the context switching and session management can impact the user experience on the website.

To further investigate and address this issue, could you please provide some additional information? Specifically, I would like to know the reasons and scenarios behind performing the described actions. Understanding the intended use case will help me better analyze and suggest possible solutions.

Looking forward to your response.

Xiaoming Jia


发件人: moonlight @.> 发送时间: Tuesday, September 5, 2023 10:06:45 PM 收件人: hddevteam/Azure-chatGPT-demo @.> 抄送: ming @.>; Comment @.> 主题: Re: [hddevteam/Azure-chatGPT-demo] Add feature to isolate individual Q&A sessions with the same AI Actor (Issue #1)

Undoubtedly, session management is the key to solving this problem, but the UI part of the website that interacts with the user is equally important, which also represents the importance of context switching, and session isolation complements the aforementioned two.

But for now, I think the first thing to be solved is the problem of context switching, because this will quickly improve the user's experience. Now I will describe the potential bugs that currently exist on the site in the context of this issue and you can try to reproduce by following the steps below to have a full understanding and judgment of the problem:

  1. First, open the website AI Assistant 007 and select Use default AI Actor and we can call it PageA.

  2. Next, open a new AI Assistant 007 in a new tab, again choosing to use the default AI Actor, which we'll call PageB. At this time, PageA and PageB should have the same session interception point, that is, there is no AI dialogue behavior after PageA and PageB are opened.

  3. Then, you can ask a question in PageA and wait for its answer. At this time, there should be a question and answer in PageA's conversation.

  4. Similarly, ask another question in PageB and wait for the answer. This is the only question and answer in the conversation of PageB.

  5. At this point, refresh PageB, and you will find that the content in PageA does not appear in the record, which means that this behavior has caused some contextual content to be overwritten or lost.

  6. If you choose to refresh PageA, you will find that the content in PageA will be overwritten by the content in PageB. The results in steps 4 and 5 will cause a bad experience for the user's context use.

  7. If the session expiration time points in PageA and PageB are different, then no matter refreshing PageA and PageB, the context of later expiration will be used. That is to say, once I use the same AI Actor to conduct two dialogues at the same time in a certain process, the cut-off time points of the two dialogues are inconsistent, and I accidentally refresh one of the pages, then I will have context confusion and the possibility of failure. At this time, if you want to restore the previous context, you can only do it through tedious and lengthy deletion and confirmation of deletion.

The above-mentioned bugs will bring extremely bad user experience to users. At the same time, it almost determines the fact that users cannot view a previous complete conversation, which will not only reduce the efficiency of users in solving some repetitive problems, but also reduce the user The use of patience.

Look forward to your attention and resolution to this issue!

― Reply to this email directly, view it on GitHubhttps://github.com/hddevteam/Azure-chatGPT-demo/issues/1#issuecomment-1706694037, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADMSNV7VRPUPEJZ7AZ4XSMLXY4WXLANCNFSM6AAAAAA4KR3BLQ. You are receiving this because you commented.Message ID: @.***>