-
Notifications
You must be signed in to change notification settings - Fork 9
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
pool questions when less than 3 generated by bot #614
Conversation
app/components/Chatbot/index.tsx
Outdated
const poolQuestions = [ | ||
{ | ||
title: 'What is AI Safety? - from pool', | ||
pageid: '1b', |
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.
can you put the proper pageids here, please?
app/components/Chatbot/index.tsx
Outdated
// check proper insertion of pool questions | ||
// question.relatedQuestions - question.relatedQuestions.slice(0,2); | ||
if (question.relatedQuestions.length <= 2) { | ||
question.relatedQuestions.push(...poolQuestions) |
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.
that will overwrite the question's relatedQuestions - this should go in the setFollowups
call, e.g.
setFollowups(
[...(question.relatedQuestions || []), ...poolQuestions].slice(0, 3).map(({title, pageid}) => ({text: title, pageid}))
)
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 won't overwrite the questions, it will push at the end of the array.
you can uncomment lines 185 & 186 to test it
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.
you're correct, of course, but the problem remains in that you mutate the list of related questions. Should be fine, but I don't trust the code to return copies, so chaging it here could cause the random continuations to be displayed in other places, i.e. the main page. Or just cause the same random questions to be displayed each time this question is displayed, which I'm guessing is not the desired behaviour
app/components/Chatbot/index.tsx
Outdated
// check proper insertion of pool questions | ||
// question.relatedQuestions - question.relatedQuestions.slice(0,2); | ||
if (question.relatedQuestions.length <= 2) { | ||
question.relatedQuestions.push(...poolQuestions) |
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.
you're correct, of course, but the problem remains in that you mutate the list of related questions. Should be fine, but I don't trust the code to return copies, so chaging it here could cause the random continuations to be displayed in other places, i.e. the main page. Or just cause the same random questions to be displayed each time this question is displayed, which I'm guessing is not the desired behaviour
app/components/Chatbot/index.tsx
Outdated
}, | ||
{ | ||
title: 'Do people seriously worry about existential risk from AI? --- from pool', | ||
pageid: '3b', | ||
pageid: '7639', |
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.
sorry to be a pain - could you add like 10 extra questions here and use a random selection of them?
No description provided.