Skip to content

Commit

Permalink
fix: improve personality selection randomness
Browse files Browse the repository at this point in the history
  • Loading branch information
dvilelaf committed Apr 1, 2024
1 parent 391c680 commit ababfac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/dvilela/skills/tsunami_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import json
import random
import secrets
from abc import ABC
from collections import Counter
from datetime import datetime, timedelta
Expand Down Expand Up @@ -437,7 +438,7 @@ def build_thread(

# Randomly select a personality
# TODO: this only works for a single agent
system_prompt_base = random.choice(SYSTEM_PROMPTS) # nosec
system_prompt_base = secrets.choice(SYSTEM_PROMPTS) # nosec
self.context.logger.info("Llama is building a tweet...")

attempts = 0
Expand Down Expand Up @@ -827,6 +828,8 @@ def get_repo_tweets(self) -> Generator[None, None, List]:
)
continue

self.context.logger.info(f"A new version of {repo} has been released: {version}")

user_prompt = REPO_USER_PROMPT_RELEASE.format(version=version, repo=repo)
thread = yield from self.build_thread(user_prompt)

Expand Down

0 comments on commit ababfac

Please sign in to comment.