fix: Improve Chart Generation Experience in Chat #151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to display charts by default in the chat application. The changes span across backend and frontend files to support this feature. The most important changes include adding a new environment variable, creating an API endpoint, updating the frontend to fetch the new configuration, and modifying the chat component to handle chart display logic.
Backend changes:
App/.env.sample
: Added a new environment variableDISPLAY_CHART_DEFAULT
to enable or disable the default chart display.App/app.py
: Introduced a new API endpoint/api/display-chart-default
to fetch theDISPLAY_CHART_DEFAULT
configuration.Frontend changes:
App/frontend/src/api/api.ts
: Added a new functiongetIsChartDisplayDefault
to call the new API endpoint and fetch the chart display configuration.App/frontend/src/components/Chat/Chat.tsx
: Updated the chat component to include logic for fetching the chart display configuration, and modified the chat message handling to display charts by default if the configuration is enabled. [1] [2] [3] [4] [5] [6] [7] [8] [9]User Story : https://dev.azure.com/CSACTOSOL/KnowledgeMining/_workitems/edit/12962
The chart will be displayed immediately once the response is rendered, without requiring a second API call.