diff --git a/packages/dvilela/agents/tsunami/aea-config.yaml b/packages/dvilela/agents/tsunami/aea-config.yaml index 9c07fac..368cf56 100644 --- a/packages/dvilela/agents/tsunami/aea-config.yaml +++ b/packages/dvilela/agents/tsunami/aea-config.yaml @@ -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:bafybeifn6dz7h52fftiphyz2sulhvq6qq7qzzbyynsu5h5vsj5mabsip6a -- dvilela/tsunami_chained_abci:0.1.0:bafybeie6abwbltsjhd47tw545jk3gkoig6t2cwdwtqlz3s5eposkavpssu +- dvilela/tsunami_abci:0.1.0:bafybeidfryx4juivcatexh3hvf4tnz47xkjq4zdqbr3zpfib5pyxj2nkim +- dvilela/tsunami_chained_abci:0.1.0:bafybeia3esvpbzoisefosshyarpo2fpqxjiwwjt7apoad6pdn4c6o72uoe default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/dvilela/services/tsunami/service.yaml b/packages/dvilela/services/tsunami/service.yaml index cc69700..44d5269 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:bafybeic6kbjroomqas4jlvq5m4bsvcbvew3mczcdts576acj63pytprdhy +agent: dvilela/tsunami:0.1.0:bafybeiavcu5fy3g75gpgvweu5nw2x3eyrvwq3z6alsvsrl7tkaykviepaa number_of_agents: 1 deployment: agent: diff --git a/packages/dvilela/skills/tsunami_abci/behaviours.py b/packages/dvilela/skills/tsunami_abci/behaviours.py index 0f943a0..695beef 100644 --- a/packages/dvilela/skills/tsunami_abci/behaviours.py +++ b/packages/dvilela/skills/tsunami_abci/behaviours.py @@ -21,6 +21,7 @@ import json import random +import re import secrets from abc import ABC from collections import Counter @@ -115,6 +116,7 @@ OMEN_RUN_HOUR = 15 SUNO_RUN_HOUR = 10 SUNO_RUN_DAY = 4 +TWITTER_PIC_URL = r"pic\.twitter\.com\S+" TRACKED_REPOS = [ "dvilelaf/tsunami", @@ -564,6 +566,12 @@ def build_thread( if footer: tweet_attempt = tweet_attempt + footer + # Remove hallucinated pic.twitter.com urls + tweet_attempt = re.sub(TWITTER_PIC_URL, "", tweet_attempt) + tweet_attempt = re.sub( + r"\s\s", " ", tweet_attempt + ) # replace double spaces with single space + # Create a single-tweet thread if tweet_len(tweet_attempt) < MAX_TWEET_CHARS: self.context.logger.info("Tweet is OK!") @@ -1672,13 +1680,13 @@ def async_act(self) -> Generator: response = yield from self.publish_telegram(tweet["text"]) tweet["telegram_published"] = response["success"] - # Remove published tweets + # Keep pending tweets only tweets = [ t for t in tweets - if not t["twitter_published"] - or not t["farcaster_published"] - or not t["telegram_published"] + if (self.params.publish_twitter and not t["twitter_published"]) + or (self.params.publish_farcaster and not t["farcaster_published"]) + or (self.params.publish_telegram and not t["telegram_published"]) ] # Save tweets to the db diff --git a/packages/dvilela/skills/tsunami_abci/skill.yaml b/packages/dvilela/skills/tsunami_abci/skill.yaml index ecc2b7d..afdebd3 100644 --- a/packages/dvilela/skills/tsunami_abci/skill.yaml +++ b/packages/dvilela/skills/tsunami_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeiaicsttkv5xapta2eqove7si2pyv3zmshkqolluxpnrh3hkulqsqu - behaviours.py: bafybeihnc7ibmhdxkvgaueb2obnefbnynpbcxqb3u2k7mmimqa6tuscxhe + behaviours.py: bafybeiew6hw4jwc6bdcmqbqanxiisoqaj6e4ek5lvjblf36qj6kibhwdbq dialogues.py: bafybeidmgjji6zw6wcvhijrxb74batj2kc2lskfuqxv76duv2j7azcqwra fsm_specification.yaml: bafybeidlfuabsldhezjaovupkvzrtydpcimzz6r56phsi2psrtdzougu4u handlers.py: bafybeigjy73h3uaroovfuuo3ugffrm3oq6pntz5me7nrbsbiwwjceztj5m diff --git a/packages/dvilela/skills/tsunami_chained_abci/skill.yaml b/packages/dvilela/skills/tsunami_chained_abci/skill.yaml index 54d49b5..0ff9eec 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:bafybeifn6dz7h52fftiphyz2sulhvq6qq7qzzbyynsu5h5vsj5mabsip6a +- dvilela/tsunami_abci:0.1.0:bafybeidfryx4juivcatexh3hvf4tnz47xkjq4zdqbr3zpfib5pyxj2nkim behaviours: main: args: {} diff --git a/packages/packages.json b/packages/packages.json index 6b320c6..f975647 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -8,10 +8,10 @@ "connection/dvilela/llama/0.1.0": "bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq", "connection/valory/twitter/0.1.0": "bafybeif6g5sulx4hpm75vt776r6d7obfawsrjom3xq2fsgzdb4d3dssoy4", "connection/dvilela/suno/0.1.0": "bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi", - "skill/dvilela/tsunami_abci/0.1.0": "bafybeifn6dz7h52fftiphyz2sulhvq6qq7qzzbyynsu5h5vsj5mabsip6a", - "skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeie6abwbltsjhd47tw545jk3gkoig6t2cwdwtqlz3s5eposkavpssu", - "agent/dvilela/tsunami/0.1.0": "bafybeic6kbjroomqas4jlvq5m4bsvcbvew3mczcdts576acj63pytprdhy", - "service/dvilela/tsunami/0.1.0": "bafybeifrdlmqlxtwve53cscyxhjpteiirei6qm2ulf2svoltaxphw5p7r4" + "skill/dvilela/tsunami_abci/0.1.0": "bafybeidfryx4juivcatexh3hvf4tnz47xkjq4zdqbr3zpfib5pyxj2nkim", + "skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeia3esvpbzoisefosshyarpo2fpqxjiwwjt7apoad6pdn4c6o72uoe", + "agent/dvilela/tsunami/0.1.0": "bafybeiavcu5fy3g75gpgvweu5nw2x3eyrvwq3z6alsvsrl7tkaykviepaa", + "service/dvilela/tsunami/0.1.0": "bafybeib5kcxyoflseym7qppalo6kgarttashsnhw5h662ovqaoct7iycvu" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",