Skip to content

Commit 5727caf

Browse files
LLM exception suggestion front end (#598)
<!-- Please provide brief information about the PR, what it contains & its purpose, new behaviors after the change. And let us know here if you need any help: https://github.com/microsoft/HydraLab/issues/new --> ## Description <!-- A few words to explain your changes --> ### Linked GitHub issue ID: # ## Pull Request Checklist <!-- Put an x in the boxes that apply. This is simply a reminder of what we are going to look for before merging your code. --> - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Code compiles correctly with all tests are passed. - [ ] I've read the [contributing guide](https://github.com/microsoft/HydraLab/blob/main/CONTRIBUTING.md#making-changes-to-the-code) and followed the recommended practices. - [ ] [Wikis](https://github.com/microsoft/HydraLab/wiki) or [README](https://github.com/microsoft/HydraLab/blob/main/README.md) have been reviewed and added / updated if needed (for bug fixes / features) ### Does this introduce a breaking change? *If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.* - [ ] Yes - [ ] No ## How you tested it *Please make sure the change is tested, you can test it by adding UTs, do local test and share the screenshots, etc.* Please check the type of change your PR introduces: - [ ] Bugfix - [ ] Feature - [ ] Technical design - [ ] Build related changes - [ ] Refactoring (no functional changes, no api changes) - [ ] Code style update (formatting, renaming) or Documentation content changes - [ ] Other (please describe): ### Feature UI screenshots or Technical design diagrams *If this is a relatively large or complex change, kick it off by drawing the tech design with PlantUML and explaining why you chose the solution you did and what alternatives you considered, etc...* --------- Co-authored-by: dexterdreeeam <[email protected]>
1 parent d51de5d commit 5727caf

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

react/src/component/PropertyTable.jsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class AdaptivePropertyTable extends React.Component {
7171
<StyledTableRow key={key} >
7272
<TableCell key={key} style={{ verticalAlign: 'top' }}><b>{key}</b></TableCell>
7373
<TableCell colSpan={colSpan - 1} style={{ maxWidth: "640px" }}>
74-
{showedValueElement ? showedValueElement : value.toString()}
74+
{ showedValueElement ? showedValueElement : value.toString() }
7575
</TableCell>
7676
</StyledTableRow>)
7777
} else {
@@ -105,14 +105,24 @@ export default class AdaptivePropertyTable extends React.Component {
105105
</TableHead>
106106
}
107107

108-
return <TableContainer component={Paper}>
109-
<Table aria-label="simple table" size="small">
110-
{titlePart}
111-
<TableBody>
112-
{pList}
113-
</TableBody>
114-
</Table>
115-
</TableContainer>
108+
return <center>
109+
<TableContainer component={Paper}>
110+
<Table aria-label="simple table" size="small">
111+
{titlePart}
112+
<TableBody>
113+
{pList}
114+
</TableBody>
115+
</Table>
116+
</TableContainer>
117+
<table className="table table-borderless">
118+
<tbody>
119+
<tr>
120+
<td align='center'>
121+
</td>
122+
</tr>
123+
</tbody>
124+
</table>
125+
</center>
116126
}
117127

118128
componentDidMount() {

react/src/component/SearchView.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,35 @@ export default class SearchView extends BaseView {
199199
const vList = [res.data.content.videoBlobUrl + '?' + require('local-storage').get('FileToken')]
200200
const info = res.data.content.videoTimeTagArr
201201
const properties = []
202+
const suggestions = []
202203

203204
for (var k in details) {
204205
if (k === "stream") {
205206
continue
206207
}
207-
properties.push({ k: k, v: details[k] })
208+
if (k === "suggestion") {
209+
const obj = JSON.parse(details[k]);
210+
for (const [key, value] of Object.entries(obj)) {
211+
suggestions.push({ k: key, v: value })
212+
}
213+
}
214+
else {
215+
properties.push({ k: k, v: details[k] })
216+
}
208217
}
218+
209219
this.setState({
210-
infoDisplay: <center><VideoNavView videoInfo={info} videos={vList} />
220+
infoDisplay: <center>
221+
<VideoNavView videoInfo={info} videos={vList} />
222+
{
223+
suggestions.length > 0 ?
224+
<AdaptivePropertyTable properties={suggestions}
225+
title='LLM Suggestions'
226+
lineTextCount='1'
227+
propertyValueProcessor={(key, value) => {
228+
return <div>{value}</div>
229+
}} /> : null
230+
}
211231
<AdaptivePropertyTable properties={properties}
212232
title='Test Case Details'
213233
propertyValueProcessor={(key, value) => {

0 commit comments

Comments
 (0)