Website: Trivial code shortening (#29231)
Just a nit --------- Co-authored-by: Eric <eashaw@sailsjs.com>
This commit is contained in:
Vendored
+1
-1
@@ -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`;
|
||||
|
||||
Vendored
+9
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user