Skip to content

Commit

Permalink
freq now actually works
Browse files Browse the repository at this point in the history
  • Loading branch information
ImamuraDev committed Nov 7, 2023
1 parent 9abb98e commit 6ac9d18
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/imports/startup/server/FetchEmbedForUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function getRelevantContextFromDB(userEmbedding) {
filename: article.filename,
question: article.question,
article_text: article.article_text,
freq: 0,
freq: article.freq,
}));

return {
Expand Down
2 changes: 1 addition & 1 deletion app/imports/ui/components/Chatbot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ChatBox = (props) => {
const freq = item.freq + amount;
AskUs.collection.update(_id, { $set: { freq } }, (error) => (error ?
console.log('Error', error.message) :
console.log(/* 'Success', `increased ${filename} freq by ${amount}` */)));
console.log(/* 'Success', `increased ${item.filename} freq by ${amount} (from ${item.freq} to ${freq})` */)));
};

const handleSend = (e) => {
Expand Down
2 changes: 1 addition & 1 deletion app/imports/ui/components/SimilarArticles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const SimilarArticles = ({ similarArticles }) => (
{similarArticles.slice(0, 3).map((article) => {
const truncatedContent = `${article.article_text.substring(0, 500)}...`;
return (
<Col key={article.id} md={4}> {/* Ensure the key here is unique for each article */}
<Col key={article._id} md={4}> {/* Ensure the key here is unique for each article */}
<div className="card mb-3">
<div className="card-body">
<h5 className="card-title">{article.question}</h5>
Expand Down
2 changes: 1 addition & 1 deletion app/imports/ui/components/UHNavbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const UHNavbar = () => (

<Container id="dev-tools">
<Nav className="me-auto justify-content-end">
<Nav.Link id="chatbot-nav" as={NavLink} to="/" key="chatbot">Landing</Nav.Link>
<Nav.Link id="landing" as={NavLink} to="/" key="landing">Landing</Nav.Link>
<Nav.Link id="chatbot-nav" as={NavLink} to="/chatbot" key="chatbot">Chatbot</Nav.Link>
<Nav.Link id="list-stuff-admin-nav" as={NavLink} to="/admin" key="admin">Admin</Nav.Link>
</Nav>
Expand Down

0 comments on commit 6ac9d18

Please sign in to comment.