Skip to content

Commit

Permalink
Modfified the way post and interactions build the response, changed g…
Browse files Browse the repository at this point in the history
…eneration to gemini 2.0
  • Loading branch information
nusk0 committed Jan 21, 2025
1 parent 61a2563 commit 6faa050
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/client-twitter/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { buildConversationThread, sendTweet, wait } from "./utils.ts";
export const twitterMessageHandlerTemplate =
`
# Areas of Expertise
{{interact}}
{{knowledge}}
# About {{agentName}} (@{{twitterUserName}}):
{{bio}}
Expand All @@ -53,7 +53,7 @@ Thread of Tweets You Are Replying To:
{{formattedConversation}}
{{actions}}
# Task: Generate a post in the voice, style and perspective of {{agentName}} (@{{twitterUserName}}). You MUST include an action if the current post text includes a prompt that is similar to one of the available actions mentioned here:
# Task: Generate a post in the voice, style and perspective of {{agentName}} (@{{twitterUserName}}), check'Thread of Tweets You Are Replying To' to avoid repeating yourself. You MUST include an action if the current post text includes a prompt that is similar to one of the available actions mentioned here:
{{actionNames}}
Here is the current post text again. Remember to include an action if the current post text includes a prompt that asks for one of the available actions mentioned above (does not need to be exact)
{{currentPost}}
Expand Down
11 changes: 5 additions & 6 deletions packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { DEFAULT_MAX_TWEET_LENGTH } from "./environment.ts";
// {{bio}}
// {{lore}}
// {{topics}}
/*

const twitterPostTemplate = `
# Areas of Expertise
{{interact}}
Expand All @@ -40,10 +40,9 @@ const twitterPostTemplate = `
Write a post that is {{adjective}} about {{topic}} (without mentioning {{topic}} directly), from the perspective of {{agentName}}. Do not add commentary or acknowledge this request, just write the post.
Your response should be 1, 2, or 3 sentences (choose the length at random).
Your response should not contain any questions. Brief, concise statements only. The total character count MUST be less than {{maxTweetLength}}. No emojis. Use \\n\\n (double spaces) between statements if there are multiple statements in your response.`;
*/
const twitterPostTemplate = `

/*
const twitterPostTemplate = `
# About {{agentName}} (@{{twitterUserName}}):
{{bio}}
{{lore}}
Expand All @@ -64,7 +63,7 @@ Recent interactions and thoughts:
3. Makes a chaotic observation about Zaun/Piltover/recent events
Your response should maintain {{agentName}}'s personality and authenticity. Make the post engaging and interesting or funny so people react to it. Do not add commentary or acknowledge this request, just write the post.
The total character count MUST be less than {{maxTweetLength}}.`;
The total character count MUST be less than {{maxTweetLength}}.`;*/
export const twitterActionTemplate =
//{{postDirections}}
`
Expand Down Expand Up @@ -523,7 +522,7 @@ export class TwitterPostClient {
this.runtime.character.name,
"twitter"
);
// this is testing code ####################################

let tweets = [];
// Check if we're in test mode with a specific tweet
const testTweetId = this.runtime.getSetting("TEST_TWEET_ID");
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ export async function generateTweetActions({
context,
modelClass,
});

console.log("NEW TWEET YO:\n" + response);

const { actions } = parseActionResponseFromText(response.trim());
if (actions) {
Expand Down

0 comments on commit 6faa050

Please sign in to comment.