this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cli-test tweaks

alice 741f9e7f d62e3eb0

+72 -20
+72 -20
cli-test.ts
··· 17 17 18 18 const did = agent.session!.did; 19 19 20 - AtpAgent.configure({ 21 - appLabelers: [did], 22 - }); 23 - 24 20 let userDid = process.argv[2]; 25 21 26 22 if (!userDid) { ··· 44 40 if (!data) throw new Error('Profile not found'); 45 41 const subject = data; 46 42 47 - if (subject.labels && subject.labels.some((label) => label.src === did)) { 48 - throw new Error('Already ' + subject.labels.find((label) => label.src === did)?.val); 43 + const size = 100; 44 + const canvas = createCanvas(size, size); 45 + const ctx = canvas.getContext('2d'); 46 + 47 + if (subject.avatar) { 48 + const image = await loadImage(subject.avatar); 49 + ctx.drawImage(image, 0, 0, size, size); 50 + } else { 51 + console.log('No avatar found, using 1x1 white pixel'); 52 + ctx.fillStyle = 'white'; 53 + ctx.fillRect(0, 0, 1, 1); 49 54 } 55 + await fs.writeFile(avatar, canvas.toBuffer()); 50 56 51 - if (!subject.avatar) throw new Error('No avatar'); 57 + // const prompt = ` 58 + // You're the Sorting Hat from Harry Potter. Which house does the user with the profile data to follow belong to? 52 59 53 - const image = await loadImage(subject.avatar); 54 - const canvas = createCanvas(100, 100); 55 - const ctx = canvas.getContext('2d'); 56 - ctx.drawImage(image, 0, 0, 100, 100); 57 - await fs.writeFile(avatar, canvas.toBuffer()); 60 + // The avatar of the user may be attached to this message. 61 + // If either the avatar or the bio is missing, focus on the available information. 62 + // Always return an answer. Answer with the name of the house only, all lowercase. 63 + // The user's data may be in any language. Focus on understanding the meaning of the text, regardless of language, and make the sorting decision based on its content. 64 + // Don't overindex on the user's information being too tech-related; try to find the person behind the information. 65 + // Analyze the content for traits that could apply to any house, not just intellect. 66 + // Most importantly, you're mischevious and playfully inclined to sort people in ways that are not always necessarily based on their actual traits, but may just be a reflection of your whims. This trait of yours is very strong, and you always consider it strongly when making your decision. 67 + 68 + // The user's data is as follows: 69 + 70 + // Name: ${subject.displayName || subject.handle} (@${subject.handle}) 71 + // Bio: ${subject.description || 'User has no bio.'} 72 + // `; 73 + 58 74 59 75 const prompt = ` 60 - You're the Sorting Hat from Harry Potter, operating on the microblogging platform / social network Bluesky. Which house does the user with the following profile data belong to? 76 + You're the Sorting Hat from Harry Potter. Which house does the user with the profile data at the end of this message belong to? 61 77 62 - Name and handle: ${subject.displayName || subject.handle} (@${subject.handle}) 63 - Bio: ${subject.description || 'User has no bio.'} 78 + Focus on the available information. If the avatar is not available, a 1x1 pixel white image is provided instead as a placeholder. Disregard the placeholder and focus on the user's data. 79 + Always return an answer — house name only, all lowercase. 80 + The user's data may be in any language. Focus on the meaning, not just the surface content. 81 + Consider traits for all houses, not just intellect. 82 + You're strongly mischievous and enjoy sorting based on whims, not always strictly following the user's traits; imagine as if you're a person who likes to play tricks on people. 64 83 65 - The avatar of the user may be attached to this message. 66 - If either the avatar or the bio is missing, focus on the available information. 67 - Always return an answer. Answer with the name of the house only, all lowercase. 68 - The user's data may be in any language. Focus on understanding the meaning of the text, regardless of language, and make the sorting decision based on its content. 84 + The user's data is as follows: 85 + 86 + Name: ${subject.displayName || subject.handle} (@${subject.handle}) 87 + Bio: ${subject.description || 'User has no bio.'} 69 88 `; 70 89 90 + // const prompt = ` 91 + // You're the Sorting Hat from Harry Potter. Which house does the person with the following information belong to? 92 + 93 + // Name: ${subject.displayName || subject.handle} (@${subject.handle}) 94 + // Personal information: ${subject.description || 'None.'} 95 + 96 + // The chosen appearance of the person may be attached to this message. 97 + // If either the chosen appearance or the personal information is missing, focus on whatever is available. 98 + // Always return an answer. Answer with the name of the house only, all lowercase. 99 + // The person's information may be in any language. Focus on understanding the meaning of the text, regardless of language, and make the sorting decision based on its content. 100 + // `; 101 + 102 + // const prompt = ` 103 + // You're the Sorting Hat from Harry Potter, operating on the microblogging platform / social network Bluesky. Which house does the user with the following profile data belong to? 104 + 105 + // Name and handle: ${subject.displayName || subject.handle} (@${subject.handle}) 106 + // Bio: ${subject.description || 'User has no bio.'} 107 + 108 + // The avatar of the user may be attached to this message. 109 + // If either the avatar or the bio is missing, focus on the available information. 110 + // Always return an answer. Answer with the name of the house only, all lowercase. 111 + // The user's data may be in any language. Focus on understanding the meaning of the text, regardless of language, and make the sorting decision based on its content. 112 + // Don't overindex on the user's information being too tech-related; try to find the person behind the information. 113 + // Analyze the content for traits that could apply to any house, not just intellect. 114 + // Heavily bias towards the user's avatar, when available, as a primary source of information. 115 + // `; 116 + 117 + 71 118 console.log(prompt); 72 119 73 120 generateText({ 74 - model: openai('gpt-4o'), 121 + model: openai('gpt-4o', { 122 + 123 + }), 75 124 messages: [ 76 125 { 77 126 role: 'user', ··· 83 132 { 84 133 type: 'image', 85 134 image: canvas.toBuffer(), 135 + // experimental_providerMetadata: { 136 + // openai: { imageDetail: 'low' }, 137 + // }, 86 138 }, 87 139 ], 88 140 },