langgenius / webapp-conversation

MIT License
388 stars 710 forks source link

# Feature Request: Display Opening Questions in UI #82

Open Delgerskhn opened 1 month ago

Delgerskhn commented 1 month ago

Feature Request: Display Opening Questions in UI

Description

Currently, the front-end application using Next.js does not display the opening questions that are provided by the backend as JSON. While the opening text message is displayed correctly, the buttons for the opening questions are not present in the UI, even though they exist in the JSON data.

Expected Behavior

The UI should display the opening question buttons as provided in the JSON data from the backend. Each button should be clickable and should function according to the logic defined in the application.

Actual Behavior

The UI currently displays only the opening text message. The opening question buttons, though present in the JSON data, are not visible or interactive in the UI.

JSON Data Example

Here is an example of the JSON data received from the backend:

//Response of route http://localhost:3000/api/parameters
{...
suggested_questions: [
    "ХЗТТ-д ямар хүн үйлчлүүлэх боломжтой вэ?",
    "ХЗТТ гэж юу вэ?",
    "ХЗТТ нь ямар үйлчилгээ үзүүлдэг вэ?",
    "Холбоо барих мэдээлэл",
    "Салбаруудын жагсаалт харах"
]
...}

Steps to Reproduce

  1. Configure dify backend endpoint, secret keys
  2. Launch the front-end application.
  3. Start new conversation
  4. Observe the opening text message displayed in the UI.
  5. Check the JSON response from the backend and notice the presence of opening questions.
  6. Observe that the opening question buttons are not displayed in the UI.

    Proposed Solution

    Modify the front-end code to render the opening question buttons as specified in the JSON data. Each button should be styled consistently with the rest of the UI and should be clickable, triggering the appropriate actions.

Additional Information

Framework: Next.js Issue Found in Version: [0.1.0] Browser: [Microsoft Edge]