From dd325f37241ea3f90fa21d6c183df494f519d24c Mon Sep 17 00:00:00 2001 From: dvilela Date: Fri, 14 Jun 2024 10:35:25 +0200 Subject: [PATCH] fix: wait on rate limit --- packages/dvilela/agents/tsunami/aea-config.yaml | 6 +++--- packages/dvilela/services/tsunami/service.yaml | 2 +- packages/dvilela/skills/tsunami_abci/skill.yaml | 2 +- .../dvilela/skills/tsunami_chained_abci/skill.yaml | 2 +- packages/packages.json | 10 +++++----- packages/valory/connections/twitter/connection.py | 4 ++++ packages/valory/connections/twitter/connection.yaml | 2 +- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/dvilela/agents/tsunami/aea-config.yaml b/packages/dvilela/agents/tsunami/aea-config.yaml index cafcf72..de8f5c9 100644 --- a/packages/dvilela/agents/tsunami/aea-config.yaml +++ b/packages/dvilela/agents/tsunami/aea-config.yaml @@ -15,7 +15,7 @@ connections: - valory/ledger:0.19.0:bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu - valory/p2p_libp2p_client:0.1.0:bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e - valory/farcaster:0.1.0:bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi -- valory/twitter:0.1.0:bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq +- valory/twitter:0.1.0:bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy - dvilela/kv_store:0.1.0:bafybeiekugvb2kan4342hliluxl3h5och3fjwqoafdyttpcn57evvyztq4 - dvilela/llama:0.1.0:bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq - dvilela/suno:0.1.0:bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi @@ -47,8 +47,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote - valory/registration_abci:0.1.0:bafybeieu7vq3pyns4t5ty6u3sbmpkd7yznpg3rmqifoz3jhy7pmqyg3w6q - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie -- dvilela/tsunami_abci:0.1.0:bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva -- dvilela/tsunami_chained_abci:0.1.0:bafybeiexybjocvolk3l3lfoozkonltgccn3jddo5o52cemdzadxnka66wu +- dvilela/tsunami_abci:0.1.0:bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa +- dvilela/tsunami_chained_abci:0.1.0:bafybeicipb6wwfarfjglpqbezobxpbzw64vhyuji374vc7iexiahwj36bm default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/dvilela/services/tsunami/service.yaml b/packages/dvilela/services/tsunami/service.yaml index f27dba7..aaace14 100644 --- a/packages/dvilela/services/tsunami/service.yaml +++ b/packages/dvilela/services/tsunami/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibh5bgshii5oqjfuhwmiivfvfqy7fw5pzvarxkpe4qrgivxtc3xym fingerprint_ignore_patterns: [] -agent: dvilela/tsunami:0.1.0:bafybeicncvmrk363bn3og5zkbr2qxcg6nuxk2znkj65oj2dsb5skk66cfe +agent: dvilela/tsunami:0.1.0:bafybeih67rinhrhazcovrcjyboqxhogwxzt5gjipxtjhklzf25a5atk7my number_of_agents: 1 deployment: agent: diff --git a/packages/dvilela/skills/tsunami_abci/skill.yaml b/packages/dvilela/skills/tsunami_abci/skill.yaml index 8fa99a1..9eccf72 100644 --- a/packages/dvilela/skills/tsunami_abci/skill.yaml +++ b/packages/dvilela/skills/tsunami_abci/skill.yaml @@ -23,7 +23,7 @@ connections: - dvilela/llama:0.1.0:bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq - dvilela/suno:0.1.0:bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi - valory/farcaster:0.1.0:bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi -- valory/twitter:0.1.0:bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq +- valory/twitter:0.1.0:bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy - valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m contracts: - dvilela/olas_registries:0.1.0:bafybeict2xpt56m2a5ehezd2oylrhbhahrsas3dht2fdfbnrejlr5mdqpa diff --git a/packages/dvilela/skills/tsunami_chained_abci/skill.yaml b/packages/dvilela/skills/tsunami_chained_abci/skill.yaml index 1e625b1..daccc27 100644 --- a/packages/dvilela/skills/tsunami_chained_abci/skill.yaml +++ b/packages/dvilela/skills/tsunami_chained_abci/skill.yaml @@ -23,7 +23,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq -- dvilela/tsunami_abci:0.1.0:bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva +- dvilela/tsunami_abci:0.1.0:bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa behaviours: main: args: {} diff --git a/packages/packages.json b/packages/packages.json index 481aaeb..f814bc9 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -6,12 +6,12 @@ "contract/dvilela/olas_treasury/0.1.0": "bafybeidd6yelhuztyvtbso6fkc4iiq2pmegh734exyrtcbqh62yfwgluqy", "connection/dvilela/kv_store/0.1.0": "bafybeiekugvb2kan4342hliluxl3h5och3fjwqoafdyttpcn57evvyztq4", "connection/dvilela/llama/0.1.0": "bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq", - "connection/valory/twitter/0.1.0": "bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq", + "connection/valory/twitter/0.1.0": "bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy", "connection/dvilela/suno/0.1.0": "bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi", - "skill/dvilela/tsunami_abci/0.1.0": "bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva", - "skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeiexybjocvolk3l3lfoozkonltgccn3jddo5o52cemdzadxnka66wu", - "agent/dvilela/tsunami/0.1.0": "bafybeicncvmrk363bn3og5zkbr2qxcg6nuxk2znkj65oj2dsb5skk66cfe", - "service/dvilela/tsunami/0.1.0": "bafybeicowydwnnaoot72ptatbwfym77vrgnvfnnablm7e5m4xkh5t424le" + "skill/dvilela/tsunami_abci/0.1.0": "bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa", + "skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeicipb6wwfarfjglpqbezobxpbzw64vhyuji374vc7iexiahwj36bm", + "agent/dvilela/tsunami/0.1.0": "bafybeih67rinhrhazcovrcjyboqxhogwxzt5gjipxtjhklzf25a5atk7my", + "service/dvilela/tsunami/0.1.0": "bafybeig6u22ykofx4vwrzupxefqxybzw4ie3rxohm2fofnhslrieizmsze" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/connections/twitter/connection.py b/packages/valory/connections/twitter/connection.py index 17e1a6b..a1c243b 100644 --- a/packages/valory/connections/twitter/connection.py +++ b/packages/valory/connections/twitter/connection.py @@ -239,6 +239,7 @@ def create_tweet( consumer_secret=credentials["consumer_secret"], access_token=credentials["access_token"], access_token_secret=credentials["access_secret"], + wait_on_rate_limit=True ) ) try: @@ -249,9 +250,11 @@ def create_tweet( for tweet in text: if not previous_tweet_id: response = api.create_tweet(text=tweet) + self.logger.info(f"Tweepy response: {response}") first_tweet_id = response.data["id"] else: response = api.create_tweet(text=tweet, in_reply_to_tweet_id=previous_tweet_id) + self.logger.info(f"Tweepy response: {response}") previous_tweet_id = response.data["id"] time.sleep(1) @@ -292,6 +295,7 @@ def on_connect(self) -> None: consumer_secret=self.consumer_secret, access_token=self.access_token, access_token_secret=self.access_secret, + wait_on_rate_limit=True ) def on_disconnect(self) -> None: diff --git a/packages/valory/connections/twitter/connection.yaml b/packages/valory/connections/twitter/connection.yaml index e39f0ca..b2ae5c4 100644 --- a/packages/valory/connections/twitter/connection.yaml +++ b/packages/valory/connections/twitter/connection.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibxwzkyh7odchnlkeczpguencdjiizm4nezfmi4drybn2zd25xdkq - connection.py: bafybeiac3vcgb6j4hxp662pmr5hbz3f37zen5t7ehq44efqvxowiwu43ra + connection.py: bafybeicw3s7ul4rgccc66p4s3qqieofgqwazlf7tgbbdjoe5smfoh26yy4 readme.md: bafybeihg5yfzgqvg5ngy7r2o5tfeqnelx2ffxw4po5hmheqjfhumpmxpoq fingerprint_ignore_patterns: [] connections: []