Skip to content

Commit

Permalink
fixed how the chatbot presents answers, tickets #331 and #342
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Aug 29, 2023
1 parent f65805b commit ea09173
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions application/frontend/src/pages/chatbot/chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export const Chatbot = () => {
timestamp: new Date().toLocaleTimeString(),
role: 'assistant',
message: data.response,
data: data.table,
data: data.table
},
]);
})
Expand All @@ -299,25 +299,11 @@ export const Chatbot = () => {
}

function displayDocument(d: Document) {
var link = '/node/' + d.doctype.toLowerCase() + '/' + d.name;
if (d.section) {
link = link + '/section/' + d.section;
} else {
link = link + '/sectionid/' + d.sectionID;
}
return (
<p>
<p>
*Reference: The above answer was based on:
<a href={d.hyperlink} target="_blank">
{' '}
{d.name} section: {d.section ? d.section : d.sectionID};
</a>
</p>
<p>
You can find more information about {d.name} <a href={link}> on its OpenCRE page</a>
</p>
</p>
<a href={d.hyperlink} target="_blank">
*Reference: The above answer was based on the {d.name} section of{' '}
{d.section ? d.section : d.sectionID};
</a>
);
}

Expand Down Expand Up @@ -386,15 +372,6 @@ export const Chatbot = () => {
<div className="table-container mt-5 ms-5 d-none">
<div className="table-content bg-light shadow p-3" id="table-content"></div>
</div>
<div className="chatbot">
<i>
ChatCRE uses Google's PALM2 LLM, you can find the code for OpenCRE in
https://github.com/owaps/OpenCRE. Your question travels to Heroku (OpenCRE hosting provider)
and then to GCP over a protected connection. Your data is never stored in the OpenCRE
servers, you can start a new session by refreshing your page. The OpenCRE team has taken all
reasonable precautions we could think off to protect your privacy and security.
</i>
</div>
</Grid>
</Container>
</Grid.Column>
Expand Down

0 comments on commit ea09173

Please sign in to comment.