Website: Trivial code shortening (#29231)

Just a nit

---------

Co-authored-by: Eric <eashaw@sailsjs.com>
This commit is contained in:
Mike McNeil
2025-05-16 18:25:06 -05:00
committed by GitHub
co-authored by Eric
parent 2ced8a4d0b
commit ee880d953b
2 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ module.exports = {
// TODO: Limit (round) the precision of decimal places for better userland experience.
let prompt = 'Given some data and a set of dimensions, score the data on a scale from 0 to 1 along each dimension, using a decimal precision of no more than one decimal place.';
let prompt = 'Given some data and a set of dimensions, score the data on a scale from 0 to 1 along each dimension, using a decimal precision of no more than one decimal place. Make sure to use the same variable names as the provided dimensions.';
prompt += 'Data: ```\n';
prompt += `${JSON.stringify(data)}\n`;
+9 -10
View File
@@ -34,16 +34,15 @@ module.exports = {
},
];
let weighedPosts = [];
await ƒ.simultaneouslyForEach(posts, async (post)=>{
let postWeights = await ƒ.weigh(post, [
'related to cats',
'related to javascript',
'A social media post that is both (a) VERY interesting and (b) in reasonably good taste'
]);
weighedPosts.push(Object.assign({
scoresByTopic: postWeights
}, post));
let weighedPosts = await ƒ.simultaneouslyForEach(posts, async (post)=>{
return {
...post,
scoresByTopic: await ƒ.weigh(post, [
'related to cats',
'related to javascript',
'A social media post that is both (a) VERY interesting and (b) in reasonably good taste'
])
};
});//∞
return weighedPosts;