this repo has no description
0
fork

Configure Feed

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

CLI HPify

alice d62e3eb0 bec687c0

+23 -6
+23 -6
cli-test.ts
··· 21 21 appLabelers: [did], 22 22 }); 23 23 24 - const userDid = process.argv[2]; 24 + let userDid = process.argv[2]; 25 25 26 26 if (!userDid) { 27 27 console.error('Please provide a DID as an argument.'); 28 28 process.exit(1); 29 + } 30 + 31 + if (!userDid.startsWith('did:')) { 32 + try { 33 + const resolution = await agent.resolveHandle({ handle: userDid }); 34 + userDid = resolution.data.did; 35 + } catch (error) { 36 + console.error('Error resolving handle:', error); 37 + process.exit(1); 38 + } 29 39 } 30 40 31 41 const avatar = `avatars/${userDid}.png`; ··· 47 57 await fs.writeFile(avatar, canvas.toBuffer()); 48 58 49 59 const prompt = ` 50 - Is ${subject.displayName || subject.handle} (@${subject.handle}) kiki or bouba? 51 - Bouba = round, soft, and curvy. Kiki = sharp, jagged, and angular. 52 - Their bio is: ${subject.description || 'No bio provided'}. 53 - If they have no bio, focus on their avatar and display name. 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? 61 + 62 + Name and handle: ${subject.displayName || subject.handle} (@${subject.handle}) 63 + Bio: ${subject.description || 'User has no bio.'} 64 + 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. 54 69 `; 70 + 71 + console.log(prompt); 55 72 56 73 generateText({ 57 74 model: openai('gpt-4o'), ··· 74 91 tools: { 75 92 decide: tool({ 76 93 parameters: z.object({ 77 - answer: z.union([z.literal('kiki'), z.literal('bouba')]), 94 + answer: z.union([z.literal('gryffindor'), z.literal('hufflepuff'), z.literal('ravenclaw'), z.literal('slytherin')]), 78 95 }), 79 96 execute: async ({ answer }) => { 80 97 console.log(`@${subject.handle} is ${answer}`);