Skip to content

Commit

Permalink
shorten response
Browse files Browse the repository at this point in the history
  • Loading branch information
bigsky77 committed Nov 2, 2024
1 parent 09cfa0d commit 19d405e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/clients/twitter/generate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Tweet } from "agent-twitter-client";

import fs from "fs";
import { composeContext } from "../../core/context.ts";
import { log_to_file } from "../../core/logger.ts";
Expand All @@ -23,6 +24,7 @@ About {{agentName}} (@{{twitterUserName}}):
{{characterPostExamples}}
# Task: Generate a post in the voice and style of {{agentName}}, aka @{{twitterUserName}}
Aim for 1-2 short sentences maximum. Be concise and direct.
Write a single sentence post that is {{adjective}} about {{topic}} (without mentioning {{topic}} directly), from the perspective of {{agentName}}. Try to write something totally different than previous posts. Do not add commentary or ackwowledge this request, just write the post.
Your response should not contain any questions. Brief, concise statements only. No emojis. Use \\n\\n (double spaces) between statements.`;

Expand All @@ -32,7 +34,8 @@ export class TwitterGenerationClient extends ClientBase {
this.generateNewTweet();
setTimeout(
generateNewTweetLoop,
(Math.floor(Math.random() * (45 - 15 + 1)) + 15) * 60 * 1000,
//(Math.floor(Math.random() * (45 - 15 + 1)) + 15) * 60 * 1000,
(Math.floor(Math.random() * (20 - 2 + 1)) + 2) * 60 * 1000
); // Random interval between 4-8 hours
};
// setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/clients/twitter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ClientBase } from "./base.ts";
import { embeddingZeroVector } from "../../core/memory.ts";
import { stringToUuid } from "../../core/uuid.ts";

const MAX_TWEET_LENGTH = 280;
const MAX_TWEET_LENGTH = 240;

export const wait = (minTime: number = 1000, maxTime: number = 3000) => {
const waitTime =
Expand Down

0 comments on commit 19d405e

Please sign in to comment.