Skip to content
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

Merged
merged 5 commits into from
May 3, 2024

Conversation

buddy-web3
Copy link
Member

No description provided.

@buddy-web3 buddy-web3 requested a review from mruwnik May 2, 2024 17:23
const poolQuestions = [
{
title: 'What is AI Safety? - from pool',
pageid: '1b',
Copy link
Collaborator

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?

// check proper insertion of pool questions
// question.relatedQuestions - question.relatedQuestions.slice(0,2);
if (question.relatedQuestions.length <= 2) {
question.relatedQuestions.push(...poolQuestions)
Copy link
Collaborator

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}))
)

Copy link
Member Author

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

Copy link
Collaborator

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

// check proper insertion of pool questions
// question.relatedQuestions - question.relatedQuestions.slice(0,2);
if (question.relatedQuestions.length <= 2) {
question.relatedQuestions.push(...poolQuestions)
Copy link
Collaborator

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

},
{
title: 'Do people seriously worry about existential risk from AI? --- from pool',
pageid: '3b',
pageid: '7639',
Copy link
Collaborator

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?

@buddy-web3 buddy-web3 requested a review from mruwnik May 3, 2024 10:01
@buddy-web3 buddy-web3 merged commit b297fc8 into stampy-redesign May 3, 2024
1 check failed
@buddy-web3 buddy-web3 deleted the stampy-redesign-594 branch May 3, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants