-
Notifications
You must be signed in to change notification settings - Fork 23
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
Refactor for message action bar and add metrics for alerting summary #304
Conversation
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: 000FLMS <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: 000FLMS <[email protected]>
Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Sihan He <[email protected]>
…ithRAG # Conflicts: # CHANGELOG.md
Signed-off-by: 000FLMS <[email protected]>
Signed-off-by: 000FLMS <[email protected]>
…ithRAG # Conflicts: # CHANGELOG.md # common/constants/llm.ts # server/plugin.ts
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: 000FLMS <[email protected]>
can you put a screenshot of this change? That would be much helpful to understand the change. |
Signed-off-by: 000FLMS <[email protected]>
Sure, I've added some screenshots, feel free to check them |
public/components/incontext_insight/generate_popover_body.test.tsx
Outdated
Show resolved
Hide resolved
); | ||
|
||
const feedbackTip = | ||
'Thank you for the feedback. Try again by adjusting your prompt so that I have the opportunity to better assist you.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tips may confuse user as they can't specify prompt. Also please add i18n support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that tip is probably for text2viz summary, which is not delivered by decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@000FLMS there has a updated one, please update here accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have changed the tip
@@ -98,6 +114,7 @@ export const GeneratePopoverBody: React.FC<{ | |||
`Please provide your insight on this ${summaryType}.` | |||
); | |||
} | |||
reportGeneratedMetric('generated'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we have seprate metric for alert summary and insight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we report this metric if error happened? And what if summary succeed while insight fails?
If we need to report metrics no matter it succeed or not, we should move this logic to finally
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only report when the summary is generated successfully.
Signed-off-by: Sihan He <[email protected]>
…ds-assistant into alertingInsight
Signed-off-by: Sihan He <[email protected]>
…ds-assistant into alertingInsight
|
||
type ButtonKey = 'copy' | 'regenerate' | 'thumbUp' | 'thumbDown' | 'trace'; | ||
|
||
export const MessageActions: React.FC<MessageActionsProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component seems very general. Not only for chat but also insight, or maybe other cases. So I think it should be moved out of chat to a more proper directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about put it into a new "action_button" under the "component" directory? Any suggestion?
<MessageActions | ||
contentToCopy={summary} | ||
showFeedback | ||
showTraceIcon={insightAvailable} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems weird to pass insight related status to Trace Icon and its related action function.
How about add a new parameter for the purpose of extending the MessageActions with customize buttons configuration? For this case, insight button should be passed in as a extending actions. You can think about which actions should be internal ones, and which should be extending ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like that the only difference between insight and trace is just the click function, so I think adding a new button is a little redundent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly. insight button needs to show info "Insight With RAG" when moving your cursor over it. And what if you wants to have both trace button and insight button, or need other customized buttons like insight? Overall, they should be 2 different buttons.
It could be an enhancement since this PR has been merged.
const [summary, setSummary] = useState(''); | ||
const [insight, setInsight] = useState(''); | ||
const [insightAvailable, setInsightAvailable] = useState(false); | ||
const [showInsight, setShowInsight] = useState(false); | ||
const metricAppName = 'alertSumm'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does metric name have length restriction? If this is the case, you might need to add some protection check in util function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I do not really know any specific restriction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use full name alertSummary
?
Signed-off-by: Sihan He <[email protected]>
@@ -98,6 +103,7 @@ export const GeneratePopoverBody: React.FC<{ | |||
`Please provide your insight on this ${summaryType}.` | |||
); | |||
} | |||
reportMetric(usageCollection, metricAppName, 'generated'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we record generated
metric, i think the metric type could be METRIC_TYPE.COUNT.
if we want to record click
metric, it should not care the result of agent execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll change it to METRIC_TYPE.COUNT.
public/plugin.tsx
Outdated
const usageCollection = setupDeps.usageCollection || null; | ||
return ( | ||
<IncontextInsightComponent | ||
{...props} | ||
httpSetup={httpSetup} | ||
usageCollection={usageCollection} | ||
/> | ||
); | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const usageCollection = setupDeps.usageCollection || null; | |
return ( | |
<IncontextInsightComponent | |
{...props} | |
httpSetup={httpSetup} | |
usageCollection={usageCollection} | |
/> | |
); | |
}, | |
}; | |
return ( | |
<IncontextInsightComponent | |
{...props} | |
httpSetup={httpSetup} | |
usageCollection={setupDeps.usageCollection} | |
/> | |
); | |
}, | |
}; |
Signed-off-by: Sihan He <[email protected]>
…ds-assistant into alertingInsight
…304) * Add message action module Signed-off-by: Sihan He <[email protected]> * Finish basic function of feedback buttons Signed-off-by: Sihan He <[email protected]> * Add test cases and fix bugs Signed-off-by: Sihan He <[email protected]> * Refactor the code to deal with core loss and fix the regenerate bug Signed-off-by: Sihan He <[email protected]> * Update CHANGELOG.md Signed-off-by: Sihan He <[email protected]> * Update for smaller buttons Signed-off-by: Sihan He <[email protected]> * Update for ui-metric Signed-off-by: Sihan He <[email protected]> * Support insight with RAG Signed-off-by: Heng Qian <[email protected]> * Add change in CHANGELOG.md Signed-off-by: Heng Qian <[email protected]> * Put footer in the same panel with content to match UX design Signed-off-by: Heng Qian <[email protected]> * Refine alert prompt Signed-off-by: Heng Qian <[email protected]> * set CSS scrollbar-width to thin Signed-off-by: Heng Qian <[email protected]> * Hide insight agent id from front-end Signed-off-by: Heng Qian <[email protected]> * Change summary agent config id Signed-off-by: Heng Qian <[email protected]> * Address comments Signed-off-by: Heng Qian <[email protected]> * Incorporate message action buttons into alerting summary Signed-off-by: Sihan He <[email protected]> * Add hover tips and rearrange buttons Signed-off-by: Sihan He <[email protected]> * Fix UT Signed-off-by: Heng Qian <[email protected]> * Add ui-metric for alerting summary Signed-off-by: Sihan He <[email protected]> * fix testing bugs Signed-off-by: Sihan He <[email protected]> * Change agent execute API Signed-off-by: Heng Qian <[email protected]> * Remove prompt from node JS server Signed-off-by: Heng Qian <[email protected]> * Replace CSS with component property Signed-off-by: Heng Qian <[email protected]> * Save the status when switch between summary and insight Signed-off-by: Sihan He <[email protected]> * Add tests for metrics Signed-off-by: Sihan He <[email protected]> * Use usageCollectionPluginMock in tests Signed-off-by: Sihan He <[email protected]> * Refactor reportMetric as util funciton Signed-off-by: Sihan He <[email protected]> * Remove telementry plugin Signed-off-by: Sihan He <[email protected]> * Fix metric type Signed-off-by: Sihan He <[email protected]> --------- Signed-off-by: Sihan He <[email protected]> Signed-off-by: 000FLMS <[email protected]> Signed-off-by: Heng Qian <[email protected]> Co-authored-by: Heng Qian <[email protected]> (cherry picked from commit db5155b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…304) (#320) * Add message action module Signed-off-by: Sihan He <[email protected]> * Finish basic function of feedback buttons Signed-off-by: Sihan He <[email protected]> * Add test cases and fix bugs Signed-off-by: Sihan He <[email protected]> * Refactor the code to deal with core loss and fix the regenerate bug Signed-off-by: Sihan He <[email protected]> * Update CHANGELOG.md Signed-off-by: Sihan He <[email protected]> * Update for smaller buttons Signed-off-by: Sihan He <[email protected]> * Update for ui-metric Signed-off-by: Sihan He <[email protected]> * Support insight with RAG Signed-off-by: Heng Qian <[email protected]> * Add change in CHANGELOG.md Signed-off-by: Heng Qian <[email protected]> * Put footer in the same panel with content to match UX design Signed-off-by: Heng Qian <[email protected]> * Refine alert prompt Signed-off-by: Heng Qian <[email protected]> * set CSS scrollbar-width to thin Signed-off-by: Heng Qian <[email protected]> * Hide insight agent id from front-end Signed-off-by: Heng Qian <[email protected]> * Change summary agent config id Signed-off-by: Heng Qian <[email protected]> * Address comments Signed-off-by: Heng Qian <[email protected]> * Incorporate message action buttons into alerting summary Signed-off-by: Sihan He <[email protected]> * Add hover tips and rearrange buttons Signed-off-by: Sihan He <[email protected]> * Fix UT Signed-off-by: Heng Qian <[email protected]> * Add ui-metric for alerting summary Signed-off-by: Sihan He <[email protected]> * fix testing bugs Signed-off-by: Sihan He <[email protected]> * Change agent execute API Signed-off-by: Heng Qian <[email protected]> * Remove prompt from node JS server Signed-off-by: Heng Qian <[email protected]> * Replace CSS with component property Signed-off-by: Heng Qian <[email protected]> * Save the status when switch between summary and insight Signed-off-by: Sihan He <[email protected]> * Add tests for metrics Signed-off-by: Sihan He <[email protected]> * Use usageCollectionPluginMock in tests Signed-off-by: Sihan He <[email protected]> * Refactor reportMetric as util funciton Signed-off-by: Sihan He <[email protected]> * Remove telementry plugin Signed-off-by: Sihan He <[email protected]> * Fix metric type Signed-off-by: Sihan He <[email protected]> --------- Signed-off-by: Sihan He <[email protected]> Signed-off-by: 000FLMS <[email protected]> Signed-off-by: Heng Qian <[email protected]> Co-authored-by: Heng Qian <[email protected]> (cherry picked from commit db5155b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Hailong Cui <[email protected]>
Description
Refactor popover to add message action bar and add metrics to thumb-up and thumb-down
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Screenshots
Action buttons in alerting summary and insight
Same component is used in chat bubbles