Skip to content

Commit 5fb4eaa

Browse files
committed
Fix twitter actions account issues
1 parent 25e2672 commit 5fb4eaa

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

‎btree_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@
103103
for i in range(1000):
104104
print(f"Tick {i + 1}")
105105
tree.tick()
106-
time.sleep(10) # Simulate time between ticks
106+
time.sleep(300) # Simulate time between ticks

‎playground/assistant_actions/twitter_actions.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
from playground.actions_manager import agent_action
55

66

7-
@agent_action
8-
def post_to_twitter(content):
9-
"""Post a tweet to Twitter."""
7+
def create_twitter_account():
8+
"""Create a Twitter account."""
109
email = os.getenv("X_EMAIL")
1110
username = os.getenv("X_USERNAME")
1211
password = os.getenv("X_PASSWORD")
1312
account = Account(email, username, password)
13+
return account
14+
15+
16+
account = create_twitter_account()
1417

18+
19+
@agent_action
20+
def post_to_twitter(content):
21+
"""Post a tweet to Twitter."""
1522
account.tweet(content)

0 commit comments

Comments
 (0)