From a3415e1306836eaba55e094cf1f0953a9b52c114 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 10:52:38 +0200 Subject: [PATCH 01/26] fix: header separator --- docs/index.md | 2 +- packages/packages.json | 14 +++++++------- .../valory/agents/impact_evaluator/aea-config.yaml | 8 ++++---- .../valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/dynamic_nft_abci/behaviours.py | 4 +++- packages/valory/skills/dynamic_nft_abci/skill.yaml | 4 ++-- .../valory/skills/impact_evaluator_abci/skill.yaml | 4 ++-- .../skills/twitter_scoring_abci/behaviours.py | 3 ++- .../valory/skills/twitter_scoring_abci/skill.yaml | 2 +- 10 files changed, 24 insertions(+), 21 deletions(-) diff --git a/docs/index.md b/docs/index.md index f6d64be9..981f0e1e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeiechrafvles27zw5melefdom6up6m2xsuaxzwy4zl3z47narm5biq --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeie7efmthb5s2xwomg2vngbhvugujdipdx3amfwqypu74vhvoj5hi4 --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index edbd6bee..5974324e 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeicrf6rtgehmch3frbypmtoyezgk55wbjd2tmep4se55kk24takkwa", - "contract/valory/dynamic_contribution/0.1.0": "bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice", - "service/valory/impact_evaluator/0.1.0": "bafybeiechrafvles27zw5melefdom6up6m2xsuaxzwy4zl3z47narm5biq", - "skill/valory/dynamic_nft_abci/0.1.0": "bafybeihe7rav55tlymizd5ltiwwvqzqrfqswm5sxsaw6bioal35lecwhny", - "skill/valory/twitter_scoring_abci/0.1.0": "bafybeidccv4tsye4i45f443p7dkidfpw3ifu4jzi4gk4jiz2cscusondhy", + "agent/valory/impact_evaluator/0.1.0": "bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye", + "contract/valory/dynamic_contribution/0.1.0": "bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey", + "service/valory/impact_evaluator/0.1.0": "bafybeie7efmthb5s2xwomg2vngbhvugujdipdx3amfwqypu74vhvoj5hi4", + "skill/valory/dynamic_nft_abci/0.1.0": "bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve", + "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeidro7arpqvceouk6qetxidtfgfrpc7m5zd5ojkufk6aaybznwscfi", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeicevpbtykvlufyoe6eoxthawndelcdhh2rnxfsamqfu3x2xqr3xdy", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,7 +16,7 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeigx57k6zwiatveoiyczbhz6xbdtfhhbxg7442tjqyb7ljjfjusn5e", - "service/valory/impact_evaluator_local/0.1.0": "bafybeiespcdcu22mpeyzjeofat6rrly2jfrrcr4d62t7bs3hflem3oy4fi" + "service/valory/impact_evaluator_local/0.1.0": "bafybeiaebaooeoym2lvkpkmxpmcgodzduwij4pgsepkkvqccul5l4ftsfq" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index fd4c2226..13643f72 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -23,7 +23,7 @@ connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq - valory/twitter:0.1.0:bafybeifm7tpjdd2y5dy5xzuxt3tebyqxmgn56agkqv64nloggqo5cr3sku contracts: -- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice +- valory/dynamic_contribution:0.1.0:bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey - valory/gnosis_safe:0.1.0:bafybeih6d3vxz3jlgodxm5b2qcwsmansqj4xobuyd6hjnhzremuvd65yrm - valory/gnosis_safe_proxy_factory:0.1.0:bafybeid6glyjikjxmefwmhn62cxiofophegjmg2z5vqqsvk6tmyunwc274 - valory/multisend:0.1.0:bafybeieg4tywd5lww2vygvpkilg3hcepa4rmhehjuamyvdf6vazt554v6u @@ -42,12 +42,12 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeidro7arpqvceouk6qetxidtfgfrpc7m5zd5ojkufk6aaybznwscfi +- valory/impact_evaluator_abci:0.1.0:bafybeicevpbtykvlufyoe6eoxthawndelcdhh2rnxfsamqfu3x2xqr3xdy - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeidccv4tsye4i45f443p7dkidfpw3ifu4jzi4gk4jiz2cscusondhy +- valory/twitter_scoring_abci:0.1.0:bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeihe7rav55tlymizd5ltiwwvqzqrfqswm5sxsaw6bioal35lecwhny +- valory/dynamic_nft_abci:0.1.0:bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index bdcd9075..6ebf6570 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeicrf6rtgehmch3frbypmtoyezgk55wbjd2tmep4se55kk24takkwa +agent: valory/impact_evaluator:0.1.0:bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index c4dc86a3..2fd370ea 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeicrf6rtgehmch3frbypmtoyezgk55wbjd2tmep4se55kk24takkwa +agent: valory/impact_evaluator:0.1.0:bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/dynamic_nft_abci/behaviours.py b/packages/valory/skills/dynamic_nft_abci/behaviours.py index 535fcbc8..551ddb60 100644 --- a/packages/valory/skills/dynamic_nft_abci/behaviours.py +++ b/packages/valory/skills/dynamic_nft_abci/behaviours.py @@ -123,7 +123,9 @@ def get_token_id_to_address( from_block=from_block, ) if contract_api_msg.performative != ContractApiMessage.Performative.STATE: - self.context.logger.info("Error retrieving the token_id to address data") + self.context.logger.info( + f"Error retrieving the token_id to address data [{contract_api_msg.performative}]" + ) return TokenTrackRound.ERROR_PAYLOAD, from_block data = cast(dict, contract_api_msg.state.body["token_id_to_member"]) last_block = cast(int, contract_api_msg.state.body["last_block"]) diff --git a/packages/valory/skills/dynamic_nft_abci/skill.yaml b/packages/valory/skills/dynamic_nft_abci/skill.yaml index 502e1b3c..59b6993a 100644 --- a/packages/valory/skills/dynamic_nft_abci/skill.yaml +++ b/packages/valory/skills/dynamic_nft_abci/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeiasfbratsbsxyji2k2xeft3jdqaajwqskjsvbjsqht4mrew6wb2km - behaviours.py: bafybeifvzua5ftti42czon4gwly7heunxagpk3p5xsomfyr32ronhq7coe + behaviours.py: bafybeiegd3jgn6vh3qje3xyqjmt36u3f44iapnpyfrvwu2fmdecnvtzamm ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeiabtq2to7x6bbbnxzrvupz5rky4b6k73y2lw5dmclb6xx74nuzxe4 fsm_specification.yaml: bafybeibkm4iniyjt7ofqredclpvvudtfjbmuatccnblygvqnfucsuymbxy @@ -27,7 +27,7 @@ fingerprint_ignore_patterns: [] connections: - fetchai/http_server:0.22.0:bafybeihp5umafxzx45aad5pj7s3343se2wjkgnbirt4pybrape22swm6de contracts: -- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice +- valory/dynamic_contribution:0.1.0:bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey protocols: - valory/contract_api:1.0.0:bafybeiasywsvax45qmugus5kxogejj66c5taen27h4voriodz7rgushtqa - valory/http:1.0.0:bafybeia5bxdua2i6chw6pg47bvoljzcpuqxzy4rdrorbdmcbnwmnfdobtu diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 9fff0970..9971bc1f 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeidccv4tsye4i45f443p7dkidfpw3ifu4jzi4gk4jiz2cscusondhy +- valory/twitter_scoring_abci:0.1.0:bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeihe7rav55tlymizd5ltiwwvqzqrfqswm5sxsaw6bioal35lecwhny +- valory/dynamic_nft_abci:0.1.0:bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm diff --git a/packages/valory/skills/twitter_scoring_abci/behaviours.py b/packages/valory/skills/twitter_scoring_abci/behaviours.py index 4ddb4387..fe8c11ca 100644 --- a/packages/valory/skills/twitter_scoring_abci/behaviours.py +++ b/packages/valory/skills/twitter_scoring_abci/behaviours.py @@ -733,9 +733,10 @@ def _get_twitter_hashtag_search( # Check response status if response.status_code != 200: + header_separator = "\r\n" if "\r\n" in response.headers else "\n" headers = [ header.split(": ") - for header in response.headers.split("\r\n") + for header in response.headers.split(header_separator) if header ] header_dict = {key: value for key, value in headers} diff --git a/packages/valory/skills/twitter_scoring_abci/skill.yaml b/packages/valory/skills/twitter_scoring_abci/skill.yaml index ad493b9d..aa2aefce 100644 --- a/packages/valory/skills/twitter_scoring_abci/skill.yaml +++ b/packages/valory/skills/twitter_scoring_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeifudgakkjoyahuewp2o4gvqayw7nsgpyxw2ayrpgmzexurh2xomaq - behaviours.py: bafybeice3hmo4pz6rmrtaxqhvlgavrn4n6ns456xjqjmgy4zfp7wdejk2u + behaviours.py: bafybeif53w5qateambddnbl2hwmi57jmguex3sdefhco7epnc4ur6whiv4 ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si fsm_specification.yaml: bafybeie6k4aanmwcrghspbqywdh2srrudtkhnbbhqm3ovcz5k4fa5dybrq From 17fac2273127c1e3bcb287d16fd88f5bcf38f011 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 12:12:18 +0200 Subject: [PATCH 02/26] fix: rpc retries --- .../valory/skills/dynamic_nft_abci/rounds.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/valory/skills/dynamic_nft_abci/rounds.py b/packages/valory/skills/dynamic_nft_abci/rounds.py index 25e368a9..12b9b87a 100644 --- a/packages/valory/skills/dynamic_nft_abci/rounds.py +++ b/packages/valory/skills/dynamic_nft_abci/rounds.py @@ -36,6 +36,7 @@ ) from packages.valory.skills.dynamic_nft_abci.payloads import TokenTrackPayload +MAX_TOKEN_EVENT_RETRIES = 3 class Event(Enum): """DynamicNFTAbciApp Events""" @@ -73,6 +74,11 @@ def pending_write(self) -> bool: """Checks whether there are changes pending to be written to Ceramic.""" return cast(bool, self.db.get("pending_write", False)) + @property + def token_event_retries(self) -> int: + """Get the token id to points mapping.""" + return cast(int, self.db.get("token_event_retries", 0)) + class TokenTrackRound(CollectSameUntilThresholdRound): """TokenTrackRound""" @@ -88,6 +94,19 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: payload = json.loads(self.most_voted_payload) if payload == TokenTrackRound.ERROR_PAYLOAD: + + token_event_retries = cast(SynchronizedData, self.synchronized_data).token_event_retries + 1 + + if token_event_retries >= MAX_TOKEN_EVENT_RETRIES: + return self.synchronized_data, Event.DONE + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.token_event_retries): token_event_retries, + } + ) + return self.synchronized_data, Event.CONTRACT_ERROR token_id_to_points = payload["token_id_to_points"] @@ -102,6 +121,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: get_name(SynchronizedData.last_update_time): last_update_time, get_name(SynchronizedData.ceramic_db): ceramic_db, get_name(SynchronizedData.pending_write): pending_write, + get_name(SynchronizedData.token_event_retries): 0, } ) return (synchronized_data, Event.DONE) From ed89f5ae47bf340389d1c7947b89cf3c85b9b4d8 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 12:12:25 +0200 Subject: [PATCH 03/26] fix: logging --- packages/valory/skills/dynamic_nft_abci/behaviours.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/valory/skills/dynamic_nft_abci/behaviours.py b/packages/valory/skills/dynamic_nft_abci/behaviours.py index 551ddb60..3349a6f8 100644 --- a/packages/valory/skills/dynamic_nft_abci/behaviours.py +++ b/packages/valory/skills/dynamic_nft_abci/behaviours.py @@ -108,6 +108,7 @@ def get_token_id_to_address( ] ) except KeyError: + self.context.logger.warning(f"last_parsed_block is not set. Using default earliest_block_to_monitor={self.params.earliest_block_to_monitor}") from_block = self.params.earliest_block_to_monitor self.context.logger.info( From 772fe20ed1807b8dff91c4b02f4f293354012331 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 12:39:16 +0200 Subject: [PATCH 04/26] refactor: extract headers --- docs/index.md | 2 +- packages/packages.json | 14 +++++----- .../agents/impact_evaluator/aea-config.yaml | 8 +++--- .../services/impact_evaluator/service.yaml | 2 +- .../impact_evaluator_local/service.yaml | 2 +- .../skills/dynamic_nft_abci/behaviours.py | 6 +++-- .../valory/skills/dynamic_nft_abci/rounds.py | 11 ++++++-- .../valory/skills/dynamic_nft_abci/skill.yaml | 6 ++--- .../skills/impact_evaluator_abci/skill.yaml | 4 +-- .../skills/twitter_scoring_abci/behaviours.py | 26 +++++++++---------- .../skills/twitter_scoring_abci/skill.yaml | 2 +- 11 files changed, 45 insertions(+), 38 deletions(-) diff --git a/docs/index.md b/docs/index.md index 981f0e1e..b0ba2415 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeie7efmthb5s2xwomg2vngbhvugujdipdx3amfwqypu74vhvoj5hi4 --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeihdjgxxf5ei7hayo5fsigrfg5ktgk2mg7yxzbhfrz4jsxhxce7eny --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 5974324e..7b4b3f25 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye", - "contract/valory/dynamic_contribution/0.1.0": "bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey", - "service/valory/impact_evaluator/0.1.0": "bafybeie7efmthb5s2xwomg2vngbhvugujdipdx3amfwqypu74vhvoj5hi4", - "skill/valory/dynamic_nft_abci/0.1.0": "bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve", - "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu", + "agent/valory/impact_evaluator/0.1.0": "bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse", + "contract/valory/dynamic_contribution/0.1.0": "bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice", + "service/valory/impact_evaluator/0.1.0": "bafybeihdjgxxf5ei7hayo5fsigrfg5ktgk2mg7yxzbhfrz4jsxhxce7eny", + "skill/valory/dynamic_nft_abci/0.1.0": "bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii", + "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeicevpbtykvlufyoe6eoxthawndelcdhh2rnxfsamqfu3x2xqr3xdy", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiazjmtdnjzsdj7h6nclzhakffembvmo4a4w2qf46cmikwlmvbfzse", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,7 +16,7 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeigx57k6zwiatveoiyczbhz6xbdtfhhbxg7442tjqyb7ljjfjusn5e", - "service/valory/impact_evaluator_local/0.1.0": "bafybeiaebaooeoym2lvkpkmxpmcgodzduwij4pgsepkkvqccul5l4ftsfq" + "service/valory/impact_evaluator_local/0.1.0": "bafybeigtp55blkwef4bbimmcn7zq2xu77r7rq6katbrr3fsnvfwfuoy6tq" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 13643f72..2e0ab666 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -23,7 +23,7 @@ connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq - valory/twitter:0.1.0:bafybeifm7tpjdd2y5dy5xzuxt3tebyqxmgn56agkqv64nloggqo5cr3sku contracts: -- valory/dynamic_contribution:0.1.0:bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey +- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice - valory/gnosis_safe:0.1.0:bafybeih6d3vxz3jlgodxm5b2qcwsmansqj4xobuyd6hjnhzremuvd65yrm - valory/gnosis_safe_proxy_factory:0.1.0:bafybeid6glyjikjxmefwmhn62cxiofophegjmg2z5vqqsvk6tmyunwc274 - valory/multisend:0.1.0:bafybeieg4tywd5lww2vygvpkilg3hcepa4rmhehjuamyvdf6vazt554v6u @@ -42,12 +42,12 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeicevpbtykvlufyoe6eoxthawndelcdhh2rnxfsamqfu3x2xqr3xdy +- valory/impact_evaluator_abci:0.1.0:bafybeiazjmtdnjzsdj7h6nclzhakffembvmo4a4w2qf46cmikwlmvbfzse - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu +- valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve +- valory/dynamic_nft_abci:0.1.0:bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 6ebf6570..f0968355 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye +agent: valory/impact_evaluator:0.1.0:bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 2fd370ea..de5c923f 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeibwc5ahautvf4dci4y7r3vmrlzizl7cngvnr3jnxetz3dqyos4sye +agent: valory/impact_evaluator:0.1.0:bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/dynamic_nft_abci/behaviours.py b/packages/valory/skills/dynamic_nft_abci/behaviours.py index 3349a6f8..e6f83ced 100644 --- a/packages/valory/skills/dynamic_nft_abci/behaviours.py +++ b/packages/valory/skills/dynamic_nft_abci/behaviours.py @@ -108,12 +108,14 @@ def get_token_id_to_address( ] ) except KeyError: - self.context.logger.warning(f"last_parsed_block is not set. Using default earliest_block_to_monitor={self.params.earliest_block_to_monitor}") + self.context.logger.warning( + f"last_parsed_block is not set. Using default earliest_block_to_monitor={self.params.earliest_block_to_monitor}" + ) from_block = self.params.earliest_block_to_monitor self.context.logger.info( f"Retrieving Transfer events later than block {from_block}" - f" for contract at {self.params.dynamic_contribution_contract_address}" + f" for contract at {self.params.dynamic_contribution_contract_address}. Retries={self.synchronized_data.token_event_retries}" ) contract_api_msg = yield from self.get_contract_api_response( performative=ContractApiMessage.Performative.GET_STATE, # type: ignore diff --git a/packages/valory/skills/dynamic_nft_abci/rounds.py b/packages/valory/skills/dynamic_nft_abci/rounds.py index 12b9b87a..f5fb7b40 100644 --- a/packages/valory/skills/dynamic_nft_abci/rounds.py +++ b/packages/valory/skills/dynamic_nft_abci/rounds.py @@ -36,8 +36,10 @@ ) from packages.valory.skills.dynamic_nft_abci.payloads import TokenTrackPayload + MAX_TOKEN_EVENT_RETRIES = 3 + class Event(Enum): """DynamicNFTAbciApp Events""" @@ -95,7 +97,10 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: if payload == TokenTrackRound.ERROR_PAYLOAD: - token_event_retries = cast(SynchronizedData, self.synchronized_data).token_event_retries + 1 + token_event_retries = ( + cast(SynchronizedData, self.synchronized_data).token_event_retries + + 1 + ) if token_event_retries >= MAX_TOKEN_EVENT_RETRIES: return self.synchronized_data, Event.DONE @@ -103,7 +108,9 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: synchronized_data = self.synchronized_data.update( synchronized_data_class=SynchronizedData, **{ - get_name(SynchronizedData.token_event_retries): token_event_retries, + get_name( + SynchronizedData.token_event_retries + ): token_event_retries, } ) diff --git a/packages/valory/skills/dynamic_nft_abci/skill.yaml b/packages/valory/skills/dynamic_nft_abci/skill.yaml index 59b6993a..9ab68586 100644 --- a/packages/valory/skills/dynamic_nft_abci/skill.yaml +++ b/packages/valory/skills/dynamic_nft_abci/skill.yaml @@ -7,14 +7,14 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeiasfbratsbsxyji2k2xeft3jdqaajwqskjsvbjsqht4mrew6wb2km - behaviours.py: bafybeiegd3jgn6vh3qje3xyqjmt36u3f44iapnpyfrvwu2fmdecnvtzamm + behaviours.py: bafybeib2zfbow4ft64w3ib53u4hkanzvoubd2vq5mjrehg2x3omccwg4ni ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeiabtq2to7x6bbbnxzrvupz5rky4b6k73y2lw5dmclb6xx74nuzxe4 fsm_specification.yaml: bafybeibkm4iniyjt7ofqredclpvvudtfjbmuatccnblygvqnfucsuymbxy handlers.py: bafybeiciwdw6ori5sld5ww3znevwgfoiiiwcquv7imq2s7z6a4ybmb2c54 models.py: bafybeianeimox27xwxbm5yq6go3ygf3oa2cbuv6h4y64oyjo3m2ua23sxq payloads.py: bafybeiggpj2qmh73nlr2rscisscxovf7bfrczlut7k33jujvutzgszjcwi - rounds.py: bafybeie66w2czx57wcfhek5cqw5ecnhkqxr3ycdlnyqkrfk6sljgvkv3xq + rounds.py: bafybeia7fehb5yuxr4p3lakgfohtgwmw24kjfvor4tbhkm3v7yx2uxcg3m tests/__init__.py: bafybeidxte5jeugotf25yogfbsoivyokeqffrvzo7lqgspm4kzrgbhvc3u tests/test_behaviours.py: bafybeibojamjtso4gc5zxuvssqwdhigpaeixz2f4s7jkeiwxi5g5vvhaqm tests/test_ceramic_db.py: bafybeiaemz76p55aicazhysbgisrjm5sls55jbbnyfbbyye5fpsk6ltxz4 @@ -27,7 +27,7 @@ fingerprint_ignore_patterns: [] connections: - fetchai/http_server:0.22.0:bafybeihp5umafxzx45aad5pj7s3343se2wjkgnbirt4pybrape22swm6de contracts: -- valory/dynamic_contribution:0.1.0:bafybeicwnpenm5t2jdqy3jipyqf5edbxkl3i76ko3jvr5jtg2fux5dohey +- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice protocols: - valory/contract_api:1.0.0:bafybeiasywsvax45qmugus5kxogejj66c5taen27h4voriodz7rgushtqa - valory/http:1.0.0:bafybeia5bxdua2i6chw6pg47bvoljzcpuqxzy4rdrorbdmcbnwmnfdobtu diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 9971bc1f..e5b073b5 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -26,9 +26,9 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeicllgj23sni2m6mkpu3z3oaurkofzumtnxhtj4fhmwn5dzkr5mqwu +- valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeibfkmfrvi742htvm3ibhycnlvixxkegt54cbni7onqwwtyecklkve +- valory/dynamic_nft_abci:0.1.0:bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm diff --git a/packages/valory/skills/twitter_scoring_abci/behaviours.py b/packages/valory/skills/twitter_scoring_abci/behaviours.py index fe8c11ca..0dd9fc99 100644 --- a/packages/valory/skills/twitter_scoring_abci/behaviours.py +++ b/packages/valory/skills/twitter_scoring_abci/behaviours.py @@ -88,6 +88,15 @@ HTTP_TOO_MANY_REQUESTS = 429 +def extract_headers(header_str: str) -> dict: + """Extracts HTTP headers""" + header_separator = "\r\n" if "\r\n" in header_str else "\n" + headers = [ + header.split(": ") for header in header_str.split(header_separator) if header + ] + return {key: value for key, value in headers} + + class TwitterScoringBaseBehaviour(BaseBehaviour, ABC): """Base behaviour for the common apps' skill.""" @@ -470,13 +479,8 @@ def _get_twitter_mentions( ) # Check response status - if response.status_code != HTTP_OK: - headers = [ - header.split(": ") - for header in response.headers.split("\r\n") - if header - ] - header_dict = {key: value for key, value in headers} + if response.status_code != 200: + header_dict = extract_headers(response.headers) remaining, limit, reset_ts = [ header_dict.get(header, "?") @@ -733,13 +737,7 @@ def _get_twitter_hashtag_search( # Check response status if response.status_code != 200: - header_separator = "\r\n" if "\r\n" in response.headers else "\n" - headers = [ - header.split(": ") - for header in response.headers.split(header_separator) - if header - ] - header_dict = {key: value for key, value in headers} + header_dict = extract_headers(response.headers) remaining, limit, reset_ts = [ header_dict.get(header, "?") diff --git a/packages/valory/skills/twitter_scoring_abci/skill.yaml b/packages/valory/skills/twitter_scoring_abci/skill.yaml index aa2aefce..05b33adb 100644 --- a/packages/valory/skills/twitter_scoring_abci/skill.yaml +++ b/packages/valory/skills/twitter_scoring_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeifudgakkjoyahuewp2o4gvqayw7nsgpyxw2ayrpgmzexurh2xomaq - behaviours.py: bafybeif53w5qateambddnbl2hwmi57jmguex3sdefhco7epnc4ur6whiv4 + behaviours.py: bafybeif7x53ygd3jyoghbnxavzhhdhliaa3mcxe5n5uui3aa6vgd6v5t5e ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si fsm_specification.yaml: bafybeie6k4aanmwcrghspbqywdh2srrudtkhnbbhqm3ovcz5k4fa5dybrq From 832c4960e552d8a99259dbdb43eaa23fb9f085b4 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 12:46:49 +0200 Subject: [PATCH 05/26] fix: avoid getting processing block --- packages/valory/contracts/dynamic_contribution/contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/valory/contracts/dynamic_contribution/contract.py b/packages/valory/contracts/dynamic_contribution/contract.py index c4f8c4d7..5e552a35 100644 --- a/packages/valory/contracts/dynamic_contribution/contract.py +++ b/packages/valory/contracts/dynamic_contribution/contract.py @@ -111,7 +111,7 @@ def get_all_erc721_transfers( # the connection could time out. MAX_BLOCKS = 300000 to_block = ( - ledger_api.api.eth.get_block_number() if to_block == "latest" else to_block + ledger_api.api.eth.get_block_number() - 1 if to_block == "latest" else to_block ) ranges = list(range(from_block, to_block, MAX_BLOCKS)) + [to_block] From 549de14725c5e9059ce72242aa00451714ff2296 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 17:47:55 +0200 Subject: [PATCH 06/26] feat: weekly olas skill --- .../valory/skills/olas_week_abci/__init__.py | 25 + .../skills/olas_week_abci/behaviours.py | 684 ++++++++++++++++++ .../skills/olas_week_abci/ceramic_db.py | 184 +++++ .../valory/skills/olas_week_abci/dialogues.py | 120 +++ .../olas_week_abci/fsm_specification.yaml | 70 ++ .../valory/skills/olas_week_abci/handlers.py | 65 ++ .../valory/skills/olas_week_abci/models.py | 114 +++ .../valory/skills/olas_week_abci/payloads.py | 68 ++ .../valory/skills/olas_week_abci/prompts.py | 65 ++ .../valory/skills/olas_week_abci/rounds.py | 484 +++++++++++++ .../valory/skills/olas_week_abci/skill.yaml | 178 +++++ 11 files changed, 2057 insertions(+) create mode 100644 packages/valory/skills/olas_week_abci/__init__.py create mode 100644 packages/valory/skills/olas_week_abci/behaviours.py create mode 100644 packages/valory/skills/olas_week_abci/ceramic_db.py create mode 100644 packages/valory/skills/olas_week_abci/dialogues.py create mode 100644 packages/valory/skills/olas_week_abci/fsm_specification.yaml create mode 100644 packages/valory/skills/olas_week_abci/handlers.py create mode 100644 packages/valory/skills/olas_week_abci/models.py create mode 100644 packages/valory/skills/olas_week_abci/payloads.py create mode 100644 packages/valory/skills/olas_week_abci/prompts.py create mode 100644 packages/valory/skills/olas_week_abci/rounds.py create mode 100644 packages/valory/skills/olas_week_abci/skill.yaml diff --git a/packages/valory/skills/olas_week_abci/__init__.py b/packages/valory/skills/olas_week_abci/__init__.py new file mode 100644 index 00000000..41b26021 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the implementation of the default skill.""" + +from aea.configurations.base import PublicId + + +PUBLIC_ID = PublicId.from_str("valory/olas_week_abci:0.1.0") diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py new file mode 100644 index 00000000..5d8432b8 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -0,0 +1,684 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package contains round behaviours of TwitterScoringAbciApp.""" + +import json +import math +import random +import re +from abc import ABC +from datetime import datetime, timedelta +from typing import Dict, Generator, List, Optional, Set, Tuple, Type, cast + +from web3 import Web3 + +from packages.valory.connections.openai.connection import ( + PUBLIC_ID as LLM_CONNECTION_PUBLIC_ID, +) +from packages.valory.protocols.llm.message import LlmMessage +from packages.valory.skills.abstract_round_abci.base import AbstractRound +from packages.valory.skills.abstract_round_abci.behaviours import ( + AbstractRoundBehaviour, + BaseBehaviour, +) +from packages.valory.skills.abstract_round_abci.common import RandomnessBehaviour +from packages.valory.skills.abstract_round_abci.models import Requests +from packages.valory.skills.olas_week_abci.ceramic_db import CeramicDB +from packages.valory.skills.olas_week_abci.dialogues import ( + LlmDialogue, + LlmDialogues, +) +from packages.valory.skills.olas_week_abci.models import ( + OpenAICalls, + Params, + SharedState, +) +from packages.valory.skills.olas_week_abci.payloads import ( + OpenAICallCheckPayload, + TweetEvaluationPayload, + TwitterDecisionMakingPayload, + TweetCollectionPayload, + TwitterRandomnessPayload, + TwitterSelectKeepersPayload, +) +from packages.valory.skills.olas_week_abci.prompts import tweet_summarizer_prompt +from packages.valory.skills.olas_week_abci.rounds import ( + DBUpdateRound, + ERROR_API_LIMITS, + ERROR_GENERIC, + Event, + OpenAICallCheckRound, + SynchronizedData, + TweetEvaluationRound, + TwitterDecisionMakingRound, + TwitterHashtagsCollectionRound, + TwitterMentionsCollectionRound, + TwitterRandomnessRound, + TwitterScoringAbciApp, + TwitterSelectKeepersRound, +) + + +ONE_DAY = 86400.0 +ADDRESS_REGEX = r"0x[a-fA-F0-9]{40}" +TAGLINE = "I'm linking my wallet to @Autonolas Contribute:" +DEFAULT_TWEET_POINTS = 100 +TWEET_QUALITY_TO_POINTS = {"LOW": 1, "AVERAGE": 2, "HIGH": 3} +TWEET_RELATIONSHIP_TO_POINTS = {"LOW": 100, "AVERAGE": 200, "HIGH": 300} +HTTP_OK = 200 +HTTP_TOO_MANY_REQUESTS = 429 +MAX_TWEET_CHARS = 250 # do not use 280 as not every char counts the same + + +def extract_headers(header_str: str) -> dict: + """Extracts HTTP headers""" + header_separator = "\r\n" if "\r\n" in header_str else "\n" + headers = [ + header.split(": ") for header in header_str.split(header_separator) if header + ] + return {key: value for key, value in headers} + + +def parse_summary(summary: str) -> list: + """Parse the tweet summary""" + if summary.startswith("Summary: "): + summary = summary.replace("Summary: ", "") + + tweets = [] + for sentence in summary.split("."): + sentence = sentence.strip() + while len(sentence) > MAX_TWEET_CHARS: + tweets.append(sentence[:MAX_TWEET_CHARS]) + sentence = sentence[MAX_TWEET_CHARS:] + if not tweets: + tweets.append(sentence) + + return tweets + + +class OlasWeekBaseBehaviour(BaseBehaviour, ABC): + """Base behaviour for the common apps' skill.""" + + @property + def synchronized_data(self) -> SynchronizedData: + """Return the synchronized data.""" + return cast(SynchronizedData, super().synchronized_data) + + @property + def params(self) -> Params: + """Return the params.""" + return cast(Params, super().params) + + @property + def openai_calls(self) -> OpenAICalls: + """Return the params.""" + return self.params.openai_calls + + def _check_twitter_limits(self) -> Tuple: + """Check if the daily limit has exceeded or not""" + try: + number_of_tweets_pulled_today = int( + self.synchronized_data.ceramic_db["module_data"]["twitter"][ + "number_of_tweets_pulled_today" + ] + ) + last_tweet_pull_window_reset = float( + self.synchronized_data.ceramic_db["module_data"]["twitter"][ + "last_tweet_pull_window_reset" + ] + ) + except KeyError: + number_of_tweets_pulled_today = 0 + last_tweet_pull_window_reset = cast( + SharedState, self.context.state + ).round_sequence.last_round_transition_timestamp.timestamp() + + current_time = cast( + SharedState, self.context.state + ).round_sequence.last_round_transition_timestamp.timestamp() + + # 15 min window limit + if self.synchronized_data.sleep_until: + time_window_close = self.synchronized_data.sleep_until + if current_time < time_window_close: + return True, 0, current_time + + # Window has expired + if current_time >= last_tweet_pull_window_reset + ONE_DAY: + return False, 0, current_time + + # Reached max number of tweets + if number_of_tweets_pulled_today >= self.params.max_tweet_pulls_allowed: + return True, number_of_tweets_pulled_today, last_tweet_pull_window_reset + + # Window has not expired and we have not reached the max number of tweets + return False, number_of_tweets_pulled_today, last_tweet_pull_window_reset + + +class TwitterRandomnessBehaviour(RandomnessBehaviour): + """Retrieve randomness.""" + + matching_round = TwitterRandomnessRound + payload_class = TwitterRandomnessPayload + + +class TwitterSelectKeepersBehaviour(OlasWeekBaseBehaviour): + """Select the keeper agent.""" + + matching_round = TwitterSelectKeepersRound + payload_class = TwitterSelectKeepersPayload + + def _select_keepers(self) -> List[str]: + """ + Select new keepers randomly. + + 1. Sort the list of participants who are not blacklisted as keepers. + 2. Randomly shuffle it. + 3. Pick the first keepers in order. + 4. If they have already been selected, pick the next ones. + + :return: the selected keepers' addresses. + """ + # Get all the participants who have not been blacklisted as keepers + non_blacklisted = ( + self.synchronized_data.participants + - self.synchronized_data.blacklisted_keepers + ) + if not non_blacklisted: + raise RuntimeError( + "Cannot continue if all the keepers have been blacklisted!" + ) + + # Sorted list of participants who are not blacklisted as keepers + relevant_set = sorted(list(non_blacklisted)) + + needed_keepers = math.ceil( + self.synchronized_data.nb_participants / 2 + ) # half or 1 + + # Check if we need random selection + if len(relevant_set) <= needed_keepers: + keeper_addresses = list(relevant_set) + self.context.logger.info(f"Selected new keepers: {keeper_addresses}.") + return keeper_addresses + + # Random seeding and shuffling of the set + random.seed(self.synchronized_data.keeper_randomness) + random.shuffle(relevant_set) + + # If the keeper is not set yet, pick the first address + keeper_addresses = relevant_set[0:2] + + # If the keepers have been already set, select the next ones. + if ( + self.synchronized_data.are_keepers_set + and len(self.synchronized_data.participants) > 2 + ): + old_keeper_index = relevant_set.index( + self.synchronized_data.most_voted_keeper_addresses[0] + ) + keeper_addresses = [ + relevant_set[ + (old_keeper_index + 2) % len(relevant_set) + ], # skip the previous 2 + relevant_set[(old_keeper_index + 3) % len(relevant_set)], + ] + + self.context.logger.info(f"Selected new keepers: {keeper_addresses}.") + + return keeper_addresses + + def async_act(self) -> Generator: + """ + Do the action. + + Steps: + - Select a keeper randomly. + - Send the transaction with the keeper and wait for it to be mined. + - Wait until ABCI application transitions to the next round. + - Go to the next behaviour state (set done event). + """ + + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + payload = TwitterSelectKeepersPayload( # type: ignore + self.context.agent_address, + json.dumps(self._select_keepers(), sort_keys=True), + ) + + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + yield from self.send_a2a_transaction(payload) + yield from self.wait_until_round_end() + + self.set_done() + + +class TwitterDecisionMakingBehaviour(OlasWeekBaseBehaviour): + """TwitterDecisionMakingBehaviour""" + + matching_round: Type[AbstractRound] = TwitterDecisionMakingRound + + def async_act(self) -> Generator: + """Do the act, supporting asynchronous execution.""" + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + event = self.get_next_event() + self.context.logger.info(f"Next event: {event}") + + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + yield from self.send_a2a_transaction( + payload=TwitterDecisionMakingPayload( + sender=self.context.agent_address, + event=event, + ) + ) + yield from self.wait_until_round_end() + self.set_done() + + def get_next_event(self) -> str: + """Decide what is the next round""" + + performed_tasks = self.synchronized_data.performed_olas_week_tasks + + self.context.logger.info(f"Performed tasks: {performed_tasks}") + + if Event.OPENAI_CALL_CHECK.value not in performed_tasks: + return Event.OPENAI_CALL_CHECK.value + + if performed_tasks[Event.OPENAI_CALL_CHECK.value] == Event.NO_ALLOWANCE.value: + return Event.DONE_SKIP.value + + if Event.SELECT_KEEPERS.value not in performed_tasks: + return Event.SELECT_KEEPERS.value + + if Event.RETRIEVE_TWEETS.value not in performed_tasks: + return Event.RETRIEVE_TWEETS.value + + if Event.EVALUATE.value not in performed_tasks: + return Event.EVALUATE.value + + if Event.DB_UPDATE.value not in performed_tasks: + return Event.DB_UPDATE.value + + return Event.DONE.value + + +class OpenAICallCheckBehaviour(OlasWeekBaseBehaviour): + """TweetCollectionBehaviour""" + + matching_round: Type[AbstractRound] = OpenAICallCheckRound + + def async_act(self) -> Generator: + """Do the act, supporting asynchronous execution.""" + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + current_time = cast( + SharedState, self.context.state + ).round_sequence.last_round_transition_timestamp.timestamp() + # Reset the window if the window expired before checking + self.openai_calls.reset(current_time=current_time) + if self.openai_calls.max_calls_reached(): + content = None + else: + content = OpenAICallCheckRound.CALLS_REMAINING + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + yield from self.send_a2a_transaction( + payload=OpenAICallCheckPayload( + sender=self.context.agent_address, + content=content, + ) + ) + yield from self.wait_until_round_end() + self.set_done() + + +class TweetCollectionBehaviour(OlasWeekBaseBehaviour): + """TweetCollectionBehaviour""" + + matching_round: Type[AbstractRound] = TwitterMentionsCollectionRound + + def _i_am_not_sending(self) -> bool: + """Indicates if the current agent is one of the sender or not.""" + return ( + self.context.agent_address + not in self.synchronized_data.most_voted_keeper_addresses + ) + + def async_act(self) -> Generator[None, None, None]: + """ + Do the action. + + Steps: + - If the agent is the keeper, then prepare the transaction and send it. + - Otherwise, wait until the next round. + - If a timeout is hit, set exit A event, otherwise set done event. + """ + if self._i_am_not_sending(): + yield from self._not_sender_act() + else: + yield from self._sender_act() + + def _not_sender_act(self) -> Generator: + """Do the non-sender action.""" + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + self.context.logger.info( + f"Waiting for the keeper to do its keeping: keepers={self.synchronized_data.most_voted_keeper_addresses}, me={self.context.agent_address}" + ) + yield from self.wait_until_round_end() + self.set_done() + + def _sender_act(self) -> Generator: + """Do the act, supporting asynchronous execution.""" + + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + self.context.logger.info("I am a keeper") + + ( + has_limit_reached, + number_of_tweets_pulled_today, + last_tweet_pull_window_reset, + ) = self._check_twitter_limits() + + if has_limit_reached: + self.context.logger.info( + "Cannot retrieve tweets, max number of tweets reached for today or 15-min request amount reached" + ) + payload_data = { + "tweets": None, + "error": ERROR_API_LIMITS, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": self.synchronized_data.sleep_until, + } + + else: + # Get mentions from Twitter + payload_data = yield from self._get_twitter_mentions( + number_of_tweets_pulled_today=number_of_tweets_pulled_today + ) + + payload_data["last_tweet_pull_window_reset"] = last_tweet_pull_window_reset + sender = self.context.agent_address + payload = TweetCollectionPayload( + sender=sender, content=json.dumps(payload_data, sort_keys=True) + ) + + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + yield from self.send_a2a_transaction(payload) + yield from self.wait_until_round_end() + + self.set_done() + + def _get_twitter_mentions( + self, + number_of_tweets_pulled_today: int, + ) -> Generator[None, None, Dict]: + """Get Twitter mentions""" + + api_base = self.params.twitter_api_base + api_endpoint = self.params.twitter_tweets_args + + number_of_tweets_remaining_today = ( + self.params.max_tweet_pulls_allowed - number_of_tweets_pulled_today + ) + if number_of_tweets_remaining_today <= 0: + self.context.logger.info( + "Cannot retrieve twitter mentions, max number of tweets reached for today" + ) + return { + "tweets": None, + "error": ERROR_API_LIMITS, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": self.synchronized_data.sleep_until, + } + + # Calculate the starting time (7 days ago) + now_ts = cast( + SharedState, self.context.state + ).round_sequence.last_round_transition_timestamp.timestamp() + + start_time = datetime.fromtimestamp(now_ts) - timedelta(days = 7) + + start_time_str = start_time.strftime("%Y-%m-%dT%H:%M:%S:00Z") + + # Build the args + api_args = self.params.twitter_mentions_args.replace( + "{start_time}", start_time_str + ) + api_args = api_args.replace( + "{max_results}", str(number_of_tweets_remaining_today) + ) + api_url = api_base + api_endpoint + api_args + headers = dict(Authorization=f"Bearer {self.params.twitter_api_bearer_token}") + + self.context.logger.info( + f"Retrieving tweets from Twitter API [{api_url}]\nBearer token {self.params.twitter_api_bearer_token[:5]}*******{self.params.twitter_api_bearer_token[-5:]}" + ) + + tweets = {} + next_token = None + + # Pagination loop: we read a max of pages each period + # Each page contains 100 tweets. The default value for twitter_max_pages is 10 + for _ in range(self.params.twitter_max_pages): + self.context.logger.info( + f"Retrieving a new page. max_pages={self.params.twitter_max_pages}" + ) + url = api_url + # Add the pagination token if it exists + if next_token: + url += f"&pagination_token={next_token}" + + # Make the request + response = yield from self.get_http_response( + method="GET", url=url, headers=headers + ) + + # Check response status + if response.status_code != 200: + header_dict = extract_headers(response.headers) + + remaining, limit, reset_ts = [ + header_dict.get(header, "?") + for header in [ + "x-rate-limit-remaining", + "x-rate-limit-limit", + "x-rate-limit-reset", + ] + ] + reset = ( + datetime.fromtimestamp(int(reset_ts)).strftime("%Y-%m-%d %H:%M:%S") + if reset_ts != "?" + else None + ) + + self.context.logger.error( + f"Error retrieving mentions from Twitter [{response.status_code}]: {response.body}" + f"API limits: {remaining}/{limit}. Window reset: {reset}" + ) + + return { + "tweets": None, + "error": ERROR_API_LIMITS + if response.status_code == HTTP_TOO_MANY_REQUESTS + else ERROR_GENERIC, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": reset_ts + if response.status_code == HTTP_TOO_MANY_REQUESTS + else self.synchronized_data.sleep_until, + } + + api_data = json.loads(response.body) + + # Check the meta field + if "meta" not in api_data: + self.context.logger.error( + f"Twitter API response does not contain the required 'meta' field: {api_data!r}" + ) + return { + "tweets": None, + "error": ERROR_GENERIC, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": None, # we reset this on a successful request + } + + # Check if there are no more results + if ( + "result_count" in api_data["meta"] + and int(api_data["meta"]["result_count"]) == 0 + ): + break + + # Check that the data exists + if "data" not in api_data or "newest_id" not in api_data["meta"]: + self.context.logger.error( + f"Twitter API response does not contain the required 'meta' field: {api_data!r}" + ) + return { + "tweets": None, + "error": ERROR_GENERIC, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": None, # we reset this on a successful request + } + + if "includes" not in api_data or "users" not in api_data["includes"]: + self.context.logger.error( + f"Twitter API response does not contain the required 'includes/users' field: {api_data!r}" + ) + return { + "tweets": None, + "error": ERROR_GENERIC, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": None, # we reset this on a successful request + } + + # Add the retrieved tweets + for tweet in api_data["data"]: + tweets[tweet["id"]] = tweet + + # Set the author handle + for user in api_data["includes"]["users"]: + if user["id"] == tweet["author_id"]: + tweets[tweet["id"]]["username"] = user["username"] + break + number_of_tweets_pulled_today += 1 + + if "next_token" in api_data["meta"]: + next_token = api_data["meta"]["next_token"] + continue + + break + + self.context.logger.info( + f"Got {len(tweets)} new tweets" + ) + + return { + "tweets": tweets, + "number_of_tweets_pulled_today": number_of_tweets_pulled_today, + "sleep_until": None, # we reset this on a successful request + } + + +class TweetEvaluationBehaviour(OlasWeekBaseBehaviour): + """TweetEvaluationBehaviour""" + + matching_round: Type[AbstractRound] = TweetEvaluationRound + + def async_act(self) -> Generator: + """Do the act, supporting asynchronous execution.""" + + with self.context.benchmark_tool.measure(self.behaviour_id).local(): + text = "\n\n".join([f"tweet_{i}: {tweet}" for i, tweet in enumerate(self.synchronized_data.weekly_tweets)]) + + summary_tweets = yield from self.evaluate_summary( + text + ) + + sender = self.context.agent_address + payload = TweetEvaluationPayload( + sender=sender, content=json.dumps({"summary_tweets": summary_tweets}, sort_keys=True) + ) + + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + yield from self.send_a2a_transaction(payload) + yield from self.wait_until_round_end() + + self.set_done() + + def evaluate_summary(self, text: str) -> Generator[None, None, list]: + """Create the tweet summary using a LLM.""" + + self.context.logger.info(f"Summarizing text: {text}") + + llm_dialogues = cast(LlmDialogues, self.context.llm_dialogues) + + # llm request message + request_llm_message, llm_dialogue = llm_dialogues.create( + counterparty=str(LLM_CONNECTION_PUBLIC_ID), + performative=LlmMessage.Performative.REQUEST, + prompt_template=tweet_summarizer_prompt.replace("{user_tweets}", text), + prompt_values={}, + ) + request_llm_message = cast(LlmMessage, request_llm_message) + llm_dialogue = cast(LlmDialogue, llm_dialogue) + llm_response_message = yield from self._do_request( + request_llm_message, llm_dialogue + ) + data = llm_response_message.value + self.openai_calls.increase_call_count() + self.context.logger.info(f"Got summary: {repr(data)}") + summary = parse_summary(data) + return summary + + def _do_request( + self, + llm_message: LlmMessage, + llm_dialogue: LlmDialogue, + timeout: Optional[float] = None, + ) -> Generator[None, None, LlmMessage]: + """ + Do a request and wait the response, asynchronously. + + :param llm_message: The request message + :param llm_dialogue: the HTTP dialogue associated to the request + :param timeout: seconds to wait for the reply. + :yield: LLMMessage object + :return: the response message + """ + self.context.outbox.put_message(message=llm_message) + request_nonce = self._get_request_nonce_from_dialogue(llm_dialogue) + cast(Requests, self.context.requests).request_id_to_callback[ + request_nonce + ] = self.get_callback_request() + # notify caller by propagating potential timeout exception. + response = yield from self.wait_for_message(timeout=timeout) + return response + + +class TwitterScoringRoundBehaviour(AbstractRoundBehaviour): + """TwitterScoringRoundBehaviour""" + + initial_behaviour_cls = TweetCollectionBehaviour + abci_app_cls = TwitterScoringAbciApp # type: ignore + behaviours: Set[Type[BaseBehaviour]] = [ + TwitterDecisionMakingBehaviour, + OpenAICallCheckBehaviour, + TweetCollectionBehaviour, + TweetEvaluationBehaviour, + TwitterRandomnessBehaviour, + TwitterSelectKeepersBehaviour, + ] diff --git a/packages/valory/skills/olas_week_abci/ceramic_db.py b/packages/valory/skills/olas_week_abci/ceramic_db.py new file mode 100644 index 00000000..2980d0bd --- /dev/null +++ b/packages/valory/skills/olas_week_abci/ceramic_db.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package implements user db handling.""" + +import itertools +import json +from typing import Any, Dict, List, Optional, Tuple + + +class CeramicDB: + """A class that represents the user database""" + + USER_FIELDS = { + "twitter_id", + "twitter_handle", + "discord_id", + "discord_handle", + "wallet_address", + "token_id", + "points", + "current_period_points", + } + + def __init__( + self, + data: Optional[Dict] = None, + logger: Optional[Any] = None, + ) -> None: + """Create a database""" + self.data = ( + data + if data not in (None, {}) + else { + "users": [], + "module_data": { + "twitter": { + "latest_mention_tweet_id": 0, + "current_period": "1970-01-01", + }, + "dynamic_nft": {}, + "generic": {"latest_update_id": 0}, + }, + } + ) + + self.logger = logger + if self.logger: + self.logger.info("DB: created new db") + + def create_user(self, user_data): + """Create a new user""" + + fields = self.USER_FIELDS.union(user_data.keys()) + + new_user = { + field: user_data.get( + field, 0 if field in ("points", "current_period_points") else None + ) + for field in fields + } + + self.data["users"].append(new_user) + + if self.logger: + self.logger.info(f"DB: created new user: {new_user}") # pragma: nocover + + def get_user_by_field(self, field, value) -> Tuple[Optional[Dict], Optional[int]]: + """Search users""" + + for index, user in enumerate(self.data["users"]): + if user[field] == value: + return user, index # returns the first user that marches + + return None, None + + def get_users_by_field(self, field, value) -> List[Tuple[Dict, int]]: + """Search users""" + users = [] + for index, user in enumerate(self.data["users"]): + if user[field] == value: + users.append((user, index)) + return users + + def update_or_create_user(self, field: str, value: str, new_data: Dict): + """Update an existing user""" + user, index = self.get_user_by_field(field, value) + + if user is None or index is None: + self.create_user({field: value, **new_data}) + return + + fields = set(user).union(new_data.keys()) + + updated_user = { + field: new_data.get(field, user.get(field)) + if field != "points" + else user["points"] + new_data.get("points", 0) + for field in fields + } + + if self.logger: + self.logger.info( + f"DB: updated user: from {json.dumps(user, sort_keys=True)} to {json.dumps(updated_user, sort_keys=True)}" + ) + + self.data["users"][index] = updated_user + + def merge_by_wallet(self): + """Merges users that share the wallet""" + wallet_addresses = set( + [ + user["wallet_address"] + for user in self.data["users"] + if user["wallet_address"] + ] + ) + + for wallet_address in wallet_addresses: + users = self.get_users_by_field("wallet_address", wallet_address) + + if len(users) > 1: + # Get the set of fields + fields = set(itertools.chain(*[list(user.keys()) for user, _ in users])) + fields.remove( + "wallet_address" + ) # we already know this one is duplicated + + # Build the merged user + merged_user = {} + for field in fields: + # Get all the non None values from all users + values = [ + user[field] + for user, _ in users + if field in user and user[field] is not None + ] + + # Points must be added + if field == "points": + values = [sum(values)] + + # We just keep the max current_period_points + if field == "current_period_points": + values = [max(values)] + + # Check whether all values are the same + if len(values) > 1: + values = ( + [values[0]] + if all([v == values[0] for v in values]) + else values + ) + + # Raise on multiple different valid values + if len(values) > 1: + raise ValueError( + f"DB: multiple valid values found for {field} [{values}] while merging users: {users}" + ) + merged_user[field] = values[0] if values else None + merged_user["wallet_address"] = wallet_address + + # Remove duplicated users + for index in sorted([index for _, index in users], reverse=True): + self.data["users"].pop(index) + + # Add merged user + self.data["users"].append(merged_user) diff --git a/packages/valory/skills/olas_week_abci/dialogues.py b/packages/valory/skills/olas_week_abci/dialogues.py new file mode 100644 index 00000000..86faa299 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/dialogues.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the dialogues of the TwitterScoringAbciApp.""" + +from typing import Any + +from aea.protocols.base import Address, Message +from aea.protocols.dialogue.base import Dialogue as BaseDialogue +from aea.skills.base import Model + +from packages.valory.protocols.llm.dialogues import LlmDialogue as BaseLlmDialogue +from packages.valory.protocols.llm.dialogues import LlmDialogues as BaseLlmDialogues +from packages.valory.skills.abstract_round_abci.dialogues import ( + AbciDialogue as BaseAbciDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + AbciDialogues as BaseAbciDialogues, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + ContractApiDialogue as BaseContractApiDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + ContractApiDialogues as BaseContractApiDialogues, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + HttpDialogue as BaseHttpDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + HttpDialogues as BaseHttpDialogues, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + LedgerApiDialogue as BaseLedgerApiDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + LedgerApiDialogues as BaseLedgerApiDialogues, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + SigningDialogue as BaseSigningDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + SigningDialogues as BaseSigningDialogues, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + TendermintDialogue as BaseTendermintDialogue, +) +from packages.valory.skills.abstract_round_abci.dialogues import ( + TendermintDialogues as BaseTendermintDialogues, +) + + +AbciDialogue = BaseAbciDialogue +AbciDialogues = BaseAbciDialogues + + +HttpDialogue = BaseHttpDialogue +HttpDialogues = BaseHttpDialogues + + +SigningDialogue = BaseSigningDialogue +SigningDialogues = BaseSigningDialogues + + +LedgerApiDialogue = BaseLedgerApiDialogue +LedgerApiDialogues = BaseLedgerApiDialogues + + +ContractApiDialogue = BaseContractApiDialogue +ContractApiDialogues = BaseContractApiDialogues + + +TendermintDialogue = BaseTendermintDialogue +TendermintDialogues = BaseTendermintDialogues + +LlmDialogue = BaseLlmDialogue + + +class LlmDialogues(Model, BaseLlmDialogues): + """A class to keep track of LLM dialogues.""" + + def __init__(self, **kwargs: Any) -> None: + """ + Initialize dialogues. + + :param kwargs: keyword arguments + """ + Model.__init__(self, **kwargs) + + def role_from_first_message( # pylint: disable=unused-argument + message: Message, receiver_address: Address + ) -> BaseDialogue.Role: + """Infer the role of the agent from an incoming/outgoing first message + + :param message: an incoming/outgoing first message + :param receiver_address: the address of the receiving agent + :return: The role of the agent + """ + return LlmDialogue.Role.SKILL + + BaseLlmDialogues.__init__( + self, + self_address=str(self.skill_id), + role_from_first_message=role_from_first_message, + ) diff --git a/packages/valory/skills/olas_week_abci/fsm_specification.yaml b/packages/valory/skills/olas_week_abci/fsm_specification.yaml new file mode 100644 index 00000000..2c6fa6ba --- /dev/null +++ b/packages/valory/skills/olas_week_abci/fsm_specification.yaml @@ -0,0 +1,70 @@ +alphabet_in: +- API_ERROR +- DB_UPDATE +- DONE +- DONE_API_LIMITS +- DONE_MAX_RETRIES +- DONE_SKIP +- EVALUATE +- NO_ALLOWANCE +- NO_MAJORITY +- OPENAI_CALL_CHECK +- RETRIEVE_TWEETS +- RETRIEVE_MENTIONS +- ROUND_TIMEOUT +- SELECT_KEEPERS +- TWEET_EVALUATION_ROUND_TIMEOUT +default_start_state: TwitterDecisionMakingRound +final_states: +- FinishedTwitterScoringRound +label: TwitterScoringAbciApp +start_states: +- TwitterDecisionMakingRound +states: +- DBUpdateRound +- FinishedTwitterScoringRound +- OpenAICallCheckRound +- TweetEvaluationRound +- TwitterDecisionMakingRound +- TwitterHashtagsCollectionRound +- TwitterMentionsCollectionRound +- TwitterRandomnessRound +- TwitterSelectKeepersRound +transition_func: + (DBUpdateRound, DONE): TwitterDecisionMakingRound + (DBUpdateRound, NO_MAJORITY): DBUpdateRound + (DBUpdateRound, ROUND_TIMEOUT): DBUpdateRound + (OpenAICallCheckRound, DONE): TwitterDecisionMakingRound + (OpenAICallCheckRound, NO_ALLOWANCE): TwitterDecisionMakingRound + (OpenAICallCheckRound, NO_MAJORITY): OpenAICallCheckRound + (OpenAICallCheckRound, ROUND_TIMEOUT): OpenAICallCheckRound + (TweetEvaluationRound, DONE): TwitterDecisionMakingRound + (TweetEvaluationRound, TWEET_EVALUATION_ROUND_TIMEOUT): TweetEvaluationRound + (TwitterDecisionMakingRound, DB_UPDATE): DBUpdateRound + (TwitterDecisionMakingRound, DONE): FinishedTwitterScoringRound + (TwitterDecisionMakingRound, DONE_SKIP): FinishedTwitterScoringRound + (TwitterDecisionMakingRound, EVALUATE): TweetEvaluationRound + (TwitterDecisionMakingRound, NO_MAJORITY): TwitterDecisionMakingRound + (TwitterDecisionMakingRound, OPENAI_CALL_CHECK): OpenAICallCheckRound + (TwitterDecisionMakingRound, RETRIEVE_TWEETS): TwitterHashtagsCollectionRound + (TwitterDecisionMakingRound, RETRIEVE_MENTIONS): TwitterMentionsCollectionRound + (TwitterDecisionMakingRound, ROUND_TIMEOUT): TwitterDecisionMakingRound + (TwitterDecisionMakingRound, SELECT_KEEPERS): TwitterRandomnessRound + (TwitterHashtagsCollectionRound, API_ERROR): TwitterHashtagsCollectionRound + (TwitterHashtagsCollectionRound, DONE): TwitterDecisionMakingRound + (TwitterHashtagsCollectionRound, DONE_API_LIMITS): TwitterDecisionMakingRound + (TwitterHashtagsCollectionRound, DONE_MAX_RETRIES): TwitterDecisionMakingRound + (TwitterHashtagsCollectionRound, NO_MAJORITY): TwitterRandomnessRound + (TwitterHashtagsCollectionRound, ROUND_TIMEOUT): TwitterRandomnessRound + (TwitterMentionsCollectionRound, API_ERROR): TwitterMentionsCollectionRound + (TwitterMentionsCollectionRound, DONE): TwitterDecisionMakingRound + (TwitterMentionsCollectionRound, DONE_API_LIMITS): TwitterDecisionMakingRound + (TwitterMentionsCollectionRound, DONE_MAX_RETRIES): TwitterDecisionMakingRound + (TwitterMentionsCollectionRound, NO_MAJORITY): TwitterRandomnessRound + (TwitterMentionsCollectionRound, ROUND_TIMEOUT): TwitterRandomnessRound + (TwitterRandomnessRound, DONE): TwitterSelectKeepersRound + (TwitterRandomnessRound, NO_MAJORITY): TwitterRandomnessRound + (TwitterRandomnessRound, ROUND_TIMEOUT): TwitterRandomnessRound + (TwitterSelectKeepersRound, DONE): TwitterDecisionMakingRound + (TwitterSelectKeepersRound, NO_MAJORITY): TwitterRandomnessRound + (TwitterSelectKeepersRound, ROUND_TIMEOUT): TwitterRandomnessRound diff --git a/packages/valory/skills/olas_week_abci/handlers.py b/packages/valory/skills/olas_week_abci/handlers.py new file mode 100644 index 00000000..c61f9336 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/handlers.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the handlers for the skill of TwitterScoringAbciApp.""" + +from typing import Optional + +from aea.configurations.data_types import PublicId + +from packages.valory.protocols.llm import LlmMessage +from packages.valory.skills.abstract_round_abci.handlers import ( + ABCIRoundHandler as BaseABCIRoundHandler, +) +from packages.valory.skills.abstract_round_abci.handlers import AbstractResponseHandler +from packages.valory.skills.abstract_round_abci.handlers import ( + ContractApiHandler as BaseContractApiHandler, +) +from packages.valory.skills.abstract_round_abci.handlers import ( + HttpHandler as BaseHttpHandler, +) +from packages.valory.skills.abstract_round_abci.handlers import ( + LedgerApiHandler as BaseLedgerApiHandler, +) +from packages.valory.skills.abstract_round_abci.handlers import ( + SigningHandler as BaseSigningHandler, +) +from packages.valory.skills.abstract_round_abci.handlers import ( + TendermintHandler as BaseTendermintHandler, +) + + +ABCIRoundHandler = BaseABCIRoundHandler +HttpHandler = BaseHttpHandler +SigningHandler = BaseSigningHandler +LedgerApiHandler = BaseLedgerApiHandler +ContractApiHandler = BaseContractApiHandler +TendermintHandler = BaseTendermintHandler + + +class LlmHandler(AbstractResponseHandler): + """A class for handling LLLM messages.""" + + SUPPORTED_PROTOCOL: Optional[PublicId] = LlmMessage.protocol_id + allowed_response_performatives = frozenset( + { + LlmMessage.Performative.REQUEST, + LlmMessage.Performative.RESPONSE, + } + ) diff --git a/packages/valory/skills/olas_week_abci/models.py b/packages/valory/skills/olas_week_abci/models.py new file mode 100644 index 00000000..9266362b --- /dev/null +++ b/packages/valory/skills/olas_week_abci/models.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the shared state for the abci skill of TwitterScoringAbciApp.""" + +from datetime import datetime +from typing import Any + +from packages.valory.skills.abstract_round_abci.models import ApiSpecs, BaseParams +from packages.valory.skills.abstract_round_abci.models import ( + BenchmarkTool as BaseBenchmarkTool, +) +from packages.valory.skills.abstract_round_abci.models import Requests as BaseRequests +from packages.valory.skills.abstract_round_abci.models import ( + SharedState as BaseSharedState, +) +from packages.valory.skills.olas_week_abci.rounds import TwitterScoringAbciApp + + +class SharedState(BaseSharedState): + """Keep the current shared state of the skill.""" + + abci_app_cls = TwitterScoringAbciApp + + +class RandomnessApi(ApiSpecs): + """A model that wraps ApiSpecs for randomness api specifications.""" + + +class OpenAICalls: + """OpenAI call window.""" + + def __init__( + self, + openai_call_window_size: float, + openai_calls_allowed_in_window: int, + ) -> None: + """Initialize object.""" + self._calls_made_in_window = 0 + self._calls_allowed_in_window = openai_calls_allowed_in_window + self._call_window_size = openai_call_window_size + self._call_window_start = datetime.now().timestamp() + + def increase_call_count(self) -> None: + """Increase call count.""" + self._calls_made_in_window += 1 + + def has_window_expired(self, current_time: float) -> bool: + """Increase tweet count.""" + return current_time > (self._call_window_start + self._call_window_size) + + def max_calls_reached(self) -> bool: + """Increase tweet count.""" + return self._calls_made_in_window >= self._calls_allowed_in_window + + def reset(self, current_time: float) -> None: + """Reset the window if required..""" + if not self.has_window_expired(current_time=current_time): + return + self._calls_made_in_window = 0 + self._call_window_start = current_time + + +class Params(BaseParams): + """Parameters.""" + + def __init__(self, *args: Any, **kwargs: Any) -> None: + """Initialize the parameters object.""" + self.twitter_api_base = self._ensure("twitter_api_base", kwargs, str) + self.twitter_api_bearer_token = self._ensure( + "twitter_api_bearer_token", kwargs, str + ) + self.twitter_tweets_endpoint = self._ensure( + "twitter_tweets_endpoint", kwargs, str + ) + self.twitter_tweets_args = self._ensure("twitter_tweets_args", kwargs, str) + self.twitter_max_pages = self._ensure("twitter_max_pages", kwargs, int) + self.tweet_evaluation_round_timeout = self._ensure( + "tweet_evaluation_round_timeout", kwargs, float + ) + self.max_tweet_pulls_allowed = self._ensure( + "max_tweet_pulls_allowed", kwargs, int + ) + self.openai_call_window_size = self._ensure( + "openai_call_window_size", kwargs, float + ) + self.openai_calls_allowed_in_window = self._ensure( + "openai_calls_allowed_in_window", kwargs, int + ) + self.openai_calls = OpenAICalls( + openai_call_window_size=self.openai_call_window_size, + openai_calls_allowed_in_window=self.openai_calls_allowed_in_window, + ) + super().__init__(*args, **kwargs) + + +Requests = BaseRequests +BenchmarkTool = BaseBenchmarkTool diff --git a/packages/valory/skills/olas_week_abci/payloads.py b/packages/valory/skills/olas_week_abci/payloads.py new file mode 100644 index 00000000..3f9af073 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/payloads.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This module contains the transaction payloads of the TwitterScoringAbciApp.""" + +from dataclasses import dataclass +from typing import Optional + +from packages.valory.skills.abstract_round_abci.base import BaseTxPayload + + +@dataclass(frozen=True) +class TwitterDecisionMakingPayload(BaseTxPayload): + """Represent a transaction payload for the TwitterDecisionMakingRound.""" + + event: str + + +@dataclass(frozen=True) +class OpenAICallCheckPayload(BaseTxPayload): + """Represent a transaction payload for the OpenAICallCheckRound.""" + + content: Optional[str] + + +@dataclass(frozen=True) +class TwitterRandomnessPayload(BaseTxPayload): + """Represent a transaction payload of type 'randomness'.""" + + round_id: int + randomness: str + + +@dataclass(frozen=True) +class TwitterSelectKeepersPayload(BaseTxPayload): + """Represent a transaction payload of type 'select_keeper'.""" + + keepers: str + + +@dataclass(frozen=True) +class TweetCollectionPayload(BaseTxPayload): + """Represent a transaction payload for the TweetCollectionRound.""" + + content: str + + +@dataclass(frozen=True) +class TweetEvaluationPayload(BaseTxPayload): + """Represent a transaction payload for the TweetEvaluationRound.""" + + content: str diff --git a/packages/valory/skills/olas_week_abci/prompts.py b/packages/valory/skills/olas_week_abci/prompts.py new file mode 100644 index 00000000..fc14f8aa --- /dev/null +++ b/packages/valory/skills/olas_week_abci/prompts.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package contains LLM prompts for TwitterScoringAbciApp.""" + +tweet_summarizer_prompt = """ +You are an AI tweet summarizer that needs to create concise pieces of content using tweets from your users. These users will write about what happened during the last week in Autonolas, a web3 protocol focused on building decentralized autonomous services. Your task is to summarize all the content from your users in a few short paragraphs that tells the story of what happened during the last week in the Autonolas protocol. You will be given a text about Autonolas as well as the user tweets. + +GOALS: + +1. Summarize the user tweets in the context of what happened during last week in the Autonolas space + +For the given goal, only respond with a short summary of all the Autonolas news. + +Autonolas text: + +Technical Architecture: +Autonolas autonomous software services are embodied as agent services, which are groups of independent computer programs that interact with each other to achieve a predetermined goal. They can be understood as logically centralized applications (with only one application state and logic) that are replicated in a distributed system. Agent services are made of code components that can be combined like Lego bricks through software composition. This is enabled and incentivized by the on-chain protocol, which facilitates developers publishing and finding code components to build and extend new services. The on-chain protocol implements registries that enable code components, agents, and services to be found, reused, and economically compensated. + +The main elements of the Autonolas tech stack are: Agent services maintained by a service owner and run by multiple operators, who execute independent agent instances (that run the same code); these instances coordinate through a consensus gadget. Composable autonomous apps built out of basic applications that are easily extendable and composable into higher-order applications. An on-chain protocol on a programmable blockchain that secures agent services and incentivizes developers to contribute code to this protocol. + +Tokenomics: +Autonolas tokenomics focuses on three objectives: + +1/ Growing capital and code proportionally: On-chain mechanisms ensure that the code provided by developers is rewarded according to its usefulness to the services operated on the protocol. The protocol acquires protocol-owned liquidity (PoL) in proportion to code usefulness, allowing the protocol to generate returns, invest in services, and guarantee its long-term financial health. + +2/ Enabling intra- and inter-protocol composability: NFTs representing code and services are used to track contributions inside the protocol, accrue rewards, and can be used productively as collateral across DeFi. + +3/ Incentivizing the donation of profits from Protocol-owned Services (PoSe): Autonomous services owned by governance of various DAOs, operated by the ecosystem, and developed by agent developers worldwide donate some of their profits to the protocol. + +Use Cases for Autonomous Services: +A large market for autonomous agent services is emerging, primarily focused on improving DAO operations. Autonomous services make DAOs more competitive by providing richer means for transparently coordinating human actors and executing processes with little or no marginal human input. Autonomous services can be composed of three fundamental Lego blocks: Keepers, Oracles, and Bridges. + +This composability leads to combinatorial expansion and unprecedented new applications. + +Governance: +A crucial element of the success of Autonolas is to have an active community and ecosystem that both build, evolve, promote, and make use of Autonolas technology. For this reason, Autonolas is organized as a DAO where meaningful contributors and supporters participate in the decision-making process. + +Initially, holders of the virtualized veOLAS token can participate in any governance activities. The veOLAS token is obtained by locking OLAS, which is the native token of Autonolas. Governance participation is proportional to veOLAS holdings and their locking duration. Governance proposals can notably modify system parameters, support new technological directions, or add entirely new functionality to the on-chain protocol. + +Once a governance proposal is approved, the Timelock adds a delay for the proposal to be executed. + +Exceptionally, some changes to the Autonolas on-chain protocol could be executed by a community-owned multi-sig wallet, bypassing the governance process. + +This allows a set of trusted actors to overrule governance in certain aspects, e.g., a security exploit that needs to be patched without governance discussion. + +User tweets: +{user_tweets} +""" diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py new file mode 100644 index 00000000..ed2a39f5 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -0,0 +1,484 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package contains the rounds of TwitterScoringAbciApp.""" + +import json +import math +import statistics +from enum import Enum +from typing import Any, Dict, FrozenSet, Optional, Set, Tuple, cast + +from packages.valory.skills.abstract_round_abci.base import ( + ABCIAppInternalError, + AbciApp, + AbciAppTransitionFunction, + AppState, + BaseSynchronizedData, + OnlyKeeperSends, + CollectSameUntilThresholdRound, + DegenerateRound, + EventToTimeout, + get_name, +) +from packages.valory.skills.olas_week_abci.payloads import ( + OpenAICallCheckPayload, + TweetEvaluationPayload, + TwitterDecisionMakingPayload, + TweetCollectionPayload, + TwitterRandomnessPayload, + TwitterSelectKeepersPayload, +) + + +MAX_API_RETRIES = 1 +ERROR_GENERIC = "generic" +ERROR_API_LIMITS = "too many requests" + + +class Event(Enum): + """TwitterScoringAbciApp Events""" + + DONE = "done" + DONE_SKIP = "done_skip" + DONE_MAX_RETRIES = "done_max_retries" + DONE_API_LIMITS = "done_api_limits" + NO_MAJORITY = "no_majority" + ROUND_TIMEOUT = "round_timeout" + OPENAI_CALL_CHECK = "openai_call_check" + NO_ALLOWANCE = "no_allowance" + SELECT_KEEPERS = "select_keepers" + RETRIEVE_TWEETS = "retrieve_tweets" + TWEET_EVALUATION_ROUND_TIMEOUT = "tweet_evaluation_round_timeout" + API_ERROR = "api_error" + EVALUATE = "evaluate" + + + +class SynchronizedData(BaseSynchronizedData): + """ + Class to represent the synchronized data. + + This data is replicated by the tendermint application. + """ + + @property + def ceramic_db(self) -> dict: + """Get the data stored in the main stream.""" + return cast(dict, self.db.get_strict("ceramic_db")) + + @property + def pending_write(self) -> bool: + """Checks whether there are changes pending to be written to Ceramic.""" + return cast(bool, self.db.get("pending_write", False)) + + @property + def api_retries(self) -> int: + """Gets the number of API retries.""" + return cast(int, self.db.get("api_retries", 0)) + + @property + def sleep_until(self) -> Optional[int]: + """Gets the timestamp of the next Twitter time window for rate limits.""" + return cast(int, self.db.get("sleep_until", None)) + + @property + def weekly_tweets(self) -> list: + """Get the weekly_tweets.""" + return cast(list, self.db.get("weekly_tweets", [])) + + @property + def summary_tweets(self) -> list: + """Get the summary_tweets.""" + return cast(list, self.db.get("summary_tweets", [])) + + @property + def number_of_tweets_pulled_today(self) -> dict: + """Get the number_of_tweets_pulled_today.""" + return cast(dict, self.db.get("number_of_tweets_pulled_today", None)) + + @property + def last_tweet_pull_window_reset(self) -> dict: + """Get the last_tweet_pull_window_reset.""" + return cast(dict, self.db.get("last_tweet_pull_window_reset", None)) + + @property + def performed_olas_week_tasks(self) -> dict: + """Get the twitter_tasks.""" + return cast(dict, self.db.get("performed_olas_week_tasks", {})) + + @property + def most_voted_keeper_addresses(self) -> list: + """Get the most_voted_keeper_addresses.""" + return cast(list, self.db.get_strict("most_voted_keeper_addresses")) + + @property + def are_keepers_set(self) -> bool: + """Check whether keepers are set.""" + return self.db.get("most_voted_keeper_addresses", None) is not None + + +class TwitterDecisionMakingRound(CollectSameUntilThresholdRound): + """TwitterDecisionMakingRound""" + + payload_class = TwitterDecisionMakingPayload + synchronized_data_class = SynchronizedData + + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: + """Process the end of the block.""" + if self.threshold_reached: + event = Event(self.most_voted_payload) + # Reference events to avoid tox -e check-abciapp-specs failures + # Event.DONE, Event.DB_UPDATE, Event.RETRIEVE_MENTIONS, Event.RETRIEVE_TWEETS, Event.OPENAI_CALL_CHECK, Event.EVALUATE, Event.DONE_SKIP, Event.SELECT_KEEPERS + return self.synchronized_data, event + if not self.is_majority_possible( + self.collection, self.synchronized_data.nb_participants + ): + return self.synchronized_data, Event.NO_MAJORITY + return None + + +class OpenAICallCheckRound(CollectSameUntilThresholdRound): + """OpenAICallCheckRound""" + + payload_class = OpenAICallCheckPayload + synchronized_data_class = SynchronizedData + + CALLS_REMAINING = "CALLS_REMAINING" + + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: + """Process the end of the block.""" + if self.threshold_reached: + performed_olas_week_tasks = cast( + SynchronizedData, self.synchronized_data + ).performed_olas_week_tasks + + # Happy path + if self.most_voted_payload == self.CALLS_REMAINING: + performed_olas_week_tasks["openai_call_check"] = Event.DONE.value + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks + }, + ) + return synchronized_data, Event.DONE + + # No allowance + performed_olas_week_tasks["openai_call_check"] = Event.NO_ALLOWANCE.value + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks + }, + ) + return synchronized_data, Event.NO_ALLOWANCE + if not self.is_majority_possible( + self.collection, self.synchronized_data.nb_participants + ): + return self.synchronized_data, Event.NO_MAJORITY + return None + + +class TweetCollectionRound(CollectSameUntilThresholdRound): + """TwitterMentionsCollectionRound""" + + payload_class = TweetCollectionPayload + synchronized_data_class = SynchronizedData + + @property + def consensus_threshold(self): + """Consensus threshold""" + return math.ceil(self.synchronized_data.nb_participants / 2) # half or 1 + + @property + def threshold_reached( + self, + ) -> bool: + """Check if the threshold has been reached.""" + counts = self.payload_values_count.values() + return any(count >= self.consensus_threshold for count in counts) + + @property + def most_voted_payload_values( + self, + ) -> Tuple[Any, ...]: + """Get the most voted payload values.""" + most_voted_payload_values, max_votes = self.payload_values_count.most_common()[ + 0 + ] + if max_votes < self.consensus_threshold: + raise ABCIAppInternalError("not enough votes") + return most_voted_payload_values + + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: + """Process the end of the block.""" + if self.threshold_reached: + performed_olas_week_tasks = cast( + SynchronizedData, self.synchronized_data + ).performed_olas_week_tasks + + payload = json.loads(self.most_voted_payload) + + # API error + if "error" in payload: + + # API limits + if payload["error"] == ERROR_API_LIMITS: + performed_olas_week_tasks[ + "retrieve_mentions" + ] = Event.DONE_MAX_RETRIES.value + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.sleep_until): payload[ + "sleep_until" + ], + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks, + }, + ) + return synchronized_data, Event.DONE_API_LIMITS + + api_retries = ( + cast(SynchronizedData, self.synchronized_data).api_retries + 1 + ) + + # Other API errors + if api_retries >= MAX_API_RETRIES: + performed_olas_week_tasks[ + "retrieve_mentions" + ] = Event.DONE_MAX_RETRIES.value + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.api_retries): 0, # reset retries + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks, + get_name(SynchronizedData.sleep_until): payload[ + "sleep_until" + ], + }, + ) + return self.synchronized_data, Event.DONE_MAX_RETRIES + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.api_retries): api_retries, + get_name(SynchronizedData.sleep_until): payload["sleep_until"], + }, + ) + return synchronized_data, Event.API_ERROR + + # Happy path + weekly_tweets = cast(SynchronizedData, self.synchronized_data).tweets + performed_olas_week_tasks["retrieve_mentions"] = Event.DONE.value + + updates = { + get_name(SynchronizedData.weekly_tweets): weekly_tweets, + get_name(SynchronizedData.number_of_tweets_pulled_today): payload[ + "number_of_tweets_pulled_today" + ], + get_name(SynchronizedData.last_tweet_pull_window_reset): payload[ + "last_tweet_pull_window_reset" + ], + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks, + get_name(SynchronizedData.sleep_until): payload["sleep_until"], + } + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **updates, + ) + return synchronized_data, Event.DONE + if not self.is_majority_possible( + self.collection, self.synchronized_data.nb_participants + ): + return self.synchronized_data, Event.NO_MAJORITY + return None + + +class TweetEvaluationRound(OnlyKeeperSends): + """TweetEvaluationRound""" + + payload_class = TweetEvaluationPayload + synchronized_data_class = SynchronizedData + + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: + """Process the end of the block.""" + if self.keeper_payload is None: + return None + + performed_olas_week_tasks = cast( + SynchronizedData, self.synchronized_data + ).performed_olas_week_tasks + performed_olas_week_tasks["evaluate"] = Event.DONE.value + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.summary_tweets): self.keeper_payload["summary_tweets"], + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks, + }, + ) + + return synchronized_data, Event.DONE + + +class TwitterRandomnessRound(CollectSameUntilThresholdRound): + """A round for generating randomness""" + + payload_class = TwitterRandomnessPayload + synchronized_data_class = SynchronizedData + done_event = Event.DONE + no_majority_event = Event.NO_MAJORITY + collection_key = get_name(SynchronizedData.participant_to_randomness) + selection_key = ( + get_name(SynchronizedData.most_voted_randomness), + get_name(SynchronizedData.most_voted_randomness), + ) + + +class TwitterSelectKeepersRound(CollectSameUntilThresholdRound): + """A round in which a keeper is selected for transaction submission""" + + payload_class = TwitterSelectKeepersPayload + synchronized_data_class = SynchronizedData + + def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: + """Process the end of the block.""" + if self.threshold_reached: + + performed_olas_week_tasks = cast( + SynchronizedData, self.synchronized_data + ).performed_olas_week_tasks + performed_olas_week_tasks["select_keepers"] = Event.DONE.value + + synchronized_data = self.synchronized_data.update( + synchronized_data_class=SynchronizedData, + **{ + get_name(SynchronizedData.most_voted_keeper_addresses): json.loads( + self.most_voted_payload + ), + get_name( + SynchronizedData.performed_olas_week_tasks + ): performed_olas_week_tasks, + }, + ) + return synchronized_data, Event.DONE + if not self.is_majority_possible( + self.collection, self.synchronized_data.nb_participants + ): + return self.synchronized_data, Event.NO_MAJORITY + return None + + +class FinishedTwitterScoringRound(DegenerateRound): + """FinishedTwitterScoringRound""" + + +class TwitterScoringAbciApp(AbciApp[Event]): + """TwitterScoringAbciApp""" + + initial_round_cls: AppState = TwitterDecisionMakingRound + initial_states: Set[AppState] = {TwitterDecisionMakingRound} + transition_function: AbciAppTransitionFunction = { + TwitterDecisionMakingRound: { + Event.OPENAI_CALL_CHECK: OpenAICallCheckRound, + Event.DONE_SKIP: FinishedTwitterScoringRound, + Event.SELECT_KEEPERS: TwitterRandomnessRound, + Event.RETRIEVE_TWEETS: TweetCollectionRound, + Event.EVALUATE: TweetEvaluationRound, + Event.DONE: FinishedTwitterScoringRound, + Event.ROUND_TIMEOUT: TwitterDecisionMakingRound, + Event.NO_MAJORITY: TwitterDecisionMakingRound, + }, + OpenAICallCheckRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.NO_ALLOWANCE: TwitterDecisionMakingRound, + Event.NO_MAJORITY: OpenAICallCheckRound, + Event.ROUND_TIMEOUT: OpenAICallCheckRound, + }, + TwitterRandomnessRound: { + Event.DONE: TwitterSelectKeepersRound, + Event.NO_MAJORITY: TwitterRandomnessRound, + Event.ROUND_TIMEOUT: TwitterRandomnessRound, + }, + TwitterSelectKeepersRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.NO_MAJORITY: TwitterRandomnessRound, + Event.ROUND_TIMEOUT: TwitterRandomnessRound, + }, + TwitterMentionsCollectionRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound, + Event.DONE_API_LIMITS: TwitterDecisionMakingRound, + Event.API_ERROR: TwitterMentionsCollectionRound, + Event.NO_MAJORITY: TwitterRandomnessRound, + Event.ROUND_TIMEOUT: TwitterRandomnessRound, + }, + TwitterHashtagsCollectionRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound, + Event.DONE_API_LIMITS: TwitterDecisionMakingRound, + Event.API_ERROR: TwitterHashtagsCollectionRound, + Event.NO_MAJORITY: TwitterRandomnessRound, + Event.ROUND_TIMEOUT: TwitterRandomnessRound, + }, + TweetEvaluationRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.TWEET_EVALUATION_ROUND_TIMEOUT: TweetEvaluationRound, + }, + DBUpdateRound: { + Event.DONE: TwitterDecisionMakingRound, + Event.NO_MAJORITY: DBUpdateRound, + Event.ROUND_TIMEOUT: DBUpdateRound, + }, + FinishedTwitterScoringRound: {}, + } + final_states: Set[AppState] = { + FinishedTwitterScoringRound, + } + event_to_timeout: EventToTimeout = { + Event.ROUND_TIMEOUT: 30.0, + Event.TWEET_EVALUATION_ROUND_TIMEOUT: 600.0, + } + cross_period_persisted_keys: FrozenSet[str] = frozenset( + ["ceramic_db", "pending_write", "tweets"] + ) + db_pre_conditions: Dict[AppState, Set[str]] = { + TwitterDecisionMakingRound: set(), + } + db_post_conditions: Dict[AppState, Set[str]] = { + FinishedTwitterScoringRound: { + get_name(SynchronizedData.ceramic_db), + }, + } diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml new file mode 100644 index 00000000..ee6e5303 --- /dev/null +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -0,0 +1,178 @@ +name: olas_week_abci +author: valory +version: 0.1.0 +type: skill +description: A skill that reads mentions from the Twitter API and assigns scores to + the users. +license: Apache-2.0 +aea_version: '>=1.0.0, <2.0.0' +fingerprint: + __init__.py: bafybeifudgakkjoyahuewp2o4gvqayw7nsgpyxw2ayrpgmzexurh2xomaq + behaviours.py: bafybeif7x53ygd3jyoghbnxavzhhdhliaa3mcxe5n5uui3aa6vgd6v5t5e + ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm + dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si + fsm_specification.yaml: bafybeie6k4aanmwcrghspbqywdh2srrudtkhnbbhqm3ovcz5k4fa5dybrq + handlers.py: bafybeid3nqvcyotqj5g5hlgrz57nf7vpjysmgvsxe3p7644f4z5dcwqn6u + models.py: bafybeiajis7l5sv7b3fofuj3ehxai5d2uy6h6p4kabhrekjwkjs77lopxe + payloads.py: bafybeibeqiwnua7uewbv5a7epebshjpueuqpcbw6s2y3u62kasdhiijs5i + prompts.py: bafybeieiuqn427bgwfnzynxf3vtqfpvmqqscs5tyw4oibfofwropifotke + rounds.py: bafybeigtzsvklrwxyah2syrzjruufr6uuninyh6flbrwetcgcb5pl4czra + tests/__init__.py: bafybeidwzzd4ejsyf3aryd5kmrvd63h7ajgqyrxphmfaacvpjnneacejay + tests/test_behaviours.py: bafybeihc732whmbn74oxtrua3c77gt4py4tpc5v3drdhg2xc2lxtcqie4e + tests/test_ceramic_db.py: bafybeif2v7btjphbqabq6qdmfeyweg765seon74acg5vrrvznivzg2prey + tests/test_dialogues.py: bafybeiheyq7klonzb7rnjub2i22h7bmsnoimn2pq4j7ofikt3yovstvgt4 + tests/test_handlers.py: bafybeigevirvi3saepukke2zmp334btgsdxhj55o2vawj3hqam63miirg4 + tests/test_models.py: bafybeihaiirqmcsshghztl5lvqjzem6y6rdeefhtiycrhh45v7cuwnmdz4 + tests/test_payloads.py: bafybeihg7ndxuj4lehpmgpdngpzihhmaiy7u5kaylukneavsklfwki5j6q + tests/test_rounds.py: bafybeibbznfio2tgvgzpc4l3jm6jwzd5ifflzgm6aflurllseeolef3ydm +fingerprint_ignore_patterns: [] +connections: +- valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq +contracts: [] +protocols: +- valory/llm:1.0.0:bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4 +skills: +- valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq +behaviours: + main: + args: {} + class_name: TwitterScoringRoundBehaviour +handlers: + abci: + args: {} + class_name: ABCIRoundHandler + contract_api: + args: {} + class_name: ContractApiHandler + http: + args: {} + class_name: HttpHandler + ledger_api: + args: {} + class_name: LedgerApiHandler + llm: + args: {} + class_name: LlmHandler + signing: + args: {} + class_name: SigningHandler + tendermint: + args: {} + class_name: TendermintHandler +models: + abci_dialogues: + args: {} + class_name: AbciDialogues + benchmark_tool: + args: + log_dir: /logs + class_name: BenchmarkTool + contract_api_dialogues: + args: {} + class_name: ContractApiDialogues + http_dialogues: + args: {} + class_name: HttpDialogues + ledger_api_dialogues: + args: {} + class_name: LedgerApiDialogues + llm_dialogues: + args: {} + class_name: LlmDialogues + params: + args: + multisend_address: '0x0000000000000000000000000000000000000000' + termination_sleep: 900 + cleanup_history_depth: 1 + cleanup_history_depth_current: null + drand_public_key: 868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31 + finalize_timeout: 60.0 + genesis_config: + chain_id: chain-c4daS1 + consensus_params: + block: + max_bytes: '22020096' + max_gas: '-1' + time_iota_ms: '1000' + evidence: + max_age_duration: '172800000000000' + max_age_num_blocks: '100000' + max_bytes: '1048576' + validator: + pub_key_types: + - ed25519 + version: {} + genesis_time: '2022-05-20T16:00:21.735122717Z' + voting_power: '10' + history_check_timeout: 1205 + keeper_allowed_retries: 3 + keeper_timeout: 30.0 + max_attempts: 10 + max_healthcheck: 120 + reset_pause_duration: 10 + on_chain_service_id: null + request_retry_delay: 1.0 + request_timeout: 10.0 + reset_tendermint_after: 2 + retry_attempts: 400 + retry_timeout: 3 + round_timeout_seconds: 30.0 + tweet_evaluation_round_timeout: 600.0 + service_id: score_read + service_registry_address: null + setup: + all_participants: [] + safe_contract_address: '0x0000000000000000000000000000000000000000' + consensus_threshold: null + share_tm_config_on_startup: false + sleep_time: 1 + tendermint_check_sleep_delay: 3 + tendermint_com_url: http://localhost:8080 + tendermint_max_retries: 5 + tendermint_p2p_url: localhost:26656 + tendermint_url: http://localhost:26657 + tx_timeout: 10.0 + twitter_api_base: https://api.twitter.com/ + twitter_api_bearer_token: + twitter_tweets_endpoint: 2/users/1450081635559428107/tweets? + twitter_tweets_args: tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time} + twitter_max_pages: 1 + max_tweet_pulls_allowed: 80 + openai_call_window_size: 3600.0 + openai_calls_allowed_in_window: 100 + max_points_per_period: 5000 + validate_timeout: 1205 + use_termination: false + use_slashing: false + slash_cooldown_hours: 3 + slash_threshold_amount: 10000000000000000 + light_slash_unit_amount: 5000000000000000 + serious_slash_unit_amount: 8000000000000000 + class_name: Params + randomness_api: + args: + api_id: cloudflare + headers: {} + method: GET + parameters: {} + response_key: null + response_type: dict + retries: 5 + url: https://drand.cloudflare.com/public/latest + class_name: RandomnessApi + requests: + args: {} + class_name: Requests + signing_dialogues: + args: {} + class_name: SigningDialogues + state: + args: {} + class_name: SharedState + tendermint_dialogues: + args: {} + class_name: TendermintDialogues +dependencies: + open-aea-web3: + version: ==6.0.1 +is_abstract: true From 573e54364ddc6d80080ab969d01f8c0e6d6198ff Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 19:12:19 +0200 Subject: [PATCH 07/26] feat: week in olas chaining --- .../skills/decision_making_abci/behaviours.py | 12 +++++ .../skills/decision_making_abci/rounds.py | 15 +++++++ .../tasks/task_preparations.py | 20 ++++++++- .../tasks/twitter_preparation.py | 26 +++++++++++ .../tasks/week_in_olas_preparations.py | 45 +++++++++++++++++++ .../impact_evaluator_abci/composition.py | 3 ++ .../valory/skills/olas_week_abci/rounds.py | 33 +++++--------- 7 files changed, 129 insertions(+), 25 deletions(-) create mode 100644 packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py diff --git a/packages/valory/skills/decision_making_abci/behaviours.py b/packages/valory/skills/decision_making_abci/behaviours.py index bddd0ef1..42a3390e 100644 --- a/packages/valory/skills/decision_making_abci/behaviours.py +++ b/packages/valory/skills/decision_making_abci/behaviours.py @@ -51,9 +51,13 @@ from packages.valory.skills.decision_making_abci.tasks.score_preparations import ( ScorePreparation, ) +from packages.valory.skills.decision_making_abci.tasks.week_in_olas_preparations import ( + WeekInOlasCreatePreparation, +) from packages.valory.skills.decision_making_abci.tasks.twitter_preparation import ( DailyTweetPreparation, ScheduledTweetPreparation, + WeekInOlasWritePreparation ) from packages.valory.skills.decision_making_abci.tasks.write_stream_preparation import ( DailyOrbisPreparation, @@ -82,6 +86,14 @@ }, Event.DAILY_ORBIS.value: { "prev": DailyOrbisPreparation, + "next": WeekInOlasCreatePreparation, + }, + Event.WEEK_IN_OLAS_CREATE.value: { + "prev": WeekInOlasCreatePreparation, + "next": WeekInOlasWritePreparation, + }, + Event.WEEK_IN_OLAS_WRITE.value: { + "prev": WeekInOlasWritePreparation, "next": ScheduledTweetPreparation, }, Event.SCHEDULED_TWEET.value: { diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index c11bbbb5..6b29caa8 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -56,6 +56,8 @@ class Event(Enum): READ_CONTRIBUTE_DB = "read_contribute_db" READ_MANUAL_POINTS = "read_manual_points" WRITE_CONTRIBUTE_DB = "write_contribute_db" + WEEK_IN_OLAS_CREATE = "week_in_olas_create" + WEEK_IN_OLAS_WRITE = "week_in_olas_write" class SynchronizedData(BaseSynchronizedData): @@ -145,6 +147,10 @@ def pending_write(self) -> bool: """Checks whether there are changes pending to be written to Ceramic.""" return cast(bool, self.db.get("pending_write", False)) + @property + def weekly_tweets(self) -> list: + """Get the weekly_tweets.""" + return cast(list, self.db.get("weekly_tweets", [])) class DecisionMakingRound(CollectSameUntilThresholdRound): """DecisionMakingRound""" @@ -161,6 +167,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # Event.NO_MAJORITY, Event.DONE, Event.UPDATE_CENTAURS, Event.READ_CENTAURS, # Event.SCHEDULED_TWEET, Event.LLM, Event.DAILY_ORBIS, Event.DAILY_TWEET, Event.NEXT_CENTAUR # Event.SCORE, Event.READ_CONTRIBUTE_DB, Event.READ_MANUAL_POINTS, Event.WRITE_CONTRIBUTE_DB + # Event.WEEK_IN_OLAS payload = json.loads(self.most_voted_payload) event = Event(payload["event"]) @@ -230,6 +237,10 @@ class FinishedDecisionMakingDoneRound(DegenerateRound): """FinishedDecisionMakingDoneRound""" +class FinishedDecisionMakingWeekInOlasRound(DegenerateRound): + """FinishedDecisionMakingWeekInOlasRound""" + + class DecisionMakingAbciApp(AbciApp[Event]): """DecisionMakingAbciApp""" @@ -241,6 +252,8 @@ class DecisionMakingAbciApp(AbciApp[Event]): Event.LLM: FinishedDecisionMakingLLMRound, Event.DAILY_TWEET: FinishedDecisionMakingWriteTwitterRound, Event.SCHEDULED_TWEET: FinishedDecisionMakingWriteTwitterRound, + Event.WEEK_IN_OLAS_CREATE: FinishedDecisionMakingWeekInOlasRound, + Event.WEEK_IN_OLAS_WRITE: FinishedDecisionMakingWriteTwitterRound, Event.DAILY_ORBIS: FinishedDecisionMakingWriteOrbisRound, Event.UPDATE_CENTAURS: FinishedDecisionMakingUpdateCentaurRound, Event.SCORE: FinishedDecisionMakingScoreRound, @@ -262,6 +275,7 @@ class DecisionMakingAbciApp(AbciApp[Event]): FinishedDecisionMakingReadContributeDBRound: {}, FinishedDecisionMakingWriteContributeDBRound: {}, FinishedDecisionMakingReadManualPointsRound: {}, + FinishedDecisionMakingWeekInOlasRound: {}, } final_states: Set[AppState] = { FinishedDecisionMakingReadCentaursRound, @@ -274,6 +288,7 @@ class DecisionMakingAbciApp(AbciApp[Event]): FinishedDecisionMakingReadContributeDBRound, FinishedDecisionMakingWriteContributeDBRound, FinishedDecisionMakingReadManualPointsRound, + FinishedDecisionMakingWeekInOlasRound, } event_to_timeout: EventToTimeout = { Event.ROUND_TIMEOUT: 30.0, diff --git a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py index ba4a5631..c4844ca8 100644 --- a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py +++ b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py @@ -20,6 +20,7 @@ """This package contains the logic for task preparations.""" from datetime import datetime, timezone +SECONDS_IN_DAY = 24 * 3600 class TaskPreparation: """Represents the work required before and after running a Centaur task""" @@ -52,7 +53,8 @@ def set_config(self): if self.task_name in plugins_config: plugin_config = plugins_config[self.task_name] self.enabled = plugin_config["enabled"] - self.daily = plugin_config["daily"] + self.daily = plugin_config["daily"] if "daily" in plugin_config else False + self.weekly = int(plugin_config["weekly"]) if "weekly" in plugin_config else None self.last_run = ( datetime.strptime( plugin_config["last_run"], "%Y-%m-%d %H:%M:%S %Z" @@ -60,7 +62,7 @@ def set_config(self): if self.daily and plugin_config["last_run"] else None ) - self.run_hour_utc = plugin_config["run_hour_utc"] if self.daily else None + self.run_hour_utc = plugin_config["run_hour_utc"] if self.daily or self.weekly else None return self.set_default_config() @@ -69,6 +71,7 @@ def set_default_config(self): """Set the default configuration""" self.enabled = True self.daily = False + self.weekly = None self.last_run = None self.run_hour_utc = None @@ -87,6 +90,19 @@ def check_conditions(self): ) return False + # Does the task run every week? + if self.weekly and self.weekly != self.now_utc.weekday(): + self.logger.info( + f"[{self.__class__.__name__}]: task is a weekly task but today is not the configured run day: {self.now_utc.weekday()} != {self.weekly}" + ) + return False + + if self.weekly and self.last_run and (self.now_utc - self.last_run).seconds < SECONDS_IN_DAY: + self.logger.info( + f"[{self.__class__.__name__}]: task is a weekly task and was already ran less than a day ago" + ) + return False + # Does the task run at a specific time? if self.daily and self.now_utc.hour < self.run_hour_utc: self.logger.info( diff --git a/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py b/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py index b2694c9d..25d8b6cc 100644 --- a/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py +++ b/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py @@ -223,3 +223,29 @@ def check_tweet_consensus(self, voters: dict): """Check whether users agree on posting""" voting_power = sum([int(list(v.values())[0]) for v in voters]) return voting_power >= TWEET_CONSENSUS_WVEOLAS_WEI + + +class WeekInOlasWritePreparation(TwitterPreparation): + """WeekInOlasWritePreparation""" + + task_name = "week_in_olas" + task_event = Event.WEEK_IN_OLAS_WRITE.value + + def get_tweet(self): + """Get the tweet""" + return self.synchronized_data.weekly_tweets + + def _post_task(self): + """Task postprocessing""" + updates, event = super()._post_task() + + # Update the last run time + centaurs_data = updates["centaurs_data"] + current_centaur = centaurs_data[self.synchronized_data.current_centaur_index] + current_centaur["configuration"]["plugins"]["week_in_olas"][ + "last_run" + ] = self.now_utc.strftime("%Y-%m-%d %H:%M:%S %Z") + + updates["centaurs_data"] = centaurs_data + + return updates, event diff --git a/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py new file mode 100644 index 00000000..18b74061 --- /dev/null +++ b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package contains the logic for task preparations.""" +from packages.valory.skills.decision_making_abci.rounds import Event +from packages.valory.skills.decision_making_abci.tasks.task_preparations import ( + TaskPreparation, +) + + +class WeekInOlasCreatePreparation(TaskPreparation): + """WeekInOlasCreatePreparation""" + + task_name = "week_in_olas_create" + task_event = Event.WEEK_IN_OLAS_CREATE.value + + def check_extra_conditions(self): + """Check extra conditions""" + return True + + def _pre_task(self): + """Preparations before running the task""" + updates = {} + return updates, self.task_event + + def _post_task(self): + """Preparations after running the task""" + updates = {} + return updates, None diff --git a/packages/valory/skills/impact_evaluator_abci/composition.py b/packages/valory/skills/impact_evaluator_abci/composition.py index 6132e7c1..57fb0be5 100644 --- a/packages/valory/skills/impact_evaluator_abci/composition.py +++ b/packages/valory/skills/impact_evaluator_abci/composition.py @@ -22,6 +22,7 @@ import packages.valory.skills.ceramic_write_abci.rounds as CeramicWriteAbci import packages.valory.skills.decision_making_abci.rounds as DecisionMakingAbci import packages.valory.skills.dynamic_nft_abci.rounds as DynamicNFTAbci +import packages.valory.skills.olas_week_abci.rounds as WeekInOlasAbci import packages.valory.skills.generic_scoring_abci.rounds as GenericScoringAbci import packages.valory.skills.llm_abci.rounds as LLMAbciApp import packages.valory.skills.registration_abci.rounds as RegistrationAbci @@ -54,8 +55,10 @@ DecisionMakingAbci.FinishedDecisionMakingReadManualPointsRound: CeramicReadAbci.StreamReadRound, DecisionMakingAbci.FinishedDecisionMakingScoreRound: GenericScoringAbci.GenericScoringRound, DecisionMakingAbci.FinishedDecisionMakingDoneRound: ResetAndPauseAbci.ResetAndPauseRound, + DecisionMakingAbci.FinishedDecisionMakingWeekInOlasRound: WeekInOlasAbci.TwitterDecisionMakingRound, GenericScoringAbci.FinishedGenericScoringRound: TwitterScoringAbci.TwitterDecisionMakingRound, TwitterScoringAbci.FinishedTwitterScoringRound: DynamicNFTAbci.TokenTrackRound, + WeekInOlasAbci.FinishedWeekInOlasRound: DecisionMakingAbci.DecisionMakingRound, DynamicNFTAbci.FinishedTokenTrackRound: DecisionMakingAbci.DecisionMakingRound, LLMAbciApp.FinishedLLMRound: DecisionMakingAbci.DecisionMakingRound, TwitterWriteAbciApp.FinishedTwitterWriteRound: DecisionMakingAbci.DecisionMakingRound, diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index ed2a39f5..d193464a 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -401,8 +401,8 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return None -class FinishedTwitterScoringRound(DegenerateRound): - """FinishedTwitterScoringRound""" +class FinishedWeekInOlasRound(DegenerateRound): + """FinishedWeekInOlasRound""" class TwitterScoringAbciApp(AbciApp[Event]): @@ -413,11 +413,11 @@ class TwitterScoringAbciApp(AbciApp[Event]): transition_function: AbciAppTransitionFunction = { TwitterDecisionMakingRound: { Event.OPENAI_CALL_CHECK: OpenAICallCheckRound, - Event.DONE_SKIP: FinishedTwitterScoringRound, + Event.DONE_SKIP: FinishedWeekInOlasRound, Event.SELECT_KEEPERS: TwitterRandomnessRound, Event.RETRIEVE_TWEETS: TweetCollectionRound, Event.EVALUATE: TweetEvaluationRound, - Event.DONE: FinishedTwitterScoringRound, + Event.DONE: FinishedWeekInOlasRound, Event.ROUND_TIMEOUT: TwitterDecisionMakingRound, Event.NO_MAJORITY: TwitterDecisionMakingRound, }, @@ -437,19 +437,11 @@ class TwitterScoringAbciApp(AbciApp[Event]): Event.NO_MAJORITY: TwitterRandomnessRound, Event.ROUND_TIMEOUT: TwitterRandomnessRound, }, - TwitterMentionsCollectionRound: { + TweetCollectionRound: { Event.DONE: TwitterDecisionMakingRound, Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound, Event.DONE_API_LIMITS: TwitterDecisionMakingRound, - Event.API_ERROR: TwitterMentionsCollectionRound, - Event.NO_MAJORITY: TwitterRandomnessRound, - Event.ROUND_TIMEOUT: TwitterRandomnessRound, - }, - TwitterHashtagsCollectionRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound, - Event.DONE_API_LIMITS: TwitterDecisionMakingRound, - Event.API_ERROR: TwitterHashtagsCollectionRound, + Event.API_ERROR: TweetCollectionRound, Event.NO_MAJORITY: TwitterRandomnessRound, Event.ROUND_TIMEOUT: TwitterRandomnessRound, }, @@ -457,28 +449,23 @@ class TwitterScoringAbciApp(AbciApp[Event]): Event.DONE: TwitterDecisionMakingRound, Event.TWEET_EVALUATION_ROUND_TIMEOUT: TweetEvaluationRound, }, - DBUpdateRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.NO_MAJORITY: DBUpdateRound, - Event.ROUND_TIMEOUT: DBUpdateRound, - }, - FinishedTwitterScoringRound: {}, + FinishedWeekInOlasRound: {}, } final_states: Set[AppState] = { - FinishedTwitterScoringRound, + FinishedWeekInOlasRound, } event_to_timeout: EventToTimeout = { Event.ROUND_TIMEOUT: 30.0, Event.TWEET_EVALUATION_ROUND_TIMEOUT: 600.0, } cross_period_persisted_keys: FrozenSet[str] = frozenset( - ["ceramic_db", "pending_write", "tweets"] + ["ceramic_db", "pending_write", "summary_tweets"] ) db_pre_conditions: Dict[AppState, Set[str]] = { TwitterDecisionMakingRound: set(), } db_post_conditions: Dict[AppState, Set[str]] = { - FinishedTwitterScoringRound: { + FinishedWeekInOlasRound: { get_name(SynchronizedData.ceramic_db), }, } From fd5fc010b15cf6aa95b09ffc0cc4a31d235dfa4d Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 19:12:49 +0200 Subject: [PATCH 08/26] fix: formatters --- .../skills/decision_making_abci/behaviours.py | 8 ++++---- .../valory/skills/decision_making_abci/rounds.py | 1 + .../tasks/task_preparations.py | 16 +++++++++++++--- .../skills/impact_evaluator_abci/composition.py | 2 +- .../valory/skills/olas_week_abci/behaviours.py | 7 ++----- packages/valory/skills/olas_week_abci/rounds.py | 4 ++-- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/packages/valory/skills/decision_making_abci/behaviours.py b/packages/valory/skills/decision_making_abci/behaviours.py index 42a3390e..247c4ac7 100644 --- a/packages/valory/skills/decision_making_abci/behaviours.py +++ b/packages/valory/skills/decision_making_abci/behaviours.py @@ -51,13 +51,13 @@ from packages.valory.skills.decision_making_abci.tasks.score_preparations import ( ScorePreparation, ) -from packages.valory.skills.decision_making_abci.tasks.week_in_olas_preparations import ( - WeekInOlasCreatePreparation, -) from packages.valory.skills.decision_making_abci.tasks.twitter_preparation import ( DailyTweetPreparation, ScheduledTweetPreparation, - WeekInOlasWritePreparation + WeekInOlasWritePreparation, +) +from packages.valory.skills.decision_making_abci.tasks.week_in_olas_preparations import ( + WeekInOlasCreatePreparation, ) from packages.valory.skills.decision_making_abci.tasks.write_stream_preparation import ( DailyOrbisPreparation, diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index 6b29caa8..a986533a 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -152,6 +152,7 @@ def weekly_tweets(self) -> list: """Get the weekly_tweets.""" return cast(list, self.db.get("weekly_tweets", [])) + class DecisionMakingRound(CollectSameUntilThresholdRound): """DecisionMakingRound""" diff --git a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py index c4844ca8..1179282f 100644 --- a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py +++ b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py @@ -20,8 +20,10 @@ """This package contains the logic for task preparations.""" from datetime import datetime, timezone + SECONDS_IN_DAY = 24 * 3600 + class TaskPreparation: """Represents the work required before and after running a Centaur task""" @@ -54,7 +56,9 @@ def set_config(self): plugin_config = plugins_config[self.task_name] self.enabled = plugin_config["enabled"] self.daily = plugin_config["daily"] if "daily" in plugin_config else False - self.weekly = int(plugin_config["weekly"]) if "weekly" in plugin_config else None + self.weekly = ( + int(plugin_config["weekly"]) if "weekly" in plugin_config else None + ) self.last_run = ( datetime.strptime( plugin_config["last_run"], "%Y-%m-%d %H:%M:%S %Z" @@ -62,7 +66,9 @@ def set_config(self): if self.daily and plugin_config["last_run"] else None ) - self.run_hour_utc = plugin_config["run_hour_utc"] if self.daily or self.weekly else None + self.run_hour_utc = ( + plugin_config["run_hour_utc"] if self.daily or self.weekly else None + ) return self.set_default_config() @@ -97,7 +103,11 @@ def check_conditions(self): ) return False - if self.weekly and self.last_run and (self.now_utc - self.last_run).seconds < SECONDS_IN_DAY: + if ( + self.weekly + and self.last_run + and (self.now_utc - self.last_run).seconds < SECONDS_IN_DAY + ): self.logger.info( f"[{self.__class__.__name__}]: task is a weekly task and was already ran less than a day ago" ) diff --git a/packages/valory/skills/impact_evaluator_abci/composition.py b/packages/valory/skills/impact_evaluator_abci/composition.py index 57fb0be5..dcc9bb03 100644 --- a/packages/valory/skills/impact_evaluator_abci/composition.py +++ b/packages/valory/skills/impact_evaluator_abci/composition.py @@ -22,9 +22,9 @@ import packages.valory.skills.ceramic_write_abci.rounds as CeramicWriteAbci import packages.valory.skills.decision_making_abci.rounds as DecisionMakingAbci import packages.valory.skills.dynamic_nft_abci.rounds as DynamicNFTAbci -import packages.valory.skills.olas_week_abci.rounds as WeekInOlasAbci import packages.valory.skills.generic_scoring_abci.rounds as GenericScoringAbci import packages.valory.skills.llm_abci.rounds as LLMAbciApp +import packages.valory.skills.olas_week_abci.rounds as WeekInOlasAbci import packages.valory.skills.registration_abci.rounds as RegistrationAbci import packages.valory.skills.reset_pause_abci.rounds as ResetAndPauseAbci import packages.valory.skills.twitter_scoring_abci.rounds as TwitterScoringAbci diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index 5d8432b8..7585f7a3 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -41,10 +41,7 @@ from packages.valory.skills.abstract_round_abci.common import RandomnessBehaviour from packages.valory.skills.abstract_round_abci.models import Requests from packages.valory.skills.olas_week_abci.ceramic_db import CeramicDB -from packages.valory.skills.olas_week_abci.dialogues import ( - LlmDialogue, - LlmDialogues, -) +from packages.valory.skills.olas_week_abci.dialogues import LlmDialogue, LlmDialogues from packages.valory.skills.olas_week_abci.models import ( OpenAICalls, Params, @@ -52,9 +49,9 @@ ) from packages.valory.skills.olas_week_abci.payloads import ( OpenAICallCheckPayload, + TweetCollectionPayload, TweetEvaluationPayload, TwitterDecisionMakingPayload, - TweetCollectionPayload, TwitterRandomnessPayload, TwitterSelectKeepersPayload, ) diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index d193464a..589495a9 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -31,17 +31,17 @@ AbciAppTransitionFunction, AppState, BaseSynchronizedData, - OnlyKeeperSends, CollectSameUntilThresholdRound, DegenerateRound, EventToTimeout, + OnlyKeeperSends, get_name, ) from packages.valory.skills.olas_week_abci.payloads import ( OpenAICallCheckPayload, + TweetCollectionPayload, TweetEvaluationPayload, TwitterDecisionMakingPayload, - TweetCollectionPayload, TwitterRandomnessPayload, TwitterSelectKeepersPayload, ) From 9bd9e7fce860b50dfab1c092ab71879042a39608 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Tue, 10 Oct 2023 19:23:59 +0200 Subject: [PATCH 09/26] fix: linting, hashes --- docs/index.md | 2 +- packages/packages.json | 15 +++++++------ .../agents/impact_evaluator/aea-config.yaml | 8 +++---- .../dynamic_contribution/contract.yaml | 2 +- .../services/impact_evaluator/service.yaml | 2 +- .../impact_evaluator_local/service.yaml | 2 +- .../skills/decision_making_abci/rounds.py | 1 + .../skills/decision_making_abci/skill.yaml | 9 ++++---- .../valory/skills/dynamic_nft_abci/skill.yaml | 2 +- .../skills/impact_evaluator_abci/skill.yaml | 6 ++--- .../valory/skills/olas_week_abci/rounds.py | 4 ++-- .../valory/skills/olas_week_abci/skill.yaml | 22 ++++++------------- 12 files changed, 35 insertions(+), 40 deletions(-) diff --git a/docs/index.md b/docs/index.md index b0ba2415..4ef0293b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeihdjgxxf5ei7hayo5fsigrfg5ktgk2mg7yxzbhfrz4jsxhxce7eny --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeiexypybwtf7ojgfksh2xn7vw2xj3s635xvf4kw5asozlcpqk5mfse --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 7b4b3f25..09cb25d9 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse", - "contract/valory/dynamic_contribution/0.1.0": "bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice", - "service/valory/impact_evaluator/0.1.0": "bafybeihdjgxxf5ei7hayo5fsigrfg5ktgk2mg7yxzbhfrz4jsxhxce7eny", - "skill/valory/dynamic_nft_abci/0.1.0": "bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii", + "agent/valory/impact_evaluator/0.1.0": "bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua", + "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", + "service/valory/impact_evaluator/0.1.0": "bafybeiexypybwtf7ojgfksh2xn7vw2xj3s635xvf4kw5asozlcpqk5mfse", + "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiazjmtdnjzsdj7h6nclzhakffembvmo4a4w2qf46cmikwlmvbfzse", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeigc4ok5nr3cltqfttv3rhwo7n2547x7qa5ynjjvzmlaxjwny4jjna", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,8 +15,9 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeigx57k6zwiatveoiyczbhz6xbdtfhhbxg7442tjqyb7ljjfjusn5e", - "service/valory/impact_evaluator_local/0.1.0": "bafybeigtp55blkwef4bbimmcn7zq2xu77r7rq6katbrr3fsnvfwfuoy6tq" + "skill/valory/decision_making_abci/0.1.0": "bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4", + "service/valory/impact_evaluator_local/0.1.0": "bafybeic4wtm3qlj2d2f5ozy5ycc3qj7qji4whovx4tjskovyfpesudewni", + "skill/valory/olas_week_abci/0.1.0": "bafybeifattcv4fzrjx7mvitvllh3234ddkljbopnhgmfb3d3kwl5b2sfqu" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 2e0ab666..e8f55ddd 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -23,7 +23,7 @@ connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq - valory/twitter:0.1.0:bafybeifm7tpjdd2y5dy5xzuxt3tebyqxmgn56agkqv64nloggqo5cr3sku contracts: -- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice +- valory/dynamic_contribution:0.1.0:bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa - valory/gnosis_safe:0.1.0:bafybeih6d3vxz3jlgodxm5b2qcwsmansqj4xobuyd6hjnhzremuvd65yrm - valory/gnosis_safe_proxy_factory:0.1.0:bafybeid6glyjikjxmefwmhn62cxiofophegjmg2z5vqqsvk6tmyunwc274 - valory/multisend:0.1.0:bafybeieg4tywd5lww2vygvpkilg3hcepa4rmhehjuamyvdf6vazt554v6u @@ -42,18 +42,18 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiazjmtdnjzsdj7h6nclzhakffembvmo4a4w2qf46cmikwlmvbfzse +- valory/impact_evaluator_abci:0.1.0:bafybeigc4ok5nr3cltqfttv3rhwo7n2547x7qa5ynjjvzmlaxjwny4jjna - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii +- valory/dynamic_nft_abci:0.1.0:bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeigx57k6zwiatveoiyczbhz6xbdtfhhbxg7442tjqyb7ljjfjusn5e +- valory/decision_making_abci:0.1.0:bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije default_ledger: ethereum required_ledgers: diff --git a/packages/valory/contracts/dynamic_contribution/contract.yaml b/packages/valory/contracts/dynamic_contribution/contract.yaml index 7417ac80..6cf90ecd 100644 --- a/packages/valory/contracts/dynamic_contribution/contract.yaml +++ b/packages/valory/contracts/dynamic_contribution/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeidk77j5zmvjhf42ie7grv33hzjedgc6vdiwn22uzhlwuo6xh6hmsi build/DynamicContribution.json: bafybeicq5ee4hba3h6tsluzvdrtyvzllpqsseqys66e24bfrpjlegnxome - contract.py: bafybeidiroajv6euw4l2w4qyjgsqvwrktuzoaywjhx5wcqavdrmhvspeue + contract.py: bafybeihe45m6zeuymlanetr6purk4bx6vcxh5efjvn3rteovhexkksdpqy fingerprint_ignore_patterns: [] class_name: DynamicContributionContract contract_interface_paths: diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index f0968355..e4cb93dd 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse +agent: valory/impact_evaluator:0.1.0:bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index de5c923f..2853b76f 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeia57rldya3tts56g3xhzovihzy4vumhzsq4moaloymll72uianyse +agent: valory/impact_evaluator:0.1.0:bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index a986533a..7fc673a5 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -309,4 +309,5 @@ class DecisionMakingAbciApp(AbciApp[Event]): FinishedDecisionMakingReadContributeDBRound: set(), FinishedDecisionMakingWriteContributeDBRound: set(), FinishedDecisionMakingReadManualPointsRound: set(), + FinishedDecisionMakingWeekInOlasRound: set(), } diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index 579313e8..a14e38fb 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -7,19 +7,20 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la - behaviours.py: bafybeiecgeionwiwb7xmrxyuypmkltpz7kqnl4dnpfind5niocdrcbytca + behaviours.py: bafybeid6g2v25st33heykyiceemlhvmd322xcrfrh2uikhqhxpfbaxv7pu dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye fsm_specification.yaml: bafybeib3knchqkllaz5n5f5mkprr5g6uz5seiulodrowcr4zsfo3fujm2m handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya - rounds.py: bafybeiaubhslddudepusvgxmwsy3z4hhzt74gosxgxwk35lymqxyklxgne + rounds.py: bafybeihiuif6suybwodq5yryk7dxwdkj2h7l4yfd336s4g3kydrgfwouy4 tasks/finished_pipeline_preparation.py: bafybeifvwzvnw3d2lxlk4p5hd6j2tcxr7bwjewm667ubssoqyfsk4xafd4 tasks/llm_preparation.py: bafybeigi7i5yp7w5hi5mcbzuzdfbfm4j5etsvplbhb2pdjcb3jfcy6qzrq tasks/read_stream_preparation.py: bafybeiespz6kzkzvrjjf3d6ffwse3rufuyrrab3axvg64pxw4jj6zzhwny tasks/score_preparations.py: bafybeieiesjkyjbcvqut3l6nlzcwpidibsmo3mz7j6p54lbqzspfcf3ram - tasks/task_preparations.py: bafybeieqd2jhzmmjomzmcw72iptogrb6koche6dqmtcuz6lqktaxvi3dxe - tasks/twitter_preparation.py: bafybeieoa5wkhg55w2bdbkwawdz4kh4wmifzgtcmzi3ursi3oaxvpu4mom + tasks/task_preparations.py: bafybeiao4zyitjb2nujyhkhjfkd3mq5d4blbcybyfw27hcnc643yzp6ueq + tasks/twitter_preparation.py: bafybeiaaokuz5brzy3vuvjk456jae4tbfrdxcakv7zdmqaobegti65dewq + tasks/week_in_olas_preparations.py: bafybeiewu2b3dz6nl7lddzikzgc6a7kbg5sllp5pl32b34xchfgednvxpm tasks/write_stream_preparation.py: bafybeifl4j7s575ts6x4msntymkempwguj4yypmxy2xjmffknn7qhkzfo4 tests/__init__.py: bafybeiff447fuzkdgyp5yoqqstzv2pyi2uiokng6lzrtfnsgspocghwypi tests/centaur_configs.py: bafybeifgmz5nlpfj4ynpzywbwnnuhz2dxookezwhxmvzlucjbhugv3tgma diff --git a/packages/valory/skills/dynamic_nft_abci/skill.yaml b/packages/valory/skills/dynamic_nft_abci/skill.yaml index 9ab68586..f7d316c7 100644 --- a/packages/valory/skills/dynamic_nft_abci/skill.yaml +++ b/packages/valory/skills/dynamic_nft_abci/skill.yaml @@ -27,7 +27,7 @@ fingerprint_ignore_patterns: [] connections: - fetchai/http_server:0.22.0:bafybeihp5umafxzx45aad5pj7s3343se2wjkgnbirt4pybrape22swm6de contracts: -- valory/dynamic_contribution:0.1.0:bafybeihjnddpy24wpqtsrf57qdxvku7l5w6sm36u6hkm7i2um7ln664ice +- valory/dynamic_contribution:0.1.0:bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa protocols: - valory/contract_api:1.0.0:bafybeiasywsvax45qmugus5kxogejj66c5taen27h4voriodz7rgushtqa - valory/http:1.0.0:bafybeia5bxdua2i6chw6pg47bvoljzcpuqxzy4rdrorbdmcbnwmnfdobtu diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index e5b073b5..a9af0fb4 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeigmhxenrqb2ysjhcm2au2lang4abyny6irkzqqg4dtclz6net6zpy behaviours.py: bafybeibcqolnjh2e7epjt5npmw3denyxgyyxmugirhn5pdwnw5e4ege3xy - composition.py: bafybeifjy4sknt45etzud543l54c6dp6vf7nschuvccqhcbt3owfliymae + composition.py: bafybeieh32giqkzpm2nnmyna3jvd7wacg2o6mzfuigwj4ij2tyc4djkyvq dialogues.py: bafybeigjknz4qqynbsltjje46gidg4rftsqw6ybjwegz24wetmycutpzh4 fsm_specification.yaml: bafybeifpy7qk3psx22xj46izrqznetlgnukanb23ju25q53ydx6sfcctk4 handlers.py: bafybeidkli6fphcmdgwsys4lkyf3fx6fbawet4nt2pnixfypzijhg6b3ze @@ -28,12 +28,12 @@ skills: - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa -- valory/dynamic_nft_abci:0.1.0:bafybeie4kqdds5hith5xnjqdbrm2j2bkr6h4ty23bdg7rkv7mg5p3qz2ii +- valory/dynamic_nft_abci:0.1.0:bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeigx57k6zwiatveoiyczbhz6xbdtfhhbxg7442tjqyb7ljjfjusn5e +- valory/decision_making_abci:0.1.0:bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq behaviours: diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index 589495a9..2592aaea 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -34,7 +34,7 @@ CollectSameUntilThresholdRound, DegenerateRound, EventToTimeout, - OnlyKeeperSends, + OnlyKeeperSendsRound, get_name, ) from packages.valory.skills.olas_week_abci.payloads import ( @@ -324,7 +324,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return None -class TweetEvaluationRound(OnlyKeeperSends): +class TweetEvaluationRound(OnlyKeeperSendsRound): """TweetEvaluationRound""" payload_class = TweetEvaluationPayload diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index ee6e5303..a7f833e5 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -7,24 +7,16 @@ description: A skill that reads mentions from the Twitter API and assigns scores license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: - __init__.py: bafybeifudgakkjoyahuewp2o4gvqayw7nsgpyxw2ayrpgmzexurh2xomaq - behaviours.py: bafybeif7x53ygd3jyoghbnxavzhhdhliaa3mcxe5n5uui3aa6vgd6v5t5e + __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq + behaviours.py: bafybeihxkh6dt5lpc7mm4f7mrxmhe5gqtmorgnndgb2wloqgktikgxsifq ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si - fsm_specification.yaml: bafybeie6k4aanmwcrghspbqywdh2srrudtkhnbbhqm3ovcz5k4fa5dybrq + fsm_specification.yaml: bafybeifirjhxaexbtjyqucshncrcz443sd5jvlvnt2lemeem55ups2hyri handlers.py: bafybeid3nqvcyotqj5g5hlgrz57nf7vpjysmgvsxe3p7644f4z5dcwqn6u - models.py: bafybeiajis7l5sv7b3fofuj3ehxai5d2uy6h6p4kabhrekjwkjs77lopxe - payloads.py: bafybeibeqiwnua7uewbv5a7epebshjpueuqpcbw6s2y3u62kasdhiijs5i - prompts.py: bafybeieiuqn427bgwfnzynxf3vtqfpvmqqscs5tyw4oibfofwropifotke - rounds.py: bafybeigtzsvklrwxyah2syrzjruufr6uuninyh6flbrwetcgcb5pl4czra - tests/__init__.py: bafybeidwzzd4ejsyf3aryd5kmrvd63h7ajgqyrxphmfaacvpjnneacejay - tests/test_behaviours.py: bafybeihc732whmbn74oxtrua3c77gt4py4tpc5v3drdhg2xc2lxtcqie4e - tests/test_ceramic_db.py: bafybeif2v7btjphbqabq6qdmfeyweg765seon74acg5vrrvznivzg2prey - tests/test_dialogues.py: bafybeiheyq7klonzb7rnjub2i22h7bmsnoimn2pq4j7ofikt3yovstvgt4 - tests/test_handlers.py: bafybeigevirvi3saepukke2zmp334btgsdxhj55o2vawj3hqam63miirg4 - tests/test_models.py: bafybeihaiirqmcsshghztl5lvqjzem6y6rdeefhtiycrhh45v7cuwnmdz4 - tests/test_payloads.py: bafybeihg7ndxuj4lehpmgpdngpzihhmaiy7u5kaylukneavsklfwki5j6q - tests/test_rounds.py: bafybeibbznfio2tgvgzpc4l3jm6jwzd5ifflzgm6aflurllseeolef3ydm + models.py: bafybeihu3xkh7anfahnjfq354yl4fknlffxpzzthskmoqgiklqmkuz5zme + payloads.py: bafybeify23daknhnrwz2dhy7qpyaaloa6raqeq3dsb4hw4ezkcptwj3lji + prompts.py: bafybeieye3sswl33fli44fthyvclwurzswiccxyqncuxaqwg4nrauw5cbe + rounds.py: bafybeih3qdzcbxborunf6eded7ajxwkc6wq4lllsjfmarid4qtoblbi5di fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq From 970c48c97af57f80d15032b0959cc3de4d420918 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 09:02:21 +0200 Subject: [PATCH 10/26] fix: round names --- Makefile | 3 + .../fsm_specification.yaml | 6 + .../impact_evaluator_abci/composition.py | 7 +- .../fsm_specification.yaml | 37 ++++++ .../skills/olas_week_abci/behaviours.py | 98 +++++++-------- .../valory/skills/olas_week_abci/dialogues.py | 2 +- .../olas_week_abci/fsm_specification.yaml | 89 ++++++-------- .../valory/skills/olas_week_abci/handlers.py | 2 +- .../valory/skills/olas_week_abci/models.py | 6 +- .../valory/skills/olas_week_abci/payloads.py | 20 ++-- .../valory/skills/olas_week_abci/prompts.py | 2 +- .../valory/skills/olas_week_abci/rounds.py | 113 +++++++++--------- .../valory/skills/olas_week_abci/skill.yaml | 2 +- 13 files changed, 205 insertions(+), 182 deletions(-) diff --git a/Makefile b/Makefile index cca29b74..cdd3b9aa 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ test: -rfE packages/valory/skills/decision_making_abci \ -rfE packages/valory/skills/llm_abci \ -rfE packages/valory/skills/twitter_write_abci \ + -rfE packages/valory/skills/olas_week_abci \ --cov=packages.valory.skills.ceramic_read_abci \ --cov=packages.valory.skills.generic_scoring_abci \ --cov=packages.valory.skills.twitter_scoring_abci \ @@ -99,6 +100,7 @@ test: --cov=packages.valory.skills.decision_making_abci \ --cov=packages.valory.skills.llm_abci \ --cov=packages.valory.skills.twitter_write_abci \ + --cov=packages.valory.skills.olas_week_abci \ --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc find . -name ".coverage*" -not -name ".coveragerc" -exec rm -fr "{}" \; @@ -135,6 +137,7 @@ fix-abci-app-specs: autonomy analyse fsm-specs --update --app-class LLMAbciApp --package packages/valory/skills/llm_abci/ || (echo "Failed to check llm_abci abci consistency" && exit 1) autonomy analyse fsm-specs --update --app-class TwitterWriteAbciApp --package packages/valory/skills/twitter_write_abci/ || (echo "Failed to check twitter_write_abci abci consistency" && exit 1) autonomy analyse fsm-specs --update --app-class ImpactEvaluatorSkillAbciApp --package packages/valory/skills/impact_evaluator_abci/ || (echo "Failed to check impact_evaluator_abci abci consistency" && exit 1) + autonomy analyse fsm-specs --update --app-class WeekInOlasAbciApp --package packages/valory/skills/olas_week_abci/ || (echo "Failed to check olas_week_abci abci consistency" && exit 1) .PHONY: all-linters diff --git a/packages/valory/skills/decision_making_abci/fsm_specification.yaml b/packages/valory/skills/decision_making_abci/fsm_specification.yaml index 58943ce0..ddd408da 100644 --- a/packages/valory/skills/decision_making_abci/fsm_specification.yaml +++ b/packages/valory/skills/decision_making_abci/fsm_specification.yaml @@ -12,6 +12,8 @@ alphabet_in: - SCHEDULED_TWEET - SCORE - UPDATE_CENTAURS +- WEEK_IN_OLAS_CREATE +- WEEK_IN_OLAS_WRITE - WRITE_CONTRIBUTE_DB default_start_state: DecisionMakingRound final_states: @@ -22,6 +24,7 @@ final_states: - FinishedDecisionMakingReadManualPointsRound - FinishedDecisionMakingScoreRound - FinishedDecisionMakingUpdateCentaurRound +- FinishedDecisionMakingWeekInOlasRound - FinishedDecisionMakingWriteContributeDBRound - FinishedDecisionMakingWriteOrbisRound - FinishedDecisionMakingWriteTwitterRound @@ -37,6 +40,7 @@ states: - FinishedDecisionMakingReadManualPointsRound - FinishedDecisionMakingScoreRound - FinishedDecisionMakingUpdateCentaurRound +- FinishedDecisionMakingWeekInOlasRound - FinishedDecisionMakingWriteContributeDBRound - FinishedDecisionMakingWriteOrbisRound - FinishedDecisionMakingWriteTwitterRound @@ -54,4 +58,6 @@ transition_func: (DecisionMakingRound, SCHEDULED_TWEET): FinishedDecisionMakingWriteTwitterRound (DecisionMakingRound, SCORE): FinishedDecisionMakingScoreRound (DecisionMakingRound, UPDATE_CENTAURS): FinishedDecisionMakingUpdateCentaurRound + (DecisionMakingRound, WEEK_IN_OLAS_CREATE): FinishedDecisionMakingWeekInOlasRound + (DecisionMakingRound, WEEK_IN_OLAS_WRITE): FinishedDecisionMakingWriteTwitterRound (DecisionMakingRound, WRITE_CONTRIBUTE_DB): FinishedDecisionMakingWriteContributeDBRound diff --git a/packages/valory/skills/impact_evaluator_abci/composition.py b/packages/valory/skills/impact_evaluator_abci/composition.py index dcc9bb03..13c1652f 100644 --- a/packages/valory/skills/impact_evaluator_abci/composition.py +++ b/packages/valory/skills/impact_evaluator_abci/composition.py @@ -24,7 +24,7 @@ import packages.valory.skills.dynamic_nft_abci.rounds as DynamicNFTAbci import packages.valory.skills.generic_scoring_abci.rounds as GenericScoringAbci import packages.valory.skills.llm_abci.rounds as LLMAbciApp -import packages.valory.skills.olas_week_abci.rounds as WeekInOlasAbci +import packages.valory.skills.olas_week_abci.rounds as WeekInOlasAbciApp import packages.valory.skills.registration_abci.rounds as RegistrationAbci import packages.valory.skills.reset_pause_abci.rounds as ResetAndPauseAbci import packages.valory.skills.twitter_scoring_abci.rounds as TwitterScoringAbci @@ -55,10 +55,10 @@ DecisionMakingAbci.FinishedDecisionMakingReadManualPointsRound: CeramicReadAbci.StreamReadRound, DecisionMakingAbci.FinishedDecisionMakingScoreRound: GenericScoringAbci.GenericScoringRound, DecisionMakingAbci.FinishedDecisionMakingDoneRound: ResetAndPauseAbci.ResetAndPauseRound, - DecisionMakingAbci.FinishedDecisionMakingWeekInOlasRound: WeekInOlasAbci.TwitterDecisionMakingRound, + DecisionMakingAbci.FinishedDecisionMakingWeekInOlasRound: WeekInOlasAbciApp.OlasWeekDecisionMakingRound, GenericScoringAbci.FinishedGenericScoringRound: TwitterScoringAbci.TwitterDecisionMakingRound, TwitterScoringAbci.FinishedTwitterScoringRound: DynamicNFTAbci.TokenTrackRound, - WeekInOlasAbci.FinishedWeekInOlasRound: DecisionMakingAbci.DecisionMakingRound, + WeekInOlasAbciApp.FinishedWeekInOlasRound: DecisionMakingAbci.DecisionMakingRound, DynamicNFTAbci.FinishedTokenTrackRound: DecisionMakingAbci.DecisionMakingRound, LLMAbciApp.FinishedLLMRound: DecisionMakingAbci.DecisionMakingRound, TwitterWriteAbciApp.FinishedTwitterWriteRound: DecisionMakingAbci.DecisionMakingRound, @@ -88,6 +88,7 @@ DynamicNFTAbci.DynamicNFTAbciApp, CeramicWriteAbci.CeramicWriteAbciApp, ResetAndPauseAbci.ResetPauseAbciApp, + WeekInOlasAbciApp.WeekInOlasAbciApp, ), abci_app_transition_mapping, ).add_background_app(termination_config) diff --git a/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml b/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml index 0317da4d..7a2f3fb4 100644 --- a/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml +++ b/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml @@ -25,6 +25,7 @@ alphabet_in: - RESET_AND_PAUSE_TIMEOUT - RETRIEVE_HASHTAGS - RETRIEVE_MENTIONS +- RETRIEVE_TWEETS - ROUND_TIMEOUT - SCHEDULED_TWEET - SCORE @@ -32,6 +33,8 @@ alphabet_in: - TWEET_EVALUATION_ROUND_TIMEOUT - UPDATE_CENTAURS - VERIFICATION_ERROR +- WEEK_IN_OLAS_CREATE +- WEEK_IN_OLAS_WRITE - WRITE_CONTRIBUTE_DB default_start_state: RegistrationStartupRound final_states: [] @@ -46,6 +49,12 @@ states: - LLMRandomnessRound - LLMRound - LLMSelectKeeperRound +- OlasWeekDecisionMakingRound +- OlasWeekEvaluationRound +- OlasWeekOpenAICallCheckRound +- OlasWeekRandomnessRound +- OlasWeekSelectKeepersRound +- OlasWeekTweetCollectionRound - OpenAICallCheckRound - RandomnessRound - RandomnessTwitterRound @@ -82,6 +91,8 @@ transition_func: (DecisionMakingRound, SCHEDULED_TWEET): RandomnessTwitterRound (DecisionMakingRound, SCORE): GenericScoringRound (DecisionMakingRound, UPDATE_CENTAURS): RandomnessRound + (DecisionMakingRound, WEEK_IN_OLAS_CREATE): OlasWeekDecisionMakingRound + (DecisionMakingRound, WEEK_IN_OLAS_WRITE): RandomnessTwitterRound (DecisionMakingRound, WRITE_CONTRIBUTE_DB): RandomnessRound (GenericScoringRound, DONE): TwitterDecisionMakingRound (GenericScoringRound, NO_MAJORITY): GenericScoringRound @@ -96,6 +107,32 @@ transition_func: (LLMSelectKeeperRound, DONE): LLMRound (LLMSelectKeeperRound, NO_MAJORITY): LLMRandomnessRound (LLMSelectKeeperRound, ROUND_TIMEOUT): LLMRandomnessRound + (OlasWeekDecisionMakingRound, DONE): DecisionMakingRound + (OlasWeekDecisionMakingRound, DONE_SKIP): DecisionMakingRound + (OlasWeekDecisionMakingRound, EVALUATE): OlasWeekEvaluationRound + (OlasWeekDecisionMakingRound, NO_MAJORITY): OlasWeekDecisionMakingRound + (OlasWeekDecisionMakingRound, OPENAI_CALL_CHECK): OlasWeekOpenAICallCheckRound + (OlasWeekDecisionMakingRound, RETRIEVE_TWEETS): OlasWeekTweetCollectionRound + (OlasWeekDecisionMakingRound, ROUND_TIMEOUT): OlasWeekDecisionMakingRound + (OlasWeekDecisionMakingRound, SELECT_KEEPERS): OlasWeekRandomnessRound + (OlasWeekEvaluationRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekEvaluationRound, TWEET_EVALUATION_ROUND_TIMEOUT): OlasWeekEvaluationRound + (OlasWeekOpenAICallCheckRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekOpenAICallCheckRound, NO_ALLOWANCE): OlasWeekDecisionMakingRound + (OlasWeekOpenAICallCheckRound, NO_MAJORITY): OlasWeekOpenAICallCheckRound + (OlasWeekOpenAICallCheckRound, ROUND_TIMEOUT): OlasWeekOpenAICallCheckRound + (OlasWeekRandomnessRound, DONE): OlasWeekSelectKeepersRound + (OlasWeekRandomnessRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekRandomnessRound, ROUND_TIMEOUT): OlasWeekRandomnessRound + (OlasWeekSelectKeepersRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekSelectKeepersRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekSelectKeepersRound, ROUND_TIMEOUT): OlasWeekRandomnessRound + (OlasWeekTweetCollectionRound, API_ERROR): OlasWeekTweetCollectionRound + (OlasWeekTweetCollectionRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, DONE_API_LIMITS): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, DONE_MAX_RETRIES): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekTweetCollectionRound, ROUND_TIMEOUT): OlasWeekRandomnessRound (OpenAICallCheckRound, DONE): TwitterDecisionMakingRound (OpenAICallCheckRound, NO_ALLOWANCE): TwitterDecisionMakingRound (OpenAICallCheckRound, NO_MAJORITY): OpenAICallCheckRound diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index 7585f7a3..e4accb1f 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -17,18 +17,15 @@ # # ------------------------------------------------------------------------------ -"""This package contains round behaviours of TwitterScoringAbciApp.""" +"""This package contains round behaviours of WeekInOlasAbciApp.""" import json import math import random -import re from abc import ABC from datetime import datetime, timedelta from typing import Dict, Generator, List, Optional, Set, Tuple, Type, cast -from web3 import Web3 - from packages.valory.connections.openai.connection import ( PUBLIC_ID as LLM_CONNECTION_PUBLIC_ID, ) @@ -48,28 +45,26 @@ SharedState, ) from packages.valory.skills.olas_week_abci.payloads import ( + OlasWeekDecisionMakingPayload, + OlasWeekEvaluationPayload, + OlasWeekRandomnessPayload, + OlasWeekSelectKeepersPayload, + OlasWeekTweetCollectionPayload, OpenAICallCheckPayload, - TweetCollectionPayload, - TweetEvaluationPayload, - TwitterDecisionMakingPayload, - TwitterRandomnessPayload, - TwitterSelectKeepersPayload, ) from packages.valory.skills.olas_week_abci.prompts import tweet_summarizer_prompt from packages.valory.skills.olas_week_abci.rounds import ( - DBUpdateRound, ERROR_API_LIMITS, ERROR_GENERIC, Event, - OpenAICallCheckRound, + OlasWeekDecisionMakingRound, + OlasWeekEvaluationRound, + OlasWeekOpenAICallCheckRound, + OlasWeekRandomnessRound, + OlasWeekSelectKeepersRound, + OlasWeekTweetCollectionRound, SynchronizedData, - TweetEvaluationRound, - TwitterDecisionMakingRound, - TwitterHashtagsCollectionRound, - TwitterMentionsCollectionRound, - TwitterRandomnessRound, - TwitterScoringAbciApp, - TwitterSelectKeepersRound, + WeekInOlasAbciApp, ) @@ -169,18 +164,18 @@ def _check_twitter_limits(self) -> Tuple: return False, number_of_tweets_pulled_today, last_tweet_pull_window_reset -class TwitterRandomnessBehaviour(RandomnessBehaviour): +class OlasWeekRandomnessBehaviour(RandomnessBehaviour): """Retrieve randomness.""" - matching_round = TwitterRandomnessRound - payload_class = TwitterRandomnessPayload + matching_round = OlasWeekRandomnessRound + payload_class = OlasWeekRandomnessPayload -class TwitterSelectKeepersBehaviour(OlasWeekBaseBehaviour): +class OlasWeekSelectKeepersBehaviour(OlasWeekBaseBehaviour): """Select the keeper agent.""" - matching_round = TwitterSelectKeepersRound - payload_class = TwitterSelectKeepersPayload + matching_round = OlasWeekSelectKeepersRound + payload_class = OlasWeekSelectKeepersPayload def _select_keepers(self) -> List[str]: """ @@ -254,7 +249,7 @@ def async_act(self) -> Generator: """ with self.context.benchmark_tool.measure(self.behaviour_id).local(): - payload = TwitterSelectKeepersPayload( # type: ignore + payload = OlasWeekSelectKeepersPayload( # type: ignore self.context.agent_address, json.dumps(self._select_keepers(), sort_keys=True), ) @@ -266,10 +261,10 @@ def async_act(self) -> Generator: self.set_done() -class TwitterDecisionMakingBehaviour(OlasWeekBaseBehaviour): - """TwitterDecisionMakingBehaviour""" +class OlasWeekDecisionMakingBehaviour(OlasWeekBaseBehaviour): + """OlasWeekDecisionMakingBehaviour""" - matching_round: Type[AbstractRound] = TwitterDecisionMakingRound + matching_round: Type[AbstractRound] = OlasWeekDecisionMakingRound def async_act(self) -> Generator: """Do the act, supporting asynchronous execution.""" @@ -279,7 +274,7 @@ def async_act(self) -> Generator: with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction( - payload=TwitterDecisionMakingPayload( + payload=OlasWeekDecisionMakingPayload( sender=self.context.agent_address, event=event, ) @@ -309,16 +304,13 @@ def get_next_event(self) -> str: if Event.EVALUATE.value not in performed_tasks: return Event.EVALUATE.value - if Event.DB_UPDATE.value not in performed_tasks: - return Event.DB_UPDATE.value - return Event.DONE.value class OpenAICallCheckBehaviour(OlasWeekBaseBehaviour): - """TweetCollectionBehaviour""" + """OlasWeekTweetCollectionBehaviour""" - matching_round: Type[AbstractRound] = OpenAICallCheckRound + matching_round: Type[AbstractRound] = OlasWeekOpenAICallCheckRound def async_act(self) -> Generator: """Do the act, supporting asynchronous execution.""" @@ -331,7 +323,7 @@ def async_act(self) -> Generator: if self.openai_calls.max_calls_reached(): content = None else: - content = OpenAICallCheckRound.CALLS_REMAINING + content = OlasWeekOpenAICallCheckRound.CALLS_REMAINING with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): yield from self.send_a2a_transaction( payload=OpenAICallCheckPayload( @@ -343,10 +335,10 @@ def async_act(self) -> Generator: self.set_done() -class TweetCollectionBehaviour(OlasWeekBaseBehaviour): - """TweetCollectionBehaviour""" +class OlasWeekTweetCollectionBehaviour(OlasWeekBaseBehaviour): + """OlasWeekTweetCollectionBehaviour""" - matching_round: Type[AbstractRound] = TwitterMentionsCollectionRound + matching_round: Type[AbstractRound] = OlasWeekTweetCollectionRound def _i_am_not_sending(self) -> bool: """Indicates if the current agent is one of the sender or not.""" @@ -409,7 +401,7 @@ def _sender_act(self) -> Generator: payload_data["last_tweet_pull_window_reset"] = last_tweet_pull_window_reset sender = self.context.agent_address - payload = TweetCollectionPayload( + payload = OlasWeekTweetCollectionPayload( sender=sender, content=json.dumps(payload_data, sort_keys=True) ) @@ -452,7 +444,7 @@ def _get_twitter_mentions( start_time_str = start_time.strftime("%Y-%m-%dT%H:%M:%S:00Z") # Build the args - api_args = self.params.twitter_mentions_args.replace( + api_args = self.params.twitter_tweets_args.replace( "{start_time}", start_time_str ) api_args = api_args.replace( @@ -590,10 +582,10 @@ def _get_twitter_mentions( } -class TweetEvaluationBehaviour(OlasWeekBaseBehaviour): - """TweetEvaluationBehaviour""" +class OlasWeekEvaluationBehaviour(OlasWeekBaseBehaviour): + """OlasWeekEvaluationBehaviour""" - matching_round: Type[AbstractRound] = TweetEvaluationRound + matching_round: Type[AbstractRound] = OlasWeekEvaluationRound def async_act(self) -> Generator: """Do the act, supporting asynchronous execution.""" @@ -606,7 +598,7 @@ def async_act(self) -> Generator: ) sender = self.context.agent_address - payload = TweetEvaluationPayload( + payload = OlasWeekEvaluationPayload( sender=sender, content=json.dumps({"summary_tweets": summary_tweets}, sort_keys=True) ) @@ -666,16 +658,16 @@ def _do_request( return response -class TwitterScoringRoundBehaviour(AbstractRoundBehaviour): - """TwitterScoringRoundBehaviour""" +class OlasWeekRoundBehaviour(AbstractRoundBehaviour): + """OlasWeekRoundBehaviour""" - initial_behaviour_cls = TweetCollectionBehaviour - abci_app_cls = TwitterScoringAbciApp # type: ignore + initial_behaviour_cls = OlasWeekTweetCollectionBehaviour + abci_app_cls = WeekInOlasAbciApp # type: ignore behaviours: Set[Type[BaseBehaviour]] = [ - TwitterDecisionMakingBehaviour, + OlasWeekDecisionMakingBehaviour, OpenAICallCheckBehaviour, - TweetCollectionBehaviour, - TweetEvaluationBehaviour, - TwitterRandomnessBehaviour, - TwitterSelectKeepersBehaviour, + OlasWeekTweetCollectionBehaviour, + OlasWeekEvaluationBehaviour, + OlasWeekRandomnessBehaviour, + OlasWeekSelectKeepersBehaviour, ] diff --git a/packages/valory/skills/olas_week_abci/dialogues.py b/packages/valory/skills/olas_week_abci/dialogues.py index 86faa299..a6f8da1e 100644 --- a/packages/valory/skills/olas_week_abci/dialogues.py +++ b/packages/valory/skills/olas_week_abci/dialogues.py @@ -17,7 +17,7 @@ # # ------------------------------------------------------------------------------ -"""This module contains the dialogues of the TwitterScoringAbciApp.""" +"""This module contains the dialogues of the WeekInOlasAbciApp.""" from typing import Any diff --git a/packages/valory/skills/olas_week_abci/fsm_specification.yaml b/packages/valory/skills/olas_week_abci/fsm_specification.yaml index 2c6fa6ba..03cd1d72 100644 --- a/packages/valory/skills/olas_week_abci/fsm_specification.yaml +++ b/packages/valory/skills/olas_week_abci/fsm_specification.yaml @@ -1,6 +1,5 @@ alphabet_in: - API_ERROR -- DB_UPDATE - DONE - DONE_API_LIMITS - DONE_MAX_RETRIES @@ -10,61 +9,47 @@ alphabet_in: - NO_MAJORITY - OPENAI_CALL_CHECK - RETRIEVE_TWEETS -- RETRIEVE_MENTIONS - ROUND_TIMEOUT - SELECT_KEEPERS - TWEET_EVALUATION_ROUND_TIMEOUT -default_start_state: TwitterDecisionMakingRound +default_start_state: OlasWeekDecisionMakingRound final_states: -- FinishedTwitterScoringRound -label: TwitterScoringAbciApp +- FinishedWeekInOlasRound +label: WeekInOlasAbciApp start_states: -- TwitterDecisionMakingRound +- OlasWeekDecisionMakingRound states: -- DBUpdateRound -- FinishedTwitterScoringRound -- OpenAICallCheckRound -- TweetEvaluationRound -- TwitterDecisionMakingRound -- TwitterHashtagsCollectionRound -- TwitterMentionsCollectionRound -- TwitterRandomnessRound -- TwitterSelectKeepersRound +- FinishedWeekInOlasRound +- OlasWeekDecisionMakingRound +- OlasWeekEvaluationRound +- OlasWeekOpenAICallCheckRound +- OlasWeekRandomnessRound +- OlasWeekSelectKeepersRound +- OlasWeekTweetCollectionRound transition_func: - (DBUpdateRound, DONE): TwitterDecisionMakingRound - (DBUpdateRound, NO_MAJORITY): DBUpdateRound - (DBUpdateRound, ROUND_TIMEOUT): DBUpdateRound - (OpenAICallCheckRound, DONE): TwitterDecisionMakingRound - (OpenAICallCheckRound, NO_ALLOWANCE): TwitterDecisionMakingRound - (OpenAICallCheckRound, NO_MAJORITY): OpenAICallCheckRound - (OpenAICallCheckRound, ROUND_TIMEOUT): OpenAICallCheckRound - (TweetEvaluationRound, DONE): TwitterDecisionMakingRound - (TweetEvaluationRound, TWEET_EVALUATION_ROUND_TIMEOUT): TweetEvaluationRound - (TwitterDecisionMakingRound, DB_UPDATE): DBUpdateRound - (TwitterDecisionMakingRound, DONE): FinishedTwitterScoringRound - (TwitterDecisionMakingRound, DONE_SKIP): FinishedTwitterScoringRound - (TwitterDecisionMakingRound, EVALUATE): TweetEvaluationRound - (TwitterDecisionMakingRound, NO_MAJORITY): TwitterDecisionMakingRound - (TwitterDecisionMakingRound, OPENAI_CALL_CHECK): OpenAICallCheckRound - (TwitterDecisionMakingRound, RETRIEVE_TWEETS): TwitterHashtagsCollectionRound - (TwitterDecisionMakingRound, RETRIEVE_MENTIONS): TwitterMentionsCollectionRound - (TwitterDecisionMakingRound, ROUND_TIMEOUT): TwitterDecisionMakingRound - (TwitterDecisionMakingRound, SELECT_KEEPERS): TwitterRandomnessRound - (TwitterHashtagsCollectionRound, API_ERROR): TwitterHashtagsCollectionRound - (TwitterHashtagsCollectionRound, DONE): TwitterDecisionMakingRound - (TwitterHashtagsCollectionRound, DONE_API_LIMITS): TwitterDecisionMakingRound - (TwitterHashtagsCollectionRound, DONE_MAX_RETRIES): TwitterDecisionMakingRound - (TwitterHashtagsCollectionRound, NO_MAJORITY): TwitterRandomnessRound - (TwitterHashtagsCollectionRound, ROUND_TIMEOUT): TwitterRandomnessRound - (TwitterMentionsCollectionRound, API_ERROR): TwitterMentionsCollectionRound - (TwitterMentionsCollectionRound, DONE): TwitterDecisionMakingRound - (TwitterMentionsCollectionRound, DONE_API_LIMITS): TwitterDecisionMakingRound - (TwitterMentionsCollectionRound, DONE_MAX_RETRIES): TwitterDecisionMakingRound - (TwitterMentionsCollectionRound, NO_MAJORITY): TwitterRandomnessRound - (TwitterMentionsCollectionRound, ROUND_TIMEOUT): TwitterRandomnessRound - (TwitterRandomnessRound, DONE): TwitterSelectKeepersRound - (TwitterRandomnessRound, NO_MAJORITY): TwitterRandomnessRound - (TwitterRandomnessRound, ROUND_TIMEOUT): TwitterRandomnessRound - (TwitterSelectKeepersRound, DONE): TwitterDecisionMakingRound - (TwitterSelectKeepersRound, NO_MAJORITY): TwitterRandomnessRound - (TwitterSelectKeepersRound, ROUND_TIMEOUT): TwitterRandomnessRound + (OlasWeekDecisionMakingRound, DONE): FinishedWeekInOlasRound + (OlasWeekDecisionMakingRound, DONE_SKIP): FinishedWeekInOlasRound + (OlasWeekDecisionMakingRound, EVALUATE): OlasWeekEvaluationRound + (OlasWeekDecisionMakingRound, NO_MAJORITY): OlasWeekDecisionMakingRound + (OlasWeekDecisionMakingRound, OPENAI_CALL_CHECK): OlasWeekOpenAICallCheckRound + (OlasWeekDecisionMakingRound, RETRIEVE_TWEETS): OlasWeekTweetCollectionRound + (OlasWeekDecisionMakingRound, ROUND_TIMEOUT): OlasWeekDecisionMakingRound + (OlasWeekDecisionMakingRound, SELECT_KEEPERS): OlasWeekRandomnessRound + (OlasWeekEvaluationRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekEvaluationRound, TWEET_EVALUATION_ROUND_TIMEOUT): OlasWeekEvaluationRound + (OlasWeekOpenAICallCheckRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekOpenAICallCheckRound, NO_ALLOWANCE): OlasWeekDecisionMakingRound + (OlasWeekOpenAICallCheckRound, NO_MAJORITY): OlasWeekOpenAICallCheckRound + (OlasWeekOpenAICallCheckRound, ROUND_TIMEOUT): OlasWeekOpenAICallCheckRound + (OlasWeekRandomnessRound, DONE): OlasWeekSelectKeepersRound + (OlasWeekRandomnessRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekRandomnessRound, ROUND_TIMEOUT): OlasWeekRandomnessRound + (OlasWeekSelectKeepersRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekSelectKeepersRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekSelectKeepersRound, ROUND_TIMEOUT): OlasWeekRandomnessRound + (OlasWeekTweetCollectionRound, API_ERROR): OlasWeekTweetCollectionRound + (OlasWeekTweetCollectionRound, DONE): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, DONE_API_LIMITS): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, DONE_MAX_RETRIES): OlasWeekDecisionMakingRound + (OlasWeekTweetCollectionRound, NO_MAJORITY): OlasWeekRandomnessRound + (OlasWeekTweetCollectionRound, ROUND_TIMEOUT): OlasWeekRandomnessRound diff --git a/packages/valory/skills/olas_week_abci/handlers.py b/packages/valory/skills/olas_week_abci/handlers.py index c61f9336..8c4a9883 100644 --- a/packages/valory/skills/olas_week_abci/handlers.py +++ b/packages/valory/skills/olas_week_abci/handlers.py @@ -17,7 +17,7 @@ # # ------------------------------------------------------------------------------ -"""This module contains the handlers for the skill of TwitterScoringAbciApp.""" +"""This module contains the handlers for the skill of WeekInOlasAbciApp.""" from typing import Optional diff --git a/packages/valory/skills/olas_week_abci/models.py b/packages/valory/skills/olas_week_abci/models.py index 9266362b..4d833d45 100644 --- a/packages/valory/skills/olas_week_abci/models.py +++ b/packages/valory/skills/olas_week_abci/models.py @@ -17,7 +17,7 @@ # # ------------------------------------------------------------------------------ -"""This module contains the shared state for the abci skill of TwitterScoringAbciApp.""" +"""This module contains the shared state for the abci skill of WeekInOlasAbciApp.""" from datetime import datetime from typing import Any @@ -30,13 +30,13 @@ from packages.valory.skills.abstract_round_abci.models import ( SharedState as BaseSharedState, ) -from packages.valory.skills.olas_week_abci.rounds import TwitterScoringAbciApp +from packages.valory.skills.olas_week_abci.rounds import WeekInOlasAbciApp class SharedState(BaseSharedState): """Keep the current shared state of the skill.""" - abci_app_cls = TwitterScoringAbciApp + abci_app_cls = WeekInOlasAbciApp class RandomnessApi(ApiSpecs): diff --git a/packages/valory/skills/olas_week_abci/payloads.py b/packages/valory/skills/olas_week_abci/payloads.py index 3f9af073..068e0021 100644 --- a/packages/valory/skills/olas_week_abci/payloads.py +++ b/packages/valory/skills/olas_week_abci/payloads.py @@ -17,7 +17,7 @@ # # ------------------------------------------------------------------------------ -"""This module contains the transaction payloads of the TwitterScoringAbciApp.""" +"""This module contains the transaction payloads of the WeekInOlasAbciApp.""" from dataclasses import dataclass from typing import Optional @@ -26,21 +26,21 @@ @dataclass(frozen=True) -class TwitterDecisionMakingPayload(BaseTxPayload): - """Represent a transaction payload for the TwitterDecisionMakingRound.""" +class OlasWeekDecisionMakingPayload(BaseTxPayload): + """Represent a transaction payload for the OlasWeekDecisionMakingRound.""" event: str @dataclass(frozen=True) class OpenAICallCheckPayload(BaseTxPayload): - """Represent a transaction payload for the OpenAICallCheckRound.""" + """Represent a transaction payload for the OlasWeekOpenAICallCheckRound.""" content: Optional[str] @dataclass(frozen=True) -class TwitterRandomnessPayload(BaseTxPayload): +class OlasWeekRandomnessPayload(BaseTxPayload): """Represent a transaction payload of type 'randomness'.""" round_id: int @@ -48,21 +48,21 @@ class TwitterRandomnessPayload(BaseTxPayload): @dataclass(frozen=True) -class TwitterSelectKeepersPayload(BaseTxPayload): +class OlasWeekSelectKeepersPayload(BaseTxPayload): """Represent a transaction payload of type 'select_keeper'.""" keepers: str @dataclass(frozen=True) -class TweetCollectionPayload(BaseTxPayload): - """Represent a transaction payload for the TweetCollectionRound.""" +class OlasWeekTweetCollectionPayload(BaseTxPayload): + """Represent a transaction payload for the OlasWeekTweetCollectionRound.""" content: str @dataclass(frozen=True) -class TweetEvaluationPayload(BaseTxPayload): - """Represent a transaction payload for the TweetEvaluationRound.""" +class OlasWeekEvaluationPayload(BaseTxPayload): + """Represent a transaction payload for the OlasWeekEvaluationRound.""" content: str diff --git a/packages/valory/skills/olas_week_abci/prompts.py b/packages/valory/skills/olas_week_abci/prompts.py index fc14f8aa..d149bb8b 100644 --- a/packages/valory/skills/olas_week_abci/prompts.py +++ b/packages/valory/skills/olas_week_abci/prompts.py @@ -17,7 +17,7 @@ # # ------------------------------------------------------------------------------ -"""This package contains LLM prompts for TwitterScoringAbciApp.""" +"""This package contains LLM prompts for WeekInOlasAbciApp.""" tweet_summarizer_prompt = """ You are an AI tweet summarizer that needs to create concise pieces of content using tweets from your users. These users will write about what happened during the last week in Autonolas, a web3 protocol focused on building decentralized autonomous services. Your task is to summarize all the content from your users in a few short paragraphs that tells the story of what happened during the last week in the Autonolas protocol. You will be given a text about Autonolas as well as the user tweets. diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index 2592aaea..e496489b 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -17,11 +17,10 @@ # # ------------------------------------------------------------------------------ -"""This package contains the rounds of TwitterScoringAbciApp.""" +"""This package contains the rounds of WeekInOlasAbciApp.""" import json import math -import statistics from enum import Enum from typing import Any, Dict, FrozenSet, Optional, Set, Tuple, cast @@ -38,12 +37,12 @@ get_name, ) from packages.valory.skills.olas_week_abci.payloads import ( + OlasWeekDecisionMakingPayload, + OlasWeekEvaluationPayload, + OlasWeekRandomnessPayload, + OlasWeekSelectKeepersPayload, + OlasWeekTweetCollectionPayload, OpenAICallCheckPayload, - TweetCollectionPayload, - TweetEvaluationPayload, - TwitterDecisionMakingPayload, - TwitterRandomnessPayload, - TwitterSelectKeepersPayload, ) @@ -53,7 +52,7 @@ class Event(Enum): - """TwitterScoringAbciApp Events""" + """WeekInOlasAbciApp Events""" DONE = "done" DONE_SKIP = "done_skip" @@ -134,10 +133,10 @@ def are_keepers_set(self) -> bool: return self.db.get("most_voted_keeper_addresses", None) is not None -class TwitterDecisionMakingRound(CollectSameUntilThresholdRound): - """TwitterDecisionMakingRound""" +class OlasWeekDecisionMakingRound(CollectSameUntilThresholdRound): + """OlasWeekDecisionMakingRound""" - payload_class = TwitterDecisionMakingPayload + payload_class = OlasWeekDecisionMakingPayload synchronized_data_class = SynchronizedData def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: @@ -154,8 +153,8 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return None -class OpenAICallCheckRound(CollectSameUntilThresholdRound): - """OpenAICallCheckRound""" +class OlasWeekOpenAICallCheckRound(CollectSameUntilThresholdRound): + """OlasWeekOpenAICallCheckRound""" payload_class = OpenAICallCheckPayload synchronized_data_class = SynchronizedData @@ -200,10 +199,10 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return None -class TweetCollectionRound(CollectSameUntilThresholdRound): +class OlasWeekTweetCollectionRound(CollectSameUntilThresholdRound): """TwitterMentionsCollectionRound""" - payload_class = TweetCollectionPayload + payload_class = OlasWeekTweetCollectionPayload synchronized_data_class = SynchronizedData @property @@ -324,10 +323,10 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return None -class TweetEvaluationRound(OnlyKeeperSendsRound): - """TweetEvaluationRound""" +class OlasWeekEvaluationRound(OnlyKeeperSendsRound): + """OlasWeekEvaluationRound""" - payload_class = TweetEvaluationPayload + payload_class = OlasWeekEvaluationPayload synchronized_data_class = SynchronizedData def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: @@ -353,10 +352,10 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: return synchronized_data, Event.DONE -class TwitterRandomnessRound(CollectSameUntilThresholdRound): +class OlasWeekRandomnessRound(CollectSameUntilThresholdRound): """A round for generating randomness""" - payload_class = TwitterRandomnessPayload + payload_class = OlasWeekRandomnessPayload synchronized_data_class = SynchronizedData done_event = Event.DONE no_majority_event = Event.NO_MAJORITY @@ -367,10 +366,10 @@ class TwitterRandomnessRound(CollectSameUntilThresholdRound): ) -class TwitterSelectKeepersRound(CollectSameUntilThresholdRound): +class OlasWeekSelectKeepersRound(CollectSameUntilThresholdRound): """A round in which a keeper is selected for transaction submission""" - payload_class = TwitterSelectKeepersPayload + payload_class = OlasWeekSelectKeepersPayload synchronized_data_class = SynchronizedData def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: @@ -405,49 +404,49 @@ class FinishedWeekInOlasRound(DegenerateRound): """FinishedWeekInOlasRound""" -class TwitterScoringAbciApp(AbciApp[Event]): - """TwitterScoringAbciApp""" +class WeekInOlasAbciApp(AbciApp[Event]): + """WeekInOlasAbciApp""" - initial_round_cls: AppState = TwitterDecisionMakingRound - initial_states: Set[AppState] = {TwitterDecisionMakingRound} + initial_round_cls: AppState = OlasWeekDecisionMakingRound + initial_states: Set[AppState] = {OlasWeekDecisionMakingRound} transition_function: AbciAppTransitionFunction = { - TwitterDecisionMakingRound: { - Event.OPENAI_CALL_CHECK: OpenAICallCheckRound, + OlasWeekDecisionMakingRound: { + Event.OPENAI_CALL_CHECK: OlasWeekOpenAICallCheckRound, Event.DONE_SKIP: FinishedWeekInOlasRound, - Event.SELECT_KEEPERS: TwitterRandomnessRound, - Event.RETRIEVE_TWEETS: TweetCollectionRound, - Event.EVALUATE: TweetEvaluationRound, + Event.SELECT_KEEPERS: OlasWeekRandomnessRound, + Event.RETRIEVE_TWEETS: OlasWeekTweetCollectionRound, + Event.EVALUATE: OlasWeekEvaluationRound, Event.DONE: FinishedWeekInOlasRound, - Event.ROUND_TIMEOUT: TwitterDecisionMakingRound, - Event.NO_MAJORITY: TwitterDecisionMakingRound, + Event.ROUND_TIMEOUT: OlasWeekDecisionMakingRound, + Event.NO_MAJORITY: OlasWeekDecisionMakingRound, }, - OpenAICallCheckRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.NO_ALLOWANCE: TwitterDecisionMakingRound, - Event.NO_MAJORITY: OpenAICallCheckRound, - Event.ROUND_TIMEOUT: OpenAICallCheckRound, + OlasWeekOpenAICallCheckRound: { + Event.DONE: OlasWeekDecisionMakingRound, + Event.NO_ALLOWANCE: OlasWeekDecisionMakingRound, + Event.NO_MAJORITY: OlasWeekOpenAICallCheckRound, + Event.ROUND_TIMEOUT: OlasWeekOpenAICallCheckRound, }, - TwitterRandomnessRound: { - Event.DONE: TwitterSelectKeepersRound, - Event.NO_MAJORITY: TwitterRandomnessRound, - Event.ROUND_TIMEOUT: TwitterRandomnessRound, + OlasWeekRandomnessRound: { + Event.DONE: OlasWeekSelectKeepersRound, + Event.NO_MAJORITY: OlasWeekRandomnessRound, + Event.ROUND_TIMEOUT: OlasWeekRandomnessRound, }, - TwitterSelectKeepersRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.NO_MAJORITY: TwitterRandomnessRound, - Event.ROUND_TIMEOUT: TwitterRandomnessRound, + OlasWeekSelectKeepersRound: { + Event.DONE: OlasWeekDecisionMakingRound, + Event.NO_MAJORITY: OlasWeekRandomnessRound, + Event.ROUND_TIMEOUT: OlasWeekRandomnessRound, }, - TweetCollectionRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound, - Event.DONE_API_LIMITS: TwitterDecisionMakingRound, - Event.API_ERROR: TweetCollectionRound, - Event.NO_MAJORITY: TwitterRandomnessRound, - Event.ROUND_TIMEOUT: TwitterRandomnessRound, + OlasWeekTweetCollectionRound: { + Event.DONE: OlasWeekDecisionMakingRound, + Event.DONE_MAX_RETRIES: OlasWeekDecisionMakingRound, + Event.DONE_API_LIMITS: OlasWeekDecisionMakingRound, + Event.API_ERROR: OlasWeekTweetCollectionRound, + Event.NO_MAJORITY: OlasWeekRandomnessRound, + Event.ROUND_TIMEOUT: OlasWeekRandomnessRound, }, - TweetEvaluationRound: { - Event.DONE: TwitterDecisionMakingRound, - Event.TWEET_EVALUATION_ROUND_TIMEOUT: TweetEvaluationRound, + OlasWeekEvaluationRound: { + Event.DONE: OlasWeekDecisionMakingRound, + Event.TWEET_EVALUATION_ROUND_TIMEOUT: OlasWeekEvaluationRound, }, FinishedWeekInOlasRound: {}, } @@ -462,7 +461,7 @@ class TwitterScoringAbciApp(AbciApp[Event]): ["ceramic_db", "pending_write", "summary_tweets"] ) db_pre_conditions: Dict[AppState, Set[str]] = { - TwitterDecisionMakingRound: set(), + OlasWeekDecisionMakingRound: set(), } db_post_conditions: Dict[AppState, Set[str]] = { FinishedWeekInOlasRound: { diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index a7f833e5..d5a7a9d0 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -28,7 +28,7 @@ skills: behaviours: main: args: {} - class_name: TwitterScoringRoundBehaviour + class_name: OlasWeekRoundBehaviour handlers: abci: args: {} From 33a098c6826d69ac82f3cc4f6bd019531c989a89 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 09:02:42 +0200 Subject: [PATCH 11/26] fix: generators --- docs/index.md | 2 +- packages/packages.json | 12 ++++++------ .../agents/impact_evaluator/aea-config.yaml | 4 ++-- .../services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../skills/decision_making_abci/skill.yaml | 2 +- .../skills/impact_evaluator_abci/skill.yaml | 6 +++--- packages/valory/skills/olas_week_abci/skill.yaml | 16 ++++++++-------- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/index.md b/docs/index.md index 4ef0293b..d23e9c31 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeiexypybwtf7ojgfksh2xn7vw2xj3s635xvf4kw5asozlcpqk5mfse --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeiblygfboffflc3bkxfeqydzlffahdpzy4ib35w4xl2bml6l36pufy --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 09cb25d9..144e9acb 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua", + "agent/valory/impact_evaluator/0.1.0": "bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeiexypybwtf7ojgfksh2xn7vw2xj3s635xvf4kw5asozlcpqk5mfse", + "service/valory/impact_evaluator/0.1.0": "bafybeiblygfboffflc3bkxfeqydzlffahdpzy4ib35w4xl2bml6l36pufy", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeigc4ok5nr3cltqfttv3rhwo7n2547x7qa5ynjjvzmlaxjwny4jjna", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaman42zlqvjgln7mm5ddniooqe4e6pivpcjj55rb5lupybgktjpm", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,9 +15,9 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4", - "service/valory/impact_evaluator_local/0.1.0": "bafybeic4wtm3qlj2d2f5ozy5ycc3qj7qji4whovx4tjskovyfpesudewni", - "skill/valory/olas_week_abci/0.1.0": "bafybeifattcv4fzrjx7mvitvllh3234ddkljbopnhgmfb3d3kwl5b2sfqu" + "skill/valory/decision_making_abci/0.1.0": "bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a", + "service/valory/impact_evaluator_local/0.1.0": "bafybeigzmvtavcoc4eymgdexn4mjvqnxltnx4fgr3oq3v35p7bqgdwf65a", + "skill/valory/olas_week_abci/0.1.0": "bafybeicitihaxqhzvfwn5gpgkxa25blnkvzeo3mgcnu6fnup6sc2cetjgq" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index e8f55ddd..c7a3401f 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeigc4ok5nr3cltqfttv3rhwo7n2547x7qa5ynjjvzmlaxjwny4jjna +- valory/impact_evaluator_abci:0.1.0:bafybeiaman42zlqvjgln7mm5ddniooqe4e6pivpcjj55rb5lupybgktjpm - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,7 +53,7 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4 +- valory/decision_making_abci:0.1.0:bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije default_ledger: ethereum required_ledgers: diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index e4cb93dd..9d90562f 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua +agent: valory/impact_evaluator:0.1.0:bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 2853b76f..4f0b60b1 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeicm6zyzyhktqjh23fcyui2u6gpzw3ipkzhpsjf4j6mchk76hncgua +agent: valory/impact_evaluator:0.1.0:bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index a14e38fb..0282b833 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -9,7 +9,7 @@ fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la behaviours.py: bafybeid6g2v25st33heykyiceemlhvmd322xcrfrh2uikhqhxpfbaxv7pu dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye - fsm_specification.yaml: bafybeib3knchqkllaz5n5f5mkprr5g6uz5seiulodrowcr4zsfo3fujm2m + fsm_specification.yaml: bafybeihd5kd3pj52wqhki324pwfc5hpigv57tovdyuv3kpsrihsa3ykn6m handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index a9af0fb4..26c25359 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -8,9 +8,9 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeigmhxenrqb2ysjhcm2au2lang4abyny6irkzqqg4dtclz6net6zpy behaviours.py: bafybeibcqolnjh2e7epjt5npmw3denyxgyyxmugirhn5pdwnw5e4ege3xy - composition.py: bafybeieh32giqkzpm2nnmyna3jvd7wacg2o6mzfuigwj4ij2tyc4djkyvq + composition.py: bafybeialteytmbpts5e4fxeivs2fatvujyultp6tpbmvsinlu73dfgjvji dialogues.py: bafybeigjknz4qqynbsltjje46gidg4rftsqw6ybjwegz24wetmycutpzh4 - fsm_specification.yaml: bafybeifpy7qk3psx22xj46izrqznetlgnukanb23ju25q53ydx6sfcctk4 + fsm_specification.yaml: bafybeicyfp5jhurpyhutevkabexrujx7xyywexnq2lfxzwkqmdxdv5ihgq handlers.py: bafybeidkli6fphcmdgwsys4lkyf3fx6fbawet4nt2pnixfypzijhg6b3ze models.py: bafybeifhcshu4iwqvc2fz3auu5ngfykkhvqnroeug52ilrwwc4kowkeg5a tests/__init__.py: bafybeievwzwojvq4aofk5kjpf4jzygfes7ew6s6svc6b6frktjnt3sicce @@ -33,7 +33,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeifptrzwk6wh2jieyjsioekwwiffep6i7msihw3srjjfrqamfubbu4 +- valory/decision_making_abci:0.1.0:bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq behaviours: diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index d5a7a9d0..09ed10e2 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,15 +8,15 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeihxkh6dt5lpc7mm4f7mrxmhe5gqtmorgnndgb2wloqgktikgxsifq + behaviours.py: bafybeiddxjurrxij3o6fw47bv4zwov5rturxlstdlajfyqq4g43sxuba7m ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm - dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si - fsm_specification.yaml: bafybeifirjhxaexbtjyqucshncrcz443sd5jvlvnt2lemeem55ups2hyri - handlers.py: bafybeid3nqvcyotqj5g5hlgrz57nf7vpjysmgvsxe3p7644f4z5dcwqn6u - models.py: bafybeihu3xkh7anfahnjfq354yl4fknlffxpzzthskmoqgiklqmkuz5zme - payloads.py: bafybeify23daknhnrwz2dhy7qpyaaloa6raqeq3dsb4hw4ezkcptwj3lji - prompts.py: bafybeieye3sswl33fli44fthyvclwurzswiccxyqncuxaqwg4nrauw5cbe - rounds.py: bafybeih3qdzcbxborunf6eded7ajxwkc6wq4lllsjfmarid4qtoblbi5di + dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm + fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu + handlers.py: bafybeialoqm2byetvqqrjujhk3qzgdgsrzmhakmzwdop2cr24kswipl6ti + models.py: bafybeif7kefuddm7gkgiwthozsijijegdul7s6z6pkxlld2rqambrevmc4 + payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 + prompts.py: bafybeidb7kevs5nsboodfipkkygk3biuckqwo2kr47lr37u5tyluvms6cu + rounds.py: bafybeihgmejoestbr3l5izuax5kkfjdjoaeqvwguyiyxmvjrp5yqyoqsb4 fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq From 8e90cbbed88e39fb49c725f1a991b0e69ae978ee Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 09:14:30 +0200 Subject: [PATCH 12/26] fix: events --- .gitleaksignore | 1 + docs/index.md | 2 +- packages/packages.json | 12 ++++++------ .../valory/agents/impact_evaluator/aea-config.yaml | 4 ++-- .../valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/decision_making_abci/rounds.py | 2 +- .../valory/skills/decision_making_abci/skill.yaml | 2 +- .../valory/skills/impact_evaluator_abci/skill.yaml | 2 +- packages/valory/skills/olas_week_abci/behaviours.py | 12 ++++++------ packages/valory/skills/olas_week_abci/rounds.py | 10 +++++----- packages/valory/skills/olas_week_abci/skill.yaml | 8 ++++---- 12 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.gitleaksignore b/.gitleaksignore index 136faefe..cbc97235 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -29,3 +29,4 @@ e271cd3303d407521c714253870de451f8617150:packages/valory/skills/decision_making_ d47f7de20573d541505169665c2ae779ea57a4b0:packages/valory/services/impact_evaluator/service.yaml:generic-api-key:245 f91f017c41d644b87699fb06619d5bdb3b568838:packages/valory/services/impact_evaluator_local/service.yaml:generic-api-key:72 32259d88007014423881fa2695c363b84c1eb667:packages/valory/skills/mech_interact_abci/skill.yaml:generic-api-key:80 +549de14725c5e9059ce72242aa00451714ff2296:packages/valory/skills/olas_week_abci/skill.yaml:generic-api-key:88 diff --git a/docs/index.md b/docs/index.md index d23e9c31..4642a08d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeiblygfboffflc3bkxfeqydzlffahdpzy4ib35w4xl2bml6l36pufy --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeiecafwvqtahmsg2rdiq3ni457kcglb6gd2mjelxbb4qo3artxkiva --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 144e9acb..b73ae7f5 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4", + "agent/valory/impact_evaluator/0.1.0": "bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeiblygfboffflc3bkxfeqydzlffahdpzy4ib35w4xl2bml6l36pufy", + "service/valory/impact_evaluator/0.1.0": "bafybeiecafwvqtahmsg2rdiq3ni457kcglb6gd2mjelxbb4qo3artxkiva", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaman42zlqvjgln7mm5ddniooqe4e6pivpcjj55rb5lupybgktjpm", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiblizfrtf2rqx64fuwew3mom56ra3xutlhehfy2ffunbb7vevtrim", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,9 +15,9 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a", - "service/valory/impact_evaluator_local/0.1.0": "bafybeigzmvtavcoc4eymgdexn4mjvqnxltnx4fgr3oq3v35p7bqgdwf65a", - "skill/valory/olas_week_abci/0.1.0": "bafybeicitihaxqhzvfwn5gpgkxa25blnkvzeo3mgcnu6fnup6sc2cetjgq" + "skill/valory/decision_making_abci/0.1.0": "bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m", + "service/valory/impact_evaluator_local/0.1.0": "bafybeibb7psvdwtos43qbwbpw4xl5ezdu2dvrxttpkzewcz3fymwhiwkfa", + "skill/valory/olas_week_abci/0.1.0": "bafybeiemi6gqhodkv3zoynvysfihr237z46ent4tt7xl7cdomzc2mnrjou" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index c7a3401f..d1610e7a 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiaman42zlqvjgln7mm5ddniooqe4e6pivpcjj55rb5lupybgktjpm +- valory/impact_evaluator_abci:0.1.0:bafybeiblizfrtf2rqx64fuwew3mom56ra3xutlhehfy2ffunbb7vevtrim - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,7 +53,7 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a +- valory/decision_making_abci:0.1.0:bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije default_ledger: ethereum required_ledgers: diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 9d90562f..f2d5949b 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4 +agent: valory/impact_evaluator:0.1.0:bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 4f0b60b1..9a68dfdd 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeig5dpad5q45ekr4xse3yf6i6whs2rfvuxdko7l55fms52izkeawo4 +agent: valory/impact_evaluator:0.1.0:bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index 7fc673a5..936a376c 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -168,7 +168,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # Event.NO_MAJORITY, Event.DONE, Event.UPDATE_CENTAURS, Event.READ_CENTAURS, # Event.SCHEDULED_TWEET, Event.LLM, Event.DAILY_ORBIS, Event.DAILY_TWEET, Event.NEXT_CENTAUR # Event.SCORE, Event.READ_CONTRIBUTE_DB, Event.READ_MANUAL_POINTS, Event.WRITE_CONTRIBUTE_DB - # Event.WEEK_IN_OLAS + # Event.WEEK_IN_OLAS_WRITE, Event.WEEK_IN_OLAS_CREATE payload = json.loads(self.most_voted_payload) event = Event(payload["event"]) diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index 0282b833..a0d1e287 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -13,7 +13,7 @@ fingerprint: handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya - rounds.py: bafybeihiuif6suybwodq5yryk7dxwdkj2h7l4yfd336s4g3kydrgfwouy4 + rounds.py: bafybeibpxec2xowhkswbuqpw4npgfrqzh5ktsbwiulg6v5nspuoehzwkfe tasks/finished_pipeline_preparation.py: bafybeifvwzvnw3d2lxlk4p5hd6j2tcxr7bwjewm667ubssoqyfsk4xafd4 tasks/llm_preparation.py: bafybeigi7i5yp7w5hi5mcbzuzdfbfm4j5etsvplbhb2pdjcb3jfcy6qzrq tasks/read_stream_preparation.py: bafybeiespz6kzkzvrjjf3d6ffwse3rufuyrrab3axvg64pxw4jj6zzhwny diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 26c25359..2f80624c 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -33,7 +33,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeihxs27chkfffknsubrx6e7vmarbtvckc5df4cyrgxxzs6m2rccm7a +- valory/decision_making_abci:0.1.0:bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq behaviours: diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index e4accb1f..d4917e82 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -394,8 +394,8 @@ def _sender_act(self) -> Generator: } else: - # Get mentions from Twitter - payload_data = yield from self._get_twitter_mentions( + # Get tweets from Twitter + payload_data = yield from self._get_tweets( number_of_tweets_pulled_today=number_of_tweets_pulled_today ) @@ -411,11 +411,11 @@ def _sender_act(self) -> Generator: self.set_done() - def _get_twitter_mentions( + def _get_tweets( self, number_of_tweets_pulled_today: int, ) -> Generator[None, None, Dict]: - """Get Twitter mentions""" + """Get Tweets""" api_base = self.params.twitter_api_base api_endpoint = self.params.twitter_tweets_args @@ -425,7 +425,7 @@ def _get_twitter_mentions( ) if number_of_tweets_remaining_today <= 0: self.context.logger.info( - "Cannot retrieve twitter mentions, max number of tweets reached for today" + "Cannot retrieve tweets, max number of tweets reached for today" ) return { "tweets": None, @@ -495,7 +495,7 @@ def _get_twitter_mentions( ) self.context.logger.error( - f"Error retrieving mentions from Twitter [{response.status_code}]: {response.body}" + f"Error retrieving tweets from Twitter [{response.status_code}]: {response.body}" f"API limits: {remaining}/{limit}. Window reset: {reset}" ) diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index e496489b..93baef1d 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -144,7 +144,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: if self.threshold_reached: event = Event(self.most_voted_payload) # Reference events to avoid tox -e check-abciapp-specs failures - # Event.DONE, Event.DB_UPDATE, Event.RETRIEVE_MENTIONS, Event.RETRIEVE_TWEETS, Event.OPENAI_CALL_CHECK, Event.EVALUATE, Event.DONE_SKIP, Event.SELECT_KEEPERS + # Event.DONE, Event.RETRIEVE_TWEETS, Event.OPENAI_CALL_CHECK, Event.EVALUATE, Event.DONE_SKIP, Event.SELECT_KEEPERS return self.synchronized_data, event if not self.is_majority_possible( self.collection, self.synchronized_data.nb_participants @@ -200,7 +200,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: class OlasWeekTweetCollectionRound(CollectSameUntilThresholdRound): - """TwitterMentionsCollectionRound""" + """OlasWeekTweetCollectionRound""" payload_class = OlasWeekTweetCollectionPayload synchronized_data_class = SynchronizedData @@ -245,7 +245,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # API limits if payload["error"] == ERROR_API_LIMITS: performed_olas_week_tasks[ - "retrieve_mentions" + "retrieve_tweets" ] = Event.DONE_MAX_RETRIES.value synchronized_data = self.synchronized_data.update( @@ -268,7 +268,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # Other API errors if api_retries >= MAX_API_RETRIES: performed_olas_week_tasks[ - "retrieve_mentions" + "retrieve_tweets" ] = Event.DONE_MAX_RETRIES.value synchronized_data = self.synchronized_data.update( synchronized_data_class=SynchronizedData, @@ -295,7 +295,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # Happy path weekly_tweets = cast(SynchronizedData, self.synchronized_data).tweets - performed_olas_week_tasks["retrieve_mentions"] = Event.DONE.value + performed_olas_week_tasks["retrieve_tweets"] = Event.DONE.value updates = { get_name(SynchronizedData.weekly_tweets): weekly_tweets, diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index 09ed10e2..aee64147 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -2,13 +2,13 @@ name: olas_week_abci author: valory version: 0.1.0 type: skill -description: A skill that reads mentions from the Twitter API and assigns scores to - the users. +description: A skill that weekly tweets from a Twitter account and creates a summary + using a LLM. license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeiddxjurrxij3o6fw47bv4zwov5rturxlstdlajfyqq4g43sxuba7m + behaviours.py: bafybeibyy5z5qschybwbrheivotsw5hto3tv4ofenjqa6xxdz6ehnqqvze ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu @@ -16,7 +16,7 @@ fingerprint: models.py: bafybeif7kefuddm7gkgiwthozsijijegdul7s6z6pkxlld2rqambrevmc4 payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 prompts.py: bafybeidb7kevs5nsboodfipkkygk3biuckqwo2kr47lr37u5tyluvms6cu - rounds.py: bafybeihgmejoestbr3l5izuax5kkfjdjoaeqvwguyiyxmvjrp5yqyoqsb4 + rounds.py: bafybeid2jlyzc3zctvhn55tpvkban7qva34whhpd2h7lnhwmuz6pefm4km fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq From 205e21fa93c85577b5e27cfe3aa893aa738eed3a Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 09:58:52 +0200 Subject: [PATCH 13/26] fix: tox linter commands --- packages/packages.json | 2 +- .../skills/olas_week_abci/behaviours.py | 21 ++++++++++--------- .../valory/skills/olas_week_abci/rounds.py | 5 +++-- .../valory/skills/olas_week_abci/skill.yaml | 4 ++-- tox.ini | 14 +++++++++---- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index b73ae7f5..2ba66305 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,7 +17,7 @@ "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m", "service/valory/impact_evaluator_local/0.1.0": "bafybeibb7psvdwtos43qbwbpw4xl5ezdu2dvrxttpkzewcz3fymwhiwkfa", - "skill/valory/olas_week_abci/0.1.0": "bafybeiemi6gqhodkv3zoynvysfihr237z46ent4tt7xl7cdomzc2mnrjou" + "skill/valory/olas_week_abci/0.1.0": "bafybeibaeqme3bbocaiyi5vzo2ij6avxtyjxryjkab6wtsckl6un764i2y" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index d4917e82..083e8b4d 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -37,7 +37,6 @@ ) from packages.valory.skills.abstract_round_abci.common import RandomnessBehaviour from packages.valory.skills.abstract_round_abci.models import Requests -from packages.valory.skills.olas_week_abci.ceramic_db import CeramicDB from packages.valory.skills.olas_week_abci.dialogues import LlmDialogue, LlmDialogues from packages.valory.skills.olas_week_abci.models import ( OpenAICalls, @@ -439,7 +438,7 @@ def _get_tweets( SharedState, self.context.state ).round_sequence.last_round_transition_timestamp.timestamp() - start_time = datetime.fromtimestamp(now_ts) - timedelta(days = 7) + start_time = datetime.fromtimestamp(now_ts) - timedelta(days=7) start_time_str = start_time.strftime("%Y-%m-%dT%H:%M:%S:00Z") @@ -571,9 +570,7 @@ def _get_tweets( break - self.context.logger.info( - f"Got {len(tweets)} new tweets" - ) + self.context.logger.info(f"Got {len(tweets)} new tweets") return { "tweets": tweets, @@ -591,15 +588,19 @@ def async_act(self) -> Generator: """Do the act, supporting asynchronous execution.""" with self.context.benchmark_tool.measure(self.behaviour_id).local(): - text = "\n\n".join([f"tweet_{i}: {tweet}" for i, tweet in enumerate(self.synchronized_data.weekly_tweets)]) - - summary_tweets = yield from self.evaluate_summary( - text + text = "\n\n".join( + [ + f"tweet_{i}: {tweet}" + for i, tweet in enumerate(self.synchronized_data.weekly_tweets) + ] ) + summary_tweets = yield from self.evaluate_summary(text) + sender = self.context.agent_address payload = OlasWeekEvaluationPayload( - sender=sender, content=json.dumps({"summary_tweets": summary_tweets}, sort_keys=True) + sender=sender, + content=json.dumps({"summary_tweets": summary_tweets}, sort_keys=True), ) with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index 93baef1d..357a8e56 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -69,7 +69,6 @@ class Event(Enum): EVALUATE = "evaluate" - class SynchronizedData(BaseSynchronizedData): """ Class to represent the synchronized data. @@ -342,7 +341,9 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: synchronized_data = self.synchronized_data.update( synchronized_data_class=SynchronizedData, **{ - get_name(SynchronizedData.summary_tweets): self.keeper_payload["summary_tweets"], + get_name(SynchronizedData.summary_tweets): self.keeper_payload[ + "summary_tweets" + ], get_name( SynchronizedData.performed_olas_week_tasks ): performed_olas_week_tasks, diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index aee64147..d2fd7ae1 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeibyy5z5qschybwbrheivotsw5hto3tv4ofenjqa6xxdz6ehnqqvze + behaviours.py: bafybeicewuwk4sbi5jqvxdwe2qjaoq6w2xkhh47tld4zrnieb6bju2btpu ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu @@ -16,7 +16,7 @@ fingerprint: models.py: bafybeif7kefuddm7gkgiwthozsijijegdul7s6z6pkxlld2rqambrevmc4 payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 prompts.py: bafybeidb7kevs5nsboodfipkkygk3biuckqwo2kr47lr37u5tyluvms6cu - rounds.py: bafybeid2jlyzc3zctvhn55tpvkban7qva34whhpd2h7lnhwmuz6pefm4km + rounds.py: bafybeifxarx2mqwj5chtlhbdprew6767uyttmtikodzlquwn4fvwvuraqy fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq diff --git a/tox.ini b/tox.ini index 4bc8b124..a8e231a5 100644 --- a/tox.ini +++ b/tox.ini @@ -241,7 +241,8 @@ commands = black \ {env:SKILLS_PATHS}/impact_evaluator_abci \ {env:SKILLS_PATHS}/decision_making_abci \ {env:SKILLS_PATHS}/llm_abci \ - {env:SKILLS_PATHS}/twitter_write_abci + {env:SKILLS_PATHS}/twitter_write_abci \ + {env:SKILLS_PATHS}/olas_week_abci [testenv:black-check] skipsdist = True @@ -257,7 +258,8 @@ commands = black --check \ {env:SKILLS_PATHS}/impact_evaluator_abci \ {env:SKILLS_PATHS}/decision_making_abci \ {env:SKILLS_PATHS}/llm_abci \ - {env:SKILLS_PATHS}/twitter_write_abci + {env:SKILLS_PATHS}/twitter_write_abci \ + {env:SKILLS_PATHS}/olas_week_abci [testenv:isort] skipsdist = True @@ -305,7 +307,8 @@ commands = flake8 \ {env:SKILLS_PATHS}/impact_evaluator_abci \ {env:SKILLS_PATHS}/decision_making_abci \ {env:SKILLS_PATHS}/llm_abci \ - {env:SKILLS_PATHS}/twitter_write_abci + {env:SKILLS_PATHS}/twitter_write_abci \ + {env:SKILLS_PATHS}/olas_week_abci [testenv:mypy] skipsdist = True @@ -323,6 +326,7 @@ commands = mypy --disallow-untyped-defs \ {env:SKILLS_PATHS}/decision_making_abci \ {env:SKILLS_PATHS}/llm_abci \ {env:SKILLS_PATHS}/twitter_write_abci \ + {env:SKILLS_PATHS}/olas_week_abci \ --config-file tox.ini [testenv:pylint] @@ -344,6 +348,7 @@ commands = pylint \ {env:SKILLS_PATHS}/decision_making_abci \ {env:SKILLS_PATHS}/llm_abci \ {env:SKILLS_PATHS}/twitter_write_abci \ + {env:SKILLS_PATHS}/olas_week_abci \ scripts [testenv:safety] @@ -366,7 +371,8 @@ commands = darglint \ {env:SKILLS_PATHS}/impact_evaluator_abci/* \ {env:SKILLS_PATHS}/decision_making_abci/* \ {env:SKILLS_PATHS}/llm_abci/* \ - {env:SKILLS_PATHS}/twitter_write_abci/* + {env:SKILLS_PATHS}/twitter_write_abci/* \ + {env:SKILLS_PATHS}/olas_week_abci/* [testenv:check-generate-all-protocols] skipsdist = True From c5dd32ca59eb039b6018cfad3b0a997b8cd3490d Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 10:19:42 +0200 Subject: [PATCH 14/26] fix: behaviour chaining --- docs/index.md | 2 +- packages/packages.json | 10 +++++----- .../valory/agents/impact_evaluator/aea-config.yaml | 2 +- packages/valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/impact_evaluator_abci/behaviours.py | 2 ++ .../valory/skills/impact_evaluator_abci/skill.yaml | 2 +- packages/valory/skills/olas_week_abci/behaviours.py | 4 ++-- packages/valory/skills/olas_week_abci/skill.yaml | 2 +- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/index.md b/docs/index.md index 4642a08d..d8a3d005 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeiecafwvqtahmsg2rdiq3ni457kcglb6gd2mjelxbb4qo3artxkiva --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeia5mvi6qtqaxgief2bpxdmhwhjs5lf7aj7mgifmlgh3n4m3h42iae --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 2ba66305..db8e7513 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om", + "agent/valory/impact_evaluator/0.1.0": "bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeiecafwvqtahmsg2rdiq3ni457kcglb6gd2mjelxbb4qo3artxkiva", + "service/valory/impact_evaluator/0.1.0": "bafybeia5mvi6qtqaxgief2bpxdmhwhjs5lf7aj7mgifmlgh3n4m3h42iae", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiblizfrtf2rqx64fuwew3mom56ra3xutlhehfy2ffunbb7vevtrim", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaipjfkfpwhep2exzxurxkxkcch3l5dww73abw7xtfor2xwp4ec4e", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,8 +16,8 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m", - "service/valory/impact_evaluator_local/0.1.0": "bafybeibb7psvdwtos43qbwbpw4xl5ezdu2dvrxttpkzewcz3fymwhiwkfa", - "skill/valory/olas_week_abci/0.1.0": "bafybeibaeqme3bbocaiyi5vzo2ij6avxtyjxryjkab6wtsckl6un764i2y" + "service/valory/impact_evaluator_local/0.1.0": "bafybeieiyqcufkk5qdd6kwsolpixbnrbbdawzjp442rk53lvyz4awvv2gu", + "skill/valory/olas_week_abci/0.1.0": "bafybeig33tzhhxcxunxzjfr2bww3x2v5z5de4ed5cmrxwqs3sz2gm3nkvu" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index d1610e7a..abc38c97 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiblizfrtf2rqx64fuwew3mom56ra3xutlhehfy2ffunbb7vevtrim +- valory/impact_evaluator_abci:0.1.0:bafybeiaipjfkfpwhep2exzxurxkxkcch3l5dww73abw7xtfor2xwp4ec4e - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index f2d5949b..d1557c74 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om +agent: valory/impact_evaluator:0.1.0:bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 9a68dfdd..acffd283 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihz4dayied3lvzcb5b7ga3mxjvq6aqop3t6geety7c2hyk4rci7om +agent: valory/impact_evaluator:0.1.0:bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/behaviours.py b/packages/valory/skills/impact_evaluator_abci/behaviours.py index 13f95c57..4914d066 100644 --- a/packages/valory/skills/impact_evaluator_abci/behaviours.py +++ b/packages/valory/skills/impact_evaluator_abci/behaviours.py @@ -41,6 +41,7 @@ ImpactEvaluatorSkillAbciApp, ) from packages.valory.skills.llm_abci.behaviours import LLMRoundBehaviour +from packages.valory.skills.olas_week_abci.behaviours import OlasWeekRoundBehaviour from packages.valory.skills.registration_abci.behaviours import ( AgentRegistrationRoundBehaviour, RegistrationStartupBehaviour, @@ -81,5 +82,6 @@ class ImpactEvaluatorConsensusBehaviour(AbstractRoundBehaviour): *ResetPauseABCIConsensusBehaviour.behaviours, *TransactionSettlementRoundBehaviour.behaviours, *TerminationAbciBehaviours.behaviours, + *OlasWeekRoundBehaviour.behaviours, } background_behaviours_cls = {BackgroundBehaviour} diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 2f80624c..e9e2d471 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeigmhxenrqb2ysjhcm2au2lang4abyny6irkzqqg4dtclz6net6zpy - behaviours.py: bafybeibcqolnjh2e7epjt5npmw3denyxgyyxmugirhn5pdwnw5e4ege3xy + behaviours.py: bafybeia53iegibc2svkyw6ovhs7f32tig2ut2okvogyaaeoijo3uj5l6ke composition.py: bafybeialteytmbpts5e4fxeivs2fatvujyultp6tpbmvsinlu73dfgjvji dialogues.py: bafybeigjknz4qqynbsltjje46gidg4rftsqw6ybjwegz24wetmycutpzh4 fsm_specification.yaml: bafybeicyfp5jhurpyhutevkabexrujx7xyywexnq2lfxzwkqmdxdv5ihgq diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index 083e8b4d..ecaa5537 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -306,7 +306,7 @@ def get_next_event(self) -> str: return Event.DONE.value -class OpenAICallCheckBehaviour(OlasWeekBaseBehaviour): +class OlasWeekOpenAICallCheckBehaviour(OlasWeekBaseBehaviour): """OlasWeekTweetCollectionBehaviour""" matching_round: Type[AbstractRound] = OlasWeekOpenAICallCheckRound @@ -666,7 +666,7 @@ class OlasWeekRoundBehaviour(AbstractRoundBehaviour): abci_app_cls = WeekInOlasAbciApp # type: ignore behaviours: Set[Type[BaseBehaviour]] = [ OlasWeekDecisionMakingBehaviour, - OpenAICallCheckBehaviour, + OlasWeekOpenAICallCheckBehaviour, OlasWeekTweetCollectionBehaviour, OlasWeekEvaluationBehaviour, OlasWeekRandomnessBehaviour, diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index d2fd7ae1..8058ce58 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeicewuwk4sbi5jqvxdwe2qjaoq6w2xkhh47tld4zrnieb6bju2btpu + behaviours.py: bafybeiebm4aub3pbqau75bgvmvgjamhfmsqakyrhpqonbqolmseu7pkxpu ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu From 2412528218720a68f65204f34dc021e3f1a6e6e3 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 11:25:09 +0200 Subject: [PATCH 15/26] fix: dont publish weekly tweet, just propose --- .../skills/decision_making_abci/behaviours.py | 5 --- .../skills/decision_making_abci/rounds.py | 4 +-- .../tasks/twitter_preparation.py | 26 ---------------- .../tasks/week_in_olas_preparations.py | 31 +++++++++++++++++-- 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/packages/valory/skills/decision_making_abci/behaviours.py b/packages/valory/skills/decision_making_abci/behaviours.py index 247c4ac7..a15e1f16 100644 --- a/packages/valory/skills/decision_making_abci/behaviours.py +++ b/packages/valory/skills/decision_making_abci/behaviours.py @@ -54,7 +54,6 @@ from packages.valory.skills.decision_making_abci.tasks.twitter_preparation import ( DailyTweetPreparation, ScheduledTweetPreparation, - WeekInOlasWritePreparation, ) from packages.valory.skills.decision_making_abci.tasks.week_in_olas_preparations import ( WeekInOlasCreatePreparation, @@ -90,10 +89,6 @@ }, Event.WEEK_IN_OLAS_CREATE.value: { "prev": WeekInOlasCreatePreparation, - "next": WeekInOlasWritePreparation, - }, - Event.WEEK_IN_OLAS_WRITE.value: { - "prev": WeekInOlasWritePreparation, "next": ScheduledTweetPreparation, }, Event.SCHEDULED_TWEET.value: { diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index 936a376c..7e4661a9 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -57,7 +57,6 @@ class Event(Enum): READ_MANUAL_POINTS = "read_manual_points" WRITE_CONTRIBUTE_DB = "write_contribute_db" WEEK_IN_OLAS_CREATE = "week_in_olas_create" - WEEK_IN_OLAS_WRITE = "week_in_olas_write" class SynchronizedData(BaseSynchronizedData): @@ -168,7 +167,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: # Event.NO_MAJORITY, Event.DONE, Event.UPDATE_CENTAURS, Event.READ_CENTAURS, # Event.SCHEDULED_TWEET, Event.LLM, Event.DAILY_ORBIS, Event.DAILY_TWEET, Event.NEXT_CENTAUR # Event.SCORE, Event.READ_CONTRIBUTE_DB, Event.READ_MANUAL_POINTS, Event.WRITE_CONTRIBUTE_DB - # Event.WEEK_IN_OLAS_WRITE, Event.WEEK_IN_OLAS_CREATE + # Event.WEEK_IN_OLAS_CREATE payload = json.loads(self.most_voted_payload) event = Event(payload["event"]) @@ -254,7 +253,6 @@ class DecisionMakingAbciApp(AbciApp[Event]): Event.DAILY_TWEET: FinishedDecisionMakingWriteTwitterRound, Event.SCHEDULED_TWEET: FinishedDecisionMakingWriteTwitterRound, Event.WEEK_IN_OLAS_CREATE: FinishedDecisionMakingWeekInOlasRound, - Event.WEEK_IN_OLAS_WRITE: FinishedDecisionMakingWriteTwitterRound, Event.DAILY_ORBIS: FinishedDecisionMakingWriteOrbisRound, Event.UPDATE_CENTAURS: FinishedDecisionMakingUpdateCentaurRound, Event.SCORE: FinishedDecisionMakingScoreRound, diff --git a/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py b/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py index 25d8b6cc..b2694c9d 100644 --- a/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py +++ b/packages/valory/skills/decision_making_abci/tasks/twitter_preparation.py @@ -223,29 +223,3 @@ def check_tweet_consensus(self, voters: dict): """Check whether users agree on posting""" voting_power = sum([int(list(v.values())[0]) for v in voters]) return voting_power >= TWEET_CONSENSUS_WVEOLAS_WEI - - -class WeekInOlasWritePreparation(TwitterPreparation): - """WeekInOlasWritePreparation""" - - task_name = "week_in_olas" - task_event = Event.WEEK_IN_OLAS_WRITE.value - - def get_tweet(self): - """Get the tweet""" - return self.synchronized_data.weekly_tweets - - def _post_task(self): - """Task postprocessing""" - updates, event = super()._post_task() - - # Update the last run time - centaurs_data = updates["centaurs_data"] - current_centaur = centaurs_data[self.synchronized_data.current_centaur_index] - current_centaur["configuration"]["plugins"]["week_in_olas"][ - "last_run" - ] = self.now_utc.strftime("%Y-%m-%d %H:%M:%S %Z") - - updates["centaurs_data"] = centaurs_data - - return updates, event diff --git a/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py index 18b74061..beafded2 100644 --- a/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py +++ b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py @@ -18,6 +18,8 @@ # ------------------------------------------------------------------------------ """This package contains the logic for task preparations.""" +import uuid + from packages.valory.skills.decision_making_abci.rounds import Event from packages.valory.skills.decision_making_abci.tasks.task_preparations import ( TaskPreparation, @@ -40,6 +42,29 @@ def _pre_task(self): return updates, self.task_event def _post_task(self): - """Preparations after running the task""" - updates = {} - return updates, None + """Task postprocessing""" + updates, event = super()._post_task() + + # Update the last run time + centaurs_data = updates["centaurs_data"] + current_centaur = centaurs_data[self.synchronized_data.current_centaur_index] + current_centaur["configuration"]["plugins"]["week_in_olas"][ + "last_run" + ] = self.now_utc.strftime("%Y-%m-%d %H:%M:%S %Z") + + # Add the new thread to proposed tweets + thread = { + "text": self.synchronized_data.summary_tweets, + "posted": False, + "voters": [], + "execute": False, + "proposer": "0x12b680F1Ffb678598eFC0C57BB2edCAebB762A9A", # safe address + "request_id": str(uuid.UUID(int=int(self.now_utc.timestamp()))), + "createdDate": self.now_utc.timestamp(), + } + + current_centaur["plugins_data"]["week_in_olas"]["tweets"].append(thread) + + updates["centaurs_data"] = centaurs_data + + return updates, event From 7f6ae538e1e97a9578279a3d25d284f9165868fb Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:06:28 +0200 Subject: [PATCH 16/26] fix: update prompt --- .../skills/olas_week_abci/behaviours.py | 21 +++++++------ .../valory/skills/olas_week_abci/prompts.py | 30 ++++++++++++------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index ecaa5537..358188a0 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -89,17 +89,16 @@ def extract_headers(header_str: str) -> dict: def parse_summary(summary: str) -> list: """Parse the tweet summary""" - if summary.startswith("Summary: "): - summary = summary.replace("Summary: ", "") - - tweets = [] - for sentence in summary.split("."): - sentence = sentence.strip() - while len(sentence) > MAX_TWEET_CHARS: - tweets.append(sentence[:MAX_TWEET_CHARS]) - sentence = sentence[MAX_TWEET_CHARS:] - if not tweets: - tweets.append(sentence) + highlights = [h[1:].strip() for h in summary.split("\n") if h.startswith("-")] + + tweets = ["Week in Olas\n\nHighlights included:"] + for highlight in highlights: + if len(highlight) > MAX_TWEET_CHARS: + while len(highlight) > MAX_TWEET_CHARS: + tweets.append(highlight[:MAX_TWEET_CHARS]) + highlight = highlight[MAX_TWEET_CHARS:] + else: + tweets.append(highlight) return tweets diff --git a/packages/valory/skills/olas_week_abci/prompts.py b/packages/valory/skills/olas_week_abci/prompts.py index d149bb8b..2f49c1f9 100644 --- a/packages/valory/skills/olas_week_abci/prompts.py +++ b/packages/valory/skills/olas_week_abci/prompts.py @@ -20,23 +20,26 @@ """This package contains LLM prompts for WeekInOlasAbciApp.""" tweet_summarizer_prompt = """ -You are an AI tweet summarizer that needs to create concise pieces of content using tweets from your users. These users will write about what happened during the last week in Autonolas, a web3 protocol focused on building decentralized autonomous services. Your task is to summarize all the content from your users in a few short paragraphs that tells the story of what happened during the last week in the Autonolas protocol. You will be given a text about Autonolas as well as the user tweets. +You are an AI tweet summarizer that needs to create concise pieces of content using tweets from your users. +These users will write about what happened during the last week in Olas, a web3 protocol focused on building decentralized autonomous services. +Your task is to summarize all the content from your users in a few short sentences that tells the story of what happened during the last week in the Olas protocol. +You will be given a text about Olas as well as the user tweets. GOALS: -1. Summarize the user tweets in the context of what happened during last week in the Autonolas space +1. Summarize the user tweets in the context of what happened during last week in the Olas space, using a list of highlights. -For the given goal, only respond with a short summary of all the Autonolas news. +For the given goal, only respond with a short item list that summarizes all the Olas news. -Autonolas text: +Olas text: Technical Architecture: -Autonolas autonomous software services are embodied as agent services, which are groups of independent computer programs that interact with each other to achieve a predetermined goal. They can be understood as logically centralized applications (with only one application state and logic) that are replicated in a distributed system. Agent services are made of code components that can be combined like Lego bricks through software composition. This is enabled and incentivized by the on-chain protocol, which facilitates developers publishing and finding code components to build and extend new services. The on-chain protocol implements registries that enable code components, agents, and services to be found, reused, and economically compensated. +Olas autonomous software services are embodied as agent services, which are groups of independent computer programs that interact with each other to achieve a predetermined goal. They can be understood as logically centralized applications (with only one application state and logic) that are replicated in a distributed system. Agent services are made of code components that can be combined like Lego bricks through software composition. This is enabled and incentivized by the on-chain protocol, which facilitates developers publishing and finding code components to build and extend new services. The on-chain protocol implements registries that enable code components, agents, and services to be found, reused, and economically compensated. -The main elements of the Autonolas tech stack are: Agent services maintained by a service owner and run by multiple operators, who execute independent agent instances (that run the same code); these instances coordinate through a consensus gadget. Composable autonomous apps built out of basic applications that are easily extendable and composable into higher-order applications. An on-chain protocol on a programmable blockchain that secures agent services and incentivizes developers to contribute code to this protocol. +The main elements of the Olas tech stack are: Agent services maintained by a service owner and run by multiple operators, who execute independent agent instances (that run the same code); these instances coordinate through a consensus gadget. Composable autonomous apps built out of basic applications that are easily extendable and composable into higher-order applications. An on-chain protocol on a programmable blockchain that secures agent services and incentivizes developers to contribute code to this protocol. Tokenomics: -Autonolas tokenomics focuses on three objectives: +Olas tokenomics focuses on three objectives: 1/ Growing capital and code proportionally: On-chain mechanisms ensure that the code provided by developers is rewarded according to its usefulness to the services operated on the protocol. The protocol acquires protocol-owned liquidity (PoL) in proportion to code usefulness, allowing the protocol to generate returns, invest in services, and guarantee its long-term financial health. @@ -50,16 +53,23 @@ This composability leads to combinatorial expansion and unprecedented new applications. Governance: -A crucial element of the success of Autonolas is to have an active community and ecosystem that both build, evolve, promote, and make use of Autonolas technology. For this reason, Autonolas is organized as a DAO where meaningful contributors and supporters participate in the decision-making process. +A crucial element of the success of Olas is to have an active community and ecosystem that both build, evolve, promote, and make use of Olas technology. For this reason, Olas is organized as a DAO where meaningful contributors and supporters participate in the decision-making process. -Initially, holders of the virtualized veOLAS token can participate in any governance activities. The veOLAS token is obtained by locking OLAS, which is the native token of Autonolas. Governance participation is proportional to veOLAS holdings and their locking duration. Governance proposals can notably modify system parameters, support new technological directions, or add entirely new functionality to the on-chain protocol. +Initially, holders of the virtualized veOLAS token can participate in any governance activities. The veOLAS token is obtained by locking OLAS, which is the native token of Olas. Governance participation is proportional to veOLAS holdings and their locking duration. Governance proposals can notably modify system parameters, support new technological directions, or add entirely new functionality to the on-chain protocol. Once a governance proposal is approved, the Timelock adds a delay for the proposal to be executed. -Exceptionally, some changes to the Autonolas on-chain protocol could be executed by a community-owned multi-sig wallet, bypassing the governance process. +Exceptionally, some changes to the Olas on-chain protocol could be executed by a community-owned multi-sig wallet, bypassing the governance process. This allows a set of trusted actors to overrule governance in certain aspects, e.g., a security exploit that needs to be patched without governance discussion. + +You should only respond in the format described below: +- Highlight 1 +- Highligth 2 +- ... + + User tweets: {user_tweets} """ From a3f7753e9674bdf1e0eff027768bd8f992965c9f Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:11:15 +0200 Subject: [PATCH 17/26] fix: generators --- docs/index.md | 2 +- packages/packages.json | 12 ++++++------ .../valory/agents/impact_evaluator/aea-config.yaml | 4 ++-- .../valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/decision_making_abci/skill.yaml | 8 ++++---- .../valory/skills/impact_evaluator_abci/skill.yaml | 2 +- packages/valory/skills/olas_week_abci/skill.yaml | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/index.md b/docs/index.md index d8a3d005..0fe3c234 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeia5mvi6qtqaxgief2bpxdmhwhjs5lf7aj7mgifmlgh3n4m3h42iae --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeidbdcm2g7rcda55ucbcly7t2owi34gzc6l7lnl6pb5ut5dujm4r3a --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index db8e7513..91227288 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna", + "agent/valory/impact_evaluator/0.1.0": "bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeia5mvi6qtqaxgief2bpxdmhwhjs5lf7aj7mgifmlgh3n4m3h42iae", + "service/valory/impact_evaluator/0.1.0": "bafybeidbdcm2g7rcda55ucbcly7t2owi34gzc6l7lnl6pb5ut5dujm4r3a", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaipjfkfpwhep2exzxurxkxkcch3l5dww73abw7xtfor2xwp4ec4e", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeibz6zzcqka6evovc434q73tmsa2nhj5l4zojk6rfs2hpagkh5qibe", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,9 +15,9 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m", - "service/valory/impact_evaluator_local/0.1.0": "bafybeieiyqcufkk5qdd6kwsolpixbnrbbdawzjp442rk53lvyz4awvv2gu", - "skill/valory/olas_week_abci/0.1.0": "bafybeig33tzhhxcxunxzjfr2bww3x2v5z5de4ed5cmrxwqs3sz2gm3nkvu" + "skill/valory/decision_making_abci/0.1.0": "bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby", + "service/valory/impact_evaluator_local/0.1.0": "bafybeid3ggsfrkmkxthbjugjudom6kwuiy74tnzyetgezqwlbbb2artqni", + "skill/valory/olas_week_abci/0.1.0": "bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index abc38c97..72c655ca 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiaipjfkfpwhep2exzxurxkxkcch3l5dww73abw7xtfor2xwp4ec4e +- valory/impact_evaluator_abci:0.1.0:bafybeibz6zzcqka6evovc434q73tmsa2nhj5l4zojk6rfs2hpagkh5qibe - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,7 +53,7 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m +- valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije default_ledger: ethereum required_ledgers: diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index d1557c74..19bafb22 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna +agent: valory/impact_evaluator:0.1.0:bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index acffd283..bebb8ced 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiegh7rmihamwqijaflg76jeefrgzva7uhlqwpus3z23yiy745olna +agent: valory/impact_evaluator:0.1.0:bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index a0d1e287..cda31e39 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -7,20 +7,20 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la - behaviours.py: bafybeid6g2v25st33heykyiceemlhvmd322xcrfrh2uikhqhxpfbaxv7pu + behaviours.py: bafybeigcj565ei6widhhsr6gkxkmvxiab6ahdihxzyj7fy2zc6kaehn34y dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye fsm_specification.yaml: bafybeihd5kd3pj52wqhki324pwfc5hpigv57tovdyuv3kpsrihsa3ykn6m handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya - rounds.py: bafybeibpxec2xowhkswbuqpw4npgfrqzh5ktsbwiulg6v5nspuoehzwkfe + rounds.py: bafybeifh544cvkomhii6vakzqqepbzpeo63b3uw2fggfqbabaksbmthlue tasks/finished_pipeline_preparation.py: bafybeifvwzvnw3d2lxlk4p5hd6j2tcxr7bwjewm667ubssoqyfsk4xafd4 tasks/llm_preparation.py: bafybeigi7i5yp7w5hi5mcbzuzdfbfm4j5etsvplbhb2pdjcb3jfcy6qzrq tasks/read_stream_preparation.py: bafybeiespz6kzkzvrjjf3d6ffwse3rufuyrrab3axvg64pxw4jj6zzhwny tasks/score_preparations.py: bafybeieiesjkyjbcvqut3l6nlzcwpidibsmo3mz7j6p54lbqzspfcf3ram tasks/task_preparations.py: bafybeiao4zyitjb2nujyhkhjfkd3mq5d4blbcybyfw27hcnc643yzp6ueq - tasks/twitter_preparation.py: bafybeiaaokuz5brzy3vuvjk456jae4tbfrdxcakv7zdmqaobegti65dewq - tasks/week_in_olas_preparations.py: bafybeiewu2b3dz6nl7lddzikzgc6a7kbg5sllp5pl32b34xchfgednvxpm + tasks/twitter_preparation.py: bafybeieoa5wkhg55w2bdbkwawdz4kh4wmifzgtcmzi3ursi3oaxvpu4mom + tasks/week_in_olas_preparations.py: bafybeie3jy7uemtsjrqv6rta6kxc2rvddv7vy6dzziqsrxiovtvvxo5if4 tasks/write_stream_preparation.py: bafybeifl4j7s575ts6x4msntymkempwguj4yypmxy2xjmffknn7qhkzfo4 tests/__init__.py: bafybeiff447fuzkdgyp5yoqqstzv2pyi2uiokng6lzrtfnsgspocghwypi tests/centaur_configs.py: bafybeifgmz5nlpfj4ynpzywbwnnuhz2dxookezwhxmvzlucjbhugv3tgma diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index e9e2d471..d1af0823 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -33,7 +33,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeifbrpsupl2pnvvjg32rfv7rfkjbfljevcjdlnwoasv7hne4ctks2m +- valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq behaviours: diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index 8058ce58..1f4a68ce 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,14 +8,14 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeiebm4aub3pbqau75bgvmvgjamhfmsqakyrhpqonbqolmseu7pkxpu + behaviours.py: bafybeiarpemlqyaakx2ys4bfjej6mnpgmnchhzw46wq5bu4e3fh4hvyqy4 ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu handlers.py: bafybeialoqm2byetvqqrjujhk3qzgdgsrzmhakmzwdop2cr24kswipl6ti models.py: bafybeif7kefuddm7gkgiwthozsijijegdul7s6z6pkxlld2rqambrevmc4 payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 - prompts.py: bafybeidb7kevs5nsboodfipkkygk3biuckqwo2kr47lr37u5tyluvms6cu + prompts.py: bafybeicz63x6rhrgm5amjkfsovnqvxqyzicfhhae3orw7jaubme2npnn2a rounds.py: bafybeifxarx2mqwj5chtlhbdprew6767uyttmtikodzlquwn4fvwvuraqy fingerprint_ignore_patterns: [] connections: From bd9f65cebd2c4806c400b1d8fb52d1a4aaefe925 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:26:23 +0200 Subject: [PATCH 18/26] fix: configs --- docs/index.md | 2 +- packages/packages.json | 8 ++++---- .../valory/agents/impact_evaluator/aea-config.yaml | 4 +++- packages/valory/services/impact_evaluator/service.yaml | 10 +++++++++- .../services/impact_evaluator_local/service.yaml | 4 +++- .../valory/skills/impact_evaluator_abci/skill.yaml | 2 ++ 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/index.md b/docs/index.md index 0fe3c234..be0ce0a5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeidbdcm2g7rcda55ucbcly7t2owi34gzc6l7lnl6pb5ut5dujm4r3a --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeidvslopufaiqjuwcutfgcaaozorw7jueoq33uuncyd2igwrp2ig7a --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 91227288..ac726edb 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq", + "agent/valory/impact_evaluator/0.1.0": "bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeidbdcm2g7rcda55ucbcly7t2owi34gzc6l7lnl6pb5ut5dujm4r3a", + "service/valory/impact_evaluator/0.1.0": "bafybeidvslopufaiqjuwcutfgcaaozorw7jueoq33uuncyd2igwrp2ig7a", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeibz6zzcqka6evovc434q73tmsa2nhj5l4zojk6rfs2hpagkh5qibe", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeieuire3besgw2caakbcptcraenbmsrd7zgbc7poux6xbhekdjuf2m", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,7 +16,7 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby", - "service/valory/impact_evaluator_local/0.1.0": "bafybeid3ggsfrkmkxthbjugjudom6kwuiy74tnzyetgezqwlbbb2artqni", + "service/valory/impact_evaluator_local/0.1.0": "bafybeidu5zc2e74qc7resce2tc2q6yortxl5o5q3evzaloeldpzblkj4w4", "skill/valory/olas_week_abci/0.1.0": "bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4" }, "third_party": { diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 72c655ca..2c0f300e 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeibz6zzcqka6evovc434q73tmsa2nhj5l4zojk6rfs2hpagkh5qibe +- valory/impact_evaluator_abci:0.1.0:bafybeieuire3besgw2caakbcptcraenbmsrd7zgbc7poux6xbhekdjuf2m - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -213,6 +213,8 @@ models: max_tweet_pulls_allowed: ${int:80} twitter_search_endpoint: ${str:2/tweets/search/recent?} twitter_search_args: ${str:query=%23olas&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results={max_results}&since_id={since_id}} + twitter_tweets_endpoint: ${str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} openai_call_window_size: ${float:3600.0} openai_calls_allowed_in_window: ${int:100} tx_timeout: 10.0 diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 19bafb22..28a56fb2 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq +agent: valory/impact_evaluator:0.1.0:bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm number_of_agents: 4 deployment: agent: @@ -107,6 +107,8 @@ extra: twitter_max_pages: ${TWITTER_MAX_PAGES:int:1} twitter_search_endpoint: ${TWITTER_SEARCH_ENDPOINT:str:2/tweets/search/recent?} twitter_search_args: ${TWITTER_SEARCH_ARGS:str:query=%23OlasNetwork&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=25&since_id={since_id}} + twitter_tweets_endpoint: ${TWITTER_TWEETS_ENDPOINT:str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${TWITTER_TWEETS_ARGS:str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} tx_timeout: 10.0 use_termination: ${USE_TERMINATION:bool:false} validate_timeout: 1205 @@ -179,6 +181,8 @@ extra: twitter_max_pages: ${TWITTER_MAX_PAGES:int:1} twitter_search_endpoint: ${TWITTER_SEARCH_ENDPOINT:str:2/tweets/search/recent?} twitter_search_args: ${TWITTER_SEARCH_ARGS:str:query=%23OlasNetwork&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=25&since_id={since_id}} + twitter_tweets_endpoint: ${TWITTER_TWEETS_ENDPOINT:str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${TWITTER_TWEETS_ARGS:str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} tx_timeout: 10.0 use_termination: ${USE_TERMINATION:bool:false} validate_timeout: 1205 @@ -251,6 +255,8 @@ extra: twitter_max_pages: ${TWITTER_MAX_PAGES:int:1} twitter_search_endpoint: ${TWITTER_SEARCH_ENDPOINT:str:2/tweets/search/recent?} twitter_search_args: ${TWITTER_SEARCH_ARGS:str:query=%23OlasNetwork&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=25&since_id={since_id}} + twitter_tweets_endpoint: ${TWITTER_TWEETS_ENDPOINT:str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${TWITTER_TWEETS_ARGS:str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} tx_timeout: 10.0 use_termination: ${USE_TERMINATION:bool:false} validate_timeout: 1205 @@ -325,6 +331,8 @@ extra: twitter_max_pages: ${TWITTER_MAX_PAGES:int:1} twitter_search_endpoint: ${TWITTER_SEARCH_ENDPOINT:str:2/tweets/search/recent?} twitter_search_args: ${TWITTER_SEARCH_ARGS:str:query=%23OlasNetwork&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=25&since_id={since_id}} + twitter_tweets_endpoint: ${TWITTER_TWEETS_ENDPOINT:str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${TWITTER_TWEETS_ARGS:str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} tx_timeout: 10.0 use_termination: ${USE_TERMINATION:bool:false} validate_timeout: 1205 diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index bebb8ced..c68896dd 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiexbxma4ccgrm4q7k5754jbobtzdzhnwkkjvl3rje2pm4pxjfctqq +agent: valory/impact_evaluator:0.1.0:bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm number_of_agents: 1 deployment: agent: @@ -106,6 +106,8 @@ models: twitter_max_pages: ${TWITTER_MAX_PAGES:int:1} twitter_search_endpoint: ${TWITTER_SEARCH_ENDPOINT:str:2/tweets/search/recent?} twitter_search_args: ${TWITTER_SEARCH_ARGS:str:query=%23OlasNetwork&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=25&since_id={since_id}} + twitter_tweets_endpoint: ${TWITTER_TWEETS_ENDPOINT:str:2/users/1450081635559428107/tweets?} + twitter_tweets_args: ${TWITTER_TWEETS_ARGS:str:tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time}} tx_timeout: 10.0 use_termination: ${USE_TERMINATION:bool:false} validate_timeout: 1205 diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index d1af0823..d8ae3051 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -170,6 +170,8 @@ models: max_tweet_pulls_allowed: 80 twitter_search_endpoint: 2/tweets/search/recent? twitter_search_args: query=%23olas&tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results={max_results}&since_id={since_id} + twitter_tweets_endpoint: 2/users/1450081635559428107/tweets? + twitter_tweets_args: tweet.fields=author_id,created_at&user.fields=name&expansions=author_id&max_results=50&start_time={start_time} openai_call_window_size: 3600.0 openai_calls_allowed_in_window: 100 max_points_per_period: 5000 From ba8ff545a4ec6c075487aade2f95eb7d3ed2283b Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:31:05 +0200 Subject: [PATCH 19/26] fix: skill deps --- .gitignore | 2 ++ docs/index.md | 2 +- packages/packages.json | 8 ++++---- packages/valory/agents/impact_evaluator/aea-config.yaml | 3 ++- packages/valory/services/impact_evaluator/service.yaml | 2 +- .../valory/services/impact_evaluator_local/service.yaml | 2 +- packages/valory/skills/impact_evaluator_abci/skill.yaml | 1 + 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 30b491c6..b73bfe8c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ impact_evaluator temp/ .1env + +impact_evaluator_local/ diff --git a/docs/index.md b/docs/index.md index be0ce0a5..02950d58 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeidvslopufaiqjuwcutfgcaaozorw7jueoq33uuncyd2igwrp2ig7a --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeicf3doytbgq6dmau3ikgm6hglkykxdmegxihwzumuxtjq76e55lny --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index ac726edb..a5191f5f 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm", + "agent/valory/impact_evaluator/0.1.0": "bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeidvslopufaiqjuwcutfgcaaozorw7jueoq33uuncyd2igwrp2ig7a", + "service/valory/impact_evaluator/0.1.0": "bafybeicf3doytbgq6dmau3ikgm6hglkykxdmegxihwzumuxtjq76e55lny", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeieuire3besgw2caakbcptcraenbmsrd7zgbc7poux6xbhekdjuf2m", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiguw5lnu5wyap2iqofhcktihpxu6eqx3pamzrikqigtgthrji2msi", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,7 +16,7 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby", - "service/valory/impact_evaluator_local/0.1.0": "bafybeidu5zc2e74qc7resce2tc2q6yortxl5o5q3evzaloeldpzblkj4w4", + "service/valory/impact_evaluator_local/0.1.0": "bafybeidy2jczat34wd2szh7e2nnphoubzlztal3hjcd5kr6q4epz4xnhx4", "skill/valory/olas_week_abci/0.1.0": "bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4" }, "third_party": { diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 2c0f300e..a75f6f90 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeieuire3besgw2caakbcptcraenbmsrd7zgbc7poux6xbhekdjuf2m +- valory/impact_evaluator_abci:0.1.0:bafybeiguw5lnu5wyap2iqofhcktihpxu6eqx3pamzrikqigtgthrji2msi - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -55,6 +55,7 @@ skills: - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije +- valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 28a56fb2..3770df3d 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm +agent: valory/impact_evaluator:0.1.0:bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index c68896dd..30e6bfaf 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeidfgt3ab56e3shd2hfqqeyivy3es5z3g4wye5eebc6x3jijgq2ypm +agent: valory/impact_evaluator:0.1.0:bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index d8ae3051..ea015742 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -36,6 +36,7 @@ skills: - valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq +- valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 behaviours: main: args: {} From fbf436e546b89b8b99ff5e3c4076233ea33e7e86 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:37:56 +0200 Subject: [PATCH 20/26] fix: move stream reads to the beginning --- docs/index.md | 2 +- packages/packages.json | 10 +++++----- .../agents/impact_evaluator/aea-config.yaml | 4 ++-- .../services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../skills/decision_making_abci/behaviours.py | 16 ++++++++-------- .../skills/decision_making_abci/skill.yaml | 2 +- .../skills/impact_evaluator_abci/skill.yaml | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/index.md b/docs/index.md index 02950d58..46f18cee 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeicf3doytbgq6dmau3ikgm6hglkykxdmegxihwzumuxtjq76e55lny --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeifl2y723rlcftwrirc7qnhzqeca2ncfzz2v7lpprvkbs4bqsna5ju --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index a5191f5f..69647436 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q", + "agent/valory/impact_evaluator/0.1.0": "bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeicf3doytbgq6dmau3ikgm6hglkykxdmegxihwzumuxtjq76e55lny", + "service/valory/impact_evaluator/0.1.0": "bafybeifl2y723rlcftwrirc7qnhzqeca2ncfzz2v7lpprvkbs4bqsna5ju", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiguw5lnu5wyap2iqofhcktihpxu6eqx3pamzrikqigtgthrji2msi", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeica3mp6csadjtpd4hztxj2s55x6dgoiua7kq3276x63yzl57asxrq", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,8 +15,8 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby", - "service/valory/impact_evaluator_local/0.1.0": "bafybeidy2jczat34wd2szh7e2nnphoubzlztal3hjcd5kr6q4epz4xnhx4", + "skill/valory/decision_making_abci/0.1.0": "bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4", + "service/valory/impact_evaluator_local/0.1.0": "bafybeicuyxrqepcn3f3lkzfuohss46ocyvakzm5js2auvvjmoyu4sdiila", "skill/valory/olas_week_abci/0.1.0": "bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4" }, "third_party": { diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index a75f6f90..3d7f8baa 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiguw5lnu5wyap2iqofhcktihpxu6eqx3pamzrikqigtgthrji2msi +- valory/impact_evaluator_abci:0.1.0:bafybeica3mp6csadjtpd4hztxj2s55x6dgoiua7kq3276x63yzl57asxrq - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,7 +53,7 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby +- valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 default_ledger: ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 3770df3d..35ffedab 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q +agent: valory/impact_evaluator:0.1.0:bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 30e6bfaf..53eeacc5 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeib6uuxqdmru7qwicaeoo5wjbwoy7jmenr23uuhnk7m3754vsmjb6q +agent: valory/impact_evaluator:0.1.0:bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/behaviours.py b/packages/valory/skills/decision_making_abci/behaviours.py index a15e1f16..c07335d2 100644 --- a/packages/valory/skills/decision_making_abci/behaviours.py +++ b/packages/valory/skills/decision_making_abci/behaviours.py @@ -69,6 +69,14 @@ previous_event_to_task_preparation_cls = { None: { "prev": None, + "next": ReadContributeDBPreparation, + }, + Event.READ_CONTRIBUTE_DB.value: { + "prev": ReadContributeDBPreparation, + "next": ReadManualPointsPreparation, + }, + Event.READ_MANUAL_POINTS.value: { + "prev": ReadManualPointsPreparation, "next": ReadCentaursPreparation, }, Event.READ_CENTAURS.value: { @@ -97,14 +105,6 @@ }, Event.UPDATE_CENTAURS.value: { "prev": UpdateCentaursPreparation, - "next": ReadContributeDBPreparation, - }, - Event.READ_CONTRIBUTE_DB.value: { - "prev": ReadContributeDBPreparation, - "next": ReadManualPointsPreparation, - }, - Event.READ_MANUAL_POINTS.value: { - "prev": ReadManualPointsPreparation, "next": ScorePreparation, }, Event.SCORE.value: { diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index cda31e39..13953427 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la - behaviours.py: bafybeigcj565ei6widhhsr6gkxkmvxiab6ahdihxzyj7fy2zc6kaehn34y + behaviours.py: bafybeib3zqwpkavtatog6spo6frcwjibaf5xdsgnbofm5o7ck54sdeuuf4 dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye fsm_specification.yaml: bafybeihd5kd3pj52wqhki324pwfc5hpigv57tovdyuv3kpsrihsa3ykn6m handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index ea015742..a0f1e125 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -33,7 +33,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeihznmvrmqzmmeuqkaqeupxvcxaapycr2l3zq3so5weu62pgmlgtby +- valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 From 82cb8e42749d079415b4514184c12f5006549527 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:51:27 +0200 Subject: [PATCH 21/26] fix: do not use ensure on shared params --- docs/index.md | 2 +- packages/packages.json | 10 ++--- .../agents/impact_evaluator/aea-config.yaml | 4 +- .../services/impact_evaluator/service.yaml | 2 +- .../impact_evaluator_local/service.yaml | 2 +- .../skills/impact_evaluator_abci/skill.yaml | 2 +- .../skills/olas_week_abci/behaviours.py | 2 +- .../valory/skills/olas_week_abci/models.py | 30 ++++++--------- .../valory/skills/olas_week_abci/skill.yaml | 2 +- .../skills/twitter_scoring_abci/models.py | 38 +++++++------------ 10 files changed, 38 insertions(+), 56 deletions(-) diff --git a/docs/index.md b/docs/index.md index 46f18cee..4a633027 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeifl2y723rlcftwrirc7qnhzqeca2ncfzz2v7lpprvkbs4bqsna5ju --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeihy7c7zjh7ho5lggebtdynzckluggwskac2hgp5kkjzebldkxhjj4 --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 69647436..5c5432cc 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa", + "agent/valory/impact_evaluator/0.1.0": "bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeifl2y723rlcftwrirc7qnhzqeca2ncfzz2v7lpprvkbs4bqsna5ju", + "service/valory/impact_evaluator/0.1.0": "bafybeihy7c7zjh7ho5lggebtdynzckluggwskac2hgp5kkjzebldkxhjj4", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeica3mp6csadjtpd4hztxj2s55x6dgoiua7kq3276x63yzl57asxrq", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeicl7ainw2obu7u5ccyka5bxze5fextp4dqefwwj4yqmt4rvboedve", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,8 +16,8 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4", - "service/valory/impact_evaluator_local/0.1.0": "bafybeicuyxrqepcn3f3lkzfuohss46ocyvakzm5js2auvvjmoyu4sdiila", - "skill/valory/olas_week_abci/0.1.0": "bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4" + "service/valory/impact_evaluator_local/0.1.0": "bafybeicccxccf7mhbrzpfrn3y3qq32fzo6a56krdluw4gkbv5p65f2tol4", + "skill/valory/olas_week_abci/0.1.0": "bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 3d7f8baa..07776c28 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeica3mp6csadjtpd4hztxj2s55x6dgoiua7kq3276x63yzl57asxrq +- valory/impact_evaluator_abci:0.1.0:bafybeicl7ainw2obu7u5ccyka5bxze5fextp4dqefwwj4yqmt4rvboedve - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -55,7 +55,7 @@ skills: - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije -- valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 +- valory/olas_week_abci:0.1.0:bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 35ffedab..2296da3c 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa +agent: valory/impact_evaluator:0.1.0:bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 53eeacc5..337f4e8e 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihchaau3b6jsnwhiqzl5jrclinsu3ddqv6bz5vz7pvs4v7knpuxqa +agent: valory/impact_evaluator:0.1.0:bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index a0f1e125..c2aa26f6 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -36,7 +36,7 @@ skills: - valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/olas_week_abci:0.1.0:bafybeifscqqz7zswgwrjwya4wyexl2u3zgzs2im22fsgfocs2oogni2up4 +- valory/olas_week_abci:0.1.0:bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y behaviours: main: args: {} diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index 358188a0..5ccfd7a1 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -416,7 +416,7 @@ def _get_tweets( """Get Tweets""" api_base = self.params.twitter_api_base - api_endpoint = self.params.twitter_tweets_args + api_endpoint = self.params.twitter_tweets_endpoint number_of_tweets_remaining_today = ( self.params.max_tweet_pulls_allowed - number_of_tweets_pulled_today diff --git a/packages/valory/skills/olas_week_abci/models.py b/packages/valory/skills/olas_week_abci/models.py index 4d833d45..176ea268 100644 --- a/packages/valory/skills/olas_week_abci/models.py +++ b/packages/valory/skills/olas_week_abci/models.py @@ -82,26 +82,18 @@ class Params(BaseParams): def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the parameters object.""" - self.twitter_api_base = self._ensure("twitter_api_base", kwargs, str) - self.twitter_api_bearer_token = self._ensure( - "twitter_api_bearer_token", kwargs, str + self.twitter_api_base = kwargs.get("twitter_api_base") + self.twitter_api_bearer_token = kwargs.get("twitter_api_bearer_token") + self.twitter_tweets_endpoint = kwargs.get("twitter_tweets_endpoint") + self.twitter_tweets_args = kwargs.get("twitter_tweets_args") + self.twitter_max_pages = kwargs.get("twitter_max_pages") + self.tweet_evaluation_round_timeout = kwargs.get( + "tweet_evaluation_round_timeout" ) - self.twitter_tweets_endpoint = self._ensure( - "twitter_tweets_endpoint", kwargs, str - ) - self.twitter_tweets_args = self._ensure("twitter_tweets_args", kwargs, str) - self.twitter_max_pages = self._ensure("twitter_max_pages", kwargs, int) - self.tweet_evaluation_round_timeout = self._ensure( - "tweet_evaluation_round_timeout", kwargs, float - ) - self.max_tweet_pulls_allowed = self._ensure( - "max_tweet_pulls_allowed", kwargs, int - ) - self.openai_call_window_size = self._ensure( - "openai_call_window_size", kwargs, float - ) - self.openai_calls_allowed_in_window = self._ensure( - "openai_calls_allowed_in_window", kwargs, int + self.max_tweet_pulls_allowed = kwargs.get("max_tweet_pulls_allowed") + self.openai_call_window_size = kwargs.get("openai_call_window_size") + self.openai_calls_allowed_in_window = kwargs.get( + "openai_calls_allowed_in_window" ) self.openai_calls = OpenAICalls( openai_call_window_size=self.openai_call_window_size, diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index 1f4a68ce..ceb9a232 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeiarpemlqyaakx2ys4bfjej6mnpgmnchhzw46wq5bu4e3fh4hvyqy4 + behaviours.py: bafybeiekwpflgvusqg6nmdfwzsconsnhsd3qvmdozsmaxzh7qmjgzwj65e ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu diff --git a/packages/valory/skills/twitter_scoring_abci/models.py b/packages/valory/skills/twitter_scoring_abci/models.py index c10d8dcd..83a0e376 100644 --- a/packages/valory/skills/twitter_scoring_abci/models.py +++ b/packages/valory/skills/twitter_scoring_abci/models.py @@ -82,31 +82,21 @@ class Params(BaseParams): def __init__(self, *args: Any, **kwargs: Any) -> None: """Initialize the parameters object.""" - self.twitter_api_base = self._ensure("twitter_api_base", kwargs, str) - self.twitter_api_bearer_token = self._ensure( - "twitter_api_bearer_token", kwargs, str + self.twitter_api_base = kwargs.get("twitter_api_base") + self.twitter_api_bearer_token = kwargs.get("twitter_api_bearer_token") + self.twitter_mentions_endpoint = kwargs.get("twitter_mentions_endpoint") + self.twitter_mentions_args = kwargs.get("twitter_mentions_args") + self.twitter_max_pages = kwargs.get("twitter_max_pages") + self.twitter_search_endpoint = kwargs.get("twitter_search_endpoint") + self.twitter_search_args = kwargs.get("twitter_search_args") + self.max_points_per_period = kwargs.get("max_points_per_period") + self.tweet_evaluation_round_timeout = kwargs.get( + "tweet_evaluation_round_timeout" ) - self.twitter_mentions_endpoint = self._ensure( - "twitter_mentions_endpoint", kwargs, str - ) - self.twitter_mentions_args = self._ensure("twitter_mentions_args", kwargs, str) - self.twitter_max_pages = self._ensure("twitter_max_pages", kwargs, int) - self.twitter_search_endpoint = self._ensure( - "twitter_search_endpoint", kwargs, str - ) - self.twitter_search_args = self._ensure("twitter_search_args", kwargs, str) - self.max_points_per_period = self._ensure("max_points_per_period", kwargs, int) - self.tweet_evaluation_round_timeout = self._ensure( - "tweet_evaluation_round_timeout", kwargs, float - ) - self.max_tweet_pulls_allowed = self._ensure( - "max_tweet_pulls_allowed", kwargs, int - ) - self.openai_call_window_size = self._ensure( - "openai_call_window_size", kwargs, float - ) - self.openai_calls_allowed_in_window = self._ensure( - "openai_calls_allowed_in_window", kwargs, int + self.max_tweet_pulls_allowed = kwargs.get("max_tweet_pulls_allowed") + self.openai_call_window_size = kwargs.get("openai_call_window_size") + self.openai_calls_allowed_in_window = kwargs.get( + "openai_calls_allowed_in_window" ) self.openai_calls = OpenAICalls( openai_call_window_size=self.openai_call_window_size, From f4861a88d231545e738b44763b36b7bf71ded7fc Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 12:54:06 +0200 Subject: [PATCH 22/26] fix: generators --- docs/index.md | 2 +- packages/packages.json | 12 ++++++------ .../valory/agents/impact_evaluator/aea-config.yaml | 6 +++--- .../valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/impact_evaluator_abci/skill.yaml | 4 ++-- packages/valory/skills/olas_week_abci/skill.yaml | 2 +- .../valory/skills/twitter_scoring_abci/skill.yaml | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/index.md b/docs/index.md index 4a633027..3260021b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeihy7c7zjh7ho5lggebtdynzckluggwskac2hgp5kkjzebldkxhjj4 --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeiauwechei46pjlkwan3gce2kmyuzjdxww7mcpi355opeobpogrv4y --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 5c5432cc..fc5c9b72 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm", + "agent/valory/impact_evaluator/0.1.0": "bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeihy7c7zjh7ho5lggebtdynzckluggwskac2hgp5kkjzebldkxhjj4", + "service/valory/impact_evaluator/0.1.0": "bafybeiauwechei46pjlkwan3gce2kmyuzjdxww7mcpi355opeobpogrv4y", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", - "skill/valory/twitter_scoring_abci/0.1.0": "bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q", + "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeicl7ainw2obu7u5ccyka5bxze5fextp4dqefwwj4yqmt4rvboedve", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeidrbsufoanvwj6kpseh237yzz2kema2wrarmmjcjyuovuhlb3ir4m", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,8 +16,8 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4", - "service/valory/impact_evaluator_local/0.1.0": "bafybeicccxccf7mhbrzpfrn3y3qq32fzo6a56krdluw4gkbv5p65f2tol4", - "skill/valory/olas_week_abci/0.1.0": "bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y" + "service/valory/impact_evaluator_local/0.1.0": "bafybeia2reu4eooahbeonkvfsudyjgsjqm7ck3sovbt2ivv2b3ojov2pjm", + "skill/valory/olas_week_abci/0.1.0": "bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 07776c28..d8bb1145 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,9 +42,9 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeicl7ainw2obu7u5ccyka5bxze5fextp4dqefwwj4yqmt4rvboedve +- valory/impact_evaluator_abci:0.1.0:bafybeidrbsufoanvwj6kpseh237yzz2kema2wrarmmjcjyuovuhlb3ir4m - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q +- valory/twitter_scoring_abci:0.1.0:bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa - valory/dynamic_nft_abci:0.1.0:bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i @@ -55,7 +55,7 @@ skills: - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije -- valory/olas_week_abci:0.1.0:bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y +- valory/olas_week_abci:0.1.0:bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 2296da3c..9b916223 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm +agent: valory/impact_evaluator:0.1.0:bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 337f4e8e..8377a94a 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeihnybq3xsmqouhyyhvqfjmbniw74etke32i4g774hp3bvb2c5efsm +agent: valory/impact_evaluator:0.1.0:bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index c2aa26f6..4416f2c5 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -26,7 +26,7 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga -- valory/twitter_scoring_abci:0.1.0:bafybeigw3t32j3kehqx5zuycvwextwzzarsjgadgn2c3mxrzn4usehiv3q +- valory/twitter_scoring_abci:0.1.0:bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q - valory/ceramic_write_abci:0.1.0:bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa - valory/dynamic_nft_abci:0.1.0:bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i - valory/registration_abci:0.1.0:bafybeibndt6vxiwc2edgtaxpjbhwto3eyu33ujz3zmvtygvo2qz7xme5li @@ -36,7 +36,7 @@ skills: - valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/olas_week_abci:0.1.0:bafybeifu6qmkwpji5mgfjq4grrz4en5p3foclwnjinmpzhniyoymtq734y +- valory/olas_week_abci:0.1.0:bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa behaviours: main: args: {} diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index ceb9a232..a5d64640 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -13,7 +13,7 @@ fingerprint: dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu handlers.py: bafybeialoqm2byetvqqrjujhk3qzgdgsrzmhakmzwdop2cr24kswipl6ti - models.py: bafybeif7kefuddm7gkgiwthozsijijegdul7s6z6pkxlld2rqambrevmc4 + models.py: bafybeihsqzu4n2r5a4wlvcpmpnwkbtp3sr7axry53to5gpxoacqbkhx5cq payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 prompts.py: bafybeicz63x6rhrgm5amjkfsovnqvxqyzicfhhae3orw7jaubme2npnn2a rounds.py: bafybeifxarx2mqwj5chtlhbdprew6767uyttmtikodzlquwn4fvwvuraqy diff --git a/packages/valory/skills/twitter_scoring_abci/skill.yaml b/packages/valory/skills/twitter_scoring_abci/skill.yaml index 05b33adb..723cd731 100644 --- a/packages/valory/skills/twitter_scoring_abci/skill.yaml +++ b/packages/valory/skills/twitter_scoring_abci/skill.yaml @@ -13,7 +13,7 @@ fingerprint: dialogues.py: bafybeibdqzn37hbo2cq4skww4uh2zvvsjyaxxvdhxisefbdvmjp7rh53si fsm_specification.yaml: bafybeie6k4aanmwcrghspbqywdh2srrudtkhnbbhqm3ovcz5k4fa5dybrq handlers.py: bafybeid3nqvcyotqj5g5hlgrz57nf7vpjysmgvsxe3p7644f4z5dcwqn6u - models.py: bafybeiajis7l5sv7b3fofuj3ehxai5d2uy6h6p4kabhrekjwkjs77lopxe + models.py: bafybeigag7tmzi7caob46mowxnqhhcpyxqqxhchj4mqyjmgtcglx45dyua payloads.py: bafybeibeqiwnua7uewbv5a7epebshjpueuqpcbw6s2y3u62kasdhiijs5i prompts.py: bafybeieiuqn427bgwfnzynxf3vtqfpvmqqscs5tyw4oibfofwropifotke rounds.py: bafybeigtzsvklrwxyah2syrzjruufr6uuninyh6flbrwetcgcb5pl4czra From 1e152fa530935850fe9e5c877dd0afa9ed51c272 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 16:53:32 +0200 Subject: [PATCH 23/26] fix: multiple issues --- docs/index.md | 2 +- packages/packages.json | 12 +++--- .../agents/impact_evaluator/aea-config.yaml | 6 +-- .../services/impact_evaluator/service.yaml | 2 +- .../impact_evaluator_local/service.yaml | 2 +- .../skills/decision_making_abci/behaviours.py | 2 +- .../skills/decision_making_abci/rounds.py | 6 +-- .../skills/decision_making_abci/skill.yaml | 8 ++-- .../tasks/task_preparations.py | 23 ++++++++--- .../tasks/week_in_olas_preparations.py | 13 +++--- .../skills/impact_evaluator_abci/models.py | 7 ++++ .../skills/impact_evaluator_abci/skill.yaml | 6 +-- .../skills/olas_week_abci/behaviours.py | 40 +++++++++++++++++-- .../valory/skills/olas_week_abci/rounds.py | 24 +++++++---- .../valory/skills/olas_week_abci/skill.yaml | 4 +- 15 files changed, 110 insertions(+), 47 deletions(-) diff --git a/docs/index.md b/docs/index.md index 3260021b..a94beb02 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeiauwechei46pjlkwan3gce2kmyuzjdxww7mcpi355opeobpogrv4y --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeieynav3nrbb5uv253e3bdj2tlagsyj6wjpyb6j3i6f5dewbb27pve --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index fc5c9b72..3766bd52 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm", + "agent/valory/impact_evaluator/0.1.0": "bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeiauwechei46pjlkwan3gce2kmyuzjdxww7mcpi355opeobpogrv4y", + "service/valory/impact_evaluator/0.1.0": "bafybeieynav3nrbb5uv253e3bdj2tlagsyj6wjpyb6j3i6f5dewbb27pve", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeidrbsufoanvwj6kpseh237yzz2kema2wrarmmjcjyuovuhlb3ir4m", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeidv4ywbjlyokgxarv6c5k6n5hawv2wm2v62gloq2egwbawmvjoc3q", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,9 +15,9 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4", - "service/valory/impact_evaluator_local/0.1.0": "bafybeia2reu4eooahbeonkvfsudyjgsjqm7ck3sovbt2ivv2b3ojov2pjm", - "skill/valory/olas_week_abci/0.1.0": "bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa" + "skill/valory/decision_making_abci/0.1.0": "bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4", + "service/valory/impact_evaluator_local/0.1.0": "bafybeihq63vfjrk6b3yfu3ghawor4zvrwvxyuxozkdyntohv42l664hneu", + "skill/valory/olas_week_abci/0.1.0": "bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index d8bb1145..8ff19eb1 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeidrbsufoanvwj6kpseh237yzz2kema2wrarmmjcjyuovuhlb3ir4m +- valory/impact_evaluator_abci:0.1.0:bafybeidv4ywbjlyokgxarv6c5k6n5hawv2wm2v62gloq2egwbawmvjoc3q - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,9 +53,9 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 +- valory/decision_making_abci:0.1.0:bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije -- valory/olas_week_abci:0.1.0:bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa +- valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 9b916223..9fa800f5 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm +agent: valory/impact_evaluator:0.1.0:bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 8377a94a..bf5af252 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeidiemrfyw2xdwclkd5pe3mqjynu3p3abevfhqfo6yxqnewec5ffmm +agent: valory/impact_evaluator:0.1.0:bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/behaviours.py b/packages/valory/skills/decision_making_abci/behaviours.py index c07335d2..16b4eb98 100644 --- a/packages/valory/skills/decision_making_abci/behaviours.py +++ b/packages/valory/skills/decision_making_abci/behaviours.py @@ -117,7 +117,7 @@ }, Event.NEXT_CENTAUR.value: { "prev": None, - "next": LLMPreparation, + "next": ReadContributeDBPreparation, }, } diff --git a/packages/valory/skills/decision_making_abci/rounds.py b/packages/valory/skills/decision_making_abci/rounds.py index 7e4661a9..ed8dab1f 100644 --- a/packages/valory/skills/decision_making_abci/rounds.py +++ b/packages/valory/skills/decision_making_abci/rounds.py @@ -147,9 +147,9 @@ def pending_write(self) -> bool: return cast(bool, self.db.get("pending_write", False)) @property - def weekly_tweets(self) -> list: - """Get the weekly_tweets.""" - return cast(list, self.db.get("weekly_tweets", [])) + def summary_tweets(self) -> list: + """Get the summary_tweets.""" + return cast(list, self.db.get("summary_tweets", [])) class DecisionMakingRound(CollectSameUntilThresholdRound): diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index 13953427..66228640 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -7,20 +7,20 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la - behaviours.py: bafybeib3zqwpkavtatog6spo6frcwjibaf5xdsgnbofm5o7ck54sdeuuf4 + behaviours.py: bafybeidlfdovcj37dowftf6xswhsf2rawx7issrkwgx2xz4mseo66zhtwu dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye fsm_specification.yaml: bafybeihd5kd3pj52wqhki324pwfc5hpigv57tovdyuv3kpsrihsa3ykn6m handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya - rounds.py: bafybeifh544cvkomhii6vakzqqepbzpeo63b3uw2fggfqbabaksbmthlue + rounds.py: bafybeiaj7j5ncphpsetljcl72yzpbzt6hwd663aoydsgh45rhtkzgqwqou tasks/finished_pipeline_preparation.py: bafybeifvwzvnw3d2lxlk4p5hd6j2tcxr7bwjewm667ubssoqyfsk4xafd4 tasks/llm_preparation.py: bafybeigi7i5yp7w5hi5mcbzuzdfbfm4j5etsvplbhb2pdjcb3jfcy6qzrq tasks/read_stream_preparation.py: bafybeiespz6kzkzvrjjf3d6ffwse3rufuyrrab3axvg64pxw4jj6zzhwny tasks/score_preparations.py: bafybeieiesjkyjbcvqut3l6nlzcwpidibsmo3mz7j6p54lbqzspfcf3ram - tasks/task_preparations.py: bafybeiao4zyitjb2nujyhkhjfkd3mq5d4blbcybyfw27hcnc643yzp6ueq + tasks/task_preparations.py: bafybeiatxqkfrqgeclg4jex4a6veboqipnukmgett7hwwqprrvdlgh7ana tasks/twitter_preparation.py: bafybeieoa5wkhg55w2bdbkwawdz4kh4wmifzgtcmzi3ursi3oaxvpu4mom - tasks/week_in_olas_preparations.py: bafybeie3jy7uemtsjrqv6rta6kxc2rvddv7vy6dzziqsrxiovtvvxo5if4 + tasks/week_in_olas_preparations.py: bafybeiakt43xrdglfmsrmhw3i3donzsfrqhgxzygdyi26tehpaeyeoz7n4 tasks/write_stream_preparation.py: bafybeifl4j7s575ts6x4msntymkempwguj4yypmxy2xjmffknn7qhkzfo4 tests/__init__.py: bafybeiff447fuzkdgyp5yoqqstzv2pyi2uiokng6lzrtfnsgspocghwypi tests/centaur_configs.py: bafybeifgmz5nlpfj4ynpzywbwnnuhz2dxookezwhxmvzlucjbhugv3tgma diff --git a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py index 1179282f..0e5ed380 100644 --- a/packages/valory/skills/decision_making_abci/tasks/task_preparations.py +++ b/packages/valory/skills/decision_making_abci/tasks/task_preparations.py @@ -39,6 +39,7 @@ def __init__(self, synchronized_data, params, logger, now_utc) -> None: self.now_utc = now_utc self.set_config() self.logger.info(f"Instantiated task {self.__class__.__name__}") + self.log_config() def set_config(self): """Set the configuration""" @@ -63,11 +64,14 @@ def set_config(self): datetime.strptime( plugin_config["last_run"], "%Y-%m-%d %H:%M:%S %Z" ).replace(tzinfo=timezone.utc) - if self.daily and plugin_config["last_run"] + if (self.daily or (self.weekly is not None)) + and plugin_config["last_run"] else None ) self.run_hour_utc = ( - plugin_config["run_hour_utc"] if self.daily or self.weekly else None + plugin_config["run_hour_utc"] + if self.daily or (self.weekly is not None) + else None ) return @@ -75,12 +79,19 @@ def set_config(self): def set_default_config(self): """Set the default configuration""" + self.logger.info("Setting the default configuration") self.enabled = True self.daily = False self.weekly = None self.last_run = None self.run_hour_utc = None + def log_config(self): + """Log configuration""" + self.logger.info( + f"Config: enabled={self.enabled} daily={self.daily} weekly={self.weekly} last_run={self.last_run} run_hour_utc={self.run_hour_utc}" + ) + def check_conditions(self): """Check wether the task needs to be run""" @@ -97,14 +108,14 @@ def check_conditions(self): return False # Does the task run every week? - if self.weekly and self.weekly != self.now_utc.weekday(): + if self.weekly is not None and self.weekly != self.now_utc.weekday(): self.logger.info( f"[{self.__class__.__name__}]: task is a weekly task but today is not the configured run day: {self.now_utc.weekday()} != {self.weekly}" ) return False if ( - self.weekly + self.weekly is not None and self.last_run and (self.now_utc - self.last_run).seconds < SECONDS_IN_DAY ): @@ -114,7 +125,9 @@ def check_conditions(self): return False # Does the task run at a specific time? - if self.daily and self.now_utc.hour < self.run_hour_utc: + if ( + self.daily or (self.weekly is not None) + ) and self.now_utc.hour < self.run_hour_utc: self.logger.info( f"[{self.__class__.__name__}]: not time to run yet [{self.now_utc.hour}!={self.run_hour_utc}]" ) diff --git a/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py index beafded2..294482e2 100644 --- a/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py +++ b/packages/valory/skills/decision_making_abci/tasks/week_in_olas_preparations.py @@ -29,7 +29,7 @@ class WeekInOlasCreatePreparation(TaskPreparation): """WeekInOlasCreatePreparation""" - task_name = "week_in_olas_create" + task_name = "week_in_olas" task_event = Event.WEEK_IN_OLAS_CREATE.value def check_extra_conditions(self): @@ -43,11 +43,10 @@ def _pre_task(self): def _post_task(self): """Task postprocessing""" - updates, event = super()._post_task() + centaurs_data = self.synchronized_data.centaurs_data + current_centaur = centaurs_data[self.synchronized_data.current_centaur_index] # Update the last run time - centaurs_data = updates["centaurs_data"] - current_centaur = centaurs_data[self.synchronized_data.current_centaur_index] current_centaur["configuration"]["plugins"]["week_in_olas"][ "last_run" ] = self.now_utc.strftime("%Y-%m-%d %H:%M:%S %Z") @@ -63,8 +62,8 @@ def _post_task(self): "createdDate": self.now_utc.timestamp(), } - current_centaur["plugins_data"]["week_in_olas"]["tweets"].append(thread) + current_centaur["plugins_data"]["scheduled_tweet"]["tweets"].append(thread) - updates["centaurs_data"] = centaurs_data + updates = {"centaurs_data": centaurs_data, "has_centaurs_changes": True} - return updates, event + return updates, None diff --git a/packages/valory/skills/impact_evaluator_abci/models.py b/packages/valory/skills/impact_evaluator_abci/models.py index 4ae3f74e..945f29af 100644 --- a/packages/valory/skills/impact_evaluator_abci/models.py +++ b/packages/valory/skills/impact_evaluator_abci/models.py @@ -56,6 +56,8 @@ ) from packages.valory.skills.llm_abci.models import Params as LLMAbciParams from packages.valory.skills.llm_abci.rounds import Event as LLMEvent +from packages.valory.skills.olas_week_abci.models import Params as OlasWeekAbciParams +from packages.valory.skills.olas_week_abci.rounds import Event as OlasWeekEvent from packages.valory.skills.reset_pause_abci.rounds import Event as ResetPauseEvent from packages.valory.skills.termination_abci.models import TerminationParams from packages.valory.skills.twitter_scoring_abci.models import ( @@ -72,6 +74,7 @@ TwitterScoringParams = TwitterScoringAbciParams LLMParams = LLMAbciParams DecisionMakingParams = DecisionMakingAbciParams +OlasWeekParams = OlasWeekAbciParams Requests = BaseRequests BenchmarkTool = BaseBenchmarkTool @@ -123,6 +126,9 @@ def setup(self) -> None: ImpactEvaluatorSkillAbciApp.event_to_timeout[ DecisionMakingEvent.ROUND_TIMEOUT ] = self.context.params.round_timeout_seconds + ImpactEvaluatorSkillAbciApp.event_to_timeout[ + OlasWeekEvent.ROUND_TIMEOUT + ] = self.context.params.round_timeout_seconds class Params( @@ -132,5 +138,6 @@ class Params( DynamicNFTParams, DecisionMakingParams, TerminationParams, + OlasWeekParams, ): """A model to represent params for multiple abci apps.""" diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 4416f2c5..6edfe4a8 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -12,7 +12,7 @@ fingerprint: dialogues.py: bafybeigjknz4qqynbsltjje46gidg4rftsqw6ybjwegz24wetmycutpzh4 fsm_specification.yaml: bafybeicyfp5jhurpyhutevkabexrujx7xyywexnq2lfxzwkqmdxdv5ihgq handlers.py: bafybeidkli6fphcmdgwsys4lkyf3fx6fbawet4nt2pnixfypzijhg6b3ze - models.py: bafybeifhcshu4iwqvc2fz3auu5ngfykkhvqnroeug52ilrwwc4kowkeg5a + models.py: bafybeigtb7k4gk22574epnpitr6lqv2coaf2j5pgwuymh2xsvtj4qta2t4 tests/__init__.py: bafybeievwzwojvq4aofk5kjpf4jzygfes7ew6s6svc6b6frktjnt3sicce tests/test_behaviours.py: bafybeifkazsevd6vsfaapulouxepez3rl24y3rxgja5zhmj7s323zdjlmq tests/test_dialogues.py: bafybeieaos2byphju6i6xvytppqqcuqqvnpilnflsy73l3wqazzjttbg7m @@ -33,10 +33,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeib4qfv42mviitchsw3shd3kvt6eggvq2jfsv2krbvny67tzgw6cl4 +- valory/decision_making_abci:0.1.0:bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4 - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/olas_week_abci:0.1.0:bafybeibia7xhmkmn2ljcun5mhf2ajr44ifinsmacx5sv7k7cxkde7uptwa +- valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a behaviours: main: args: {} diff --git a/packages/valory/skills/olas_week_abci/behaviours.py b/packages/valory/skills/olas_week_abci/behaviours.py index 5ccfd7a1..d221e8a1 100644 --- a/packages/valory/skills/olas_week_abci/behaviours.py +++ b/packages/valory/skills/olas_week_abci/behaviours.py @@ -299,6 +299,9 @@ def get_next_event(self) -> str: if Event.RETRIEVE_TWEETS.value not in performed_tasks: return Event.RETRIEVE_TWEETS.value + if performed_tasks[Event.RETRIEVE_TWEETS.value] == Event.DONE_MAX_RETRIES.value: + return Event.DONE_SKIP.value + if Event.EVALUATE.value not in performed_tasks: return Event.EVALUATE.value @@ -439,7 +442,7 @@ def _get_tweets( start_time = datetime.fromtimestamp(now_ts) - timedelta(days=7) - start_time_str = start_time.strftime("%Y-%m-%dT%H:%M:%S:00Z") + start_time_str = start_time.strftime("%Y-%m-%dT%H:%M:%SZ") # Build the args api_args = self.params.twitter_tweets_args.replace( @@ -572,7 +575,7 @@ def _get_tweets( self.context.logger.info(f"Got {len(tweets)} new tweets") return { - "tweets": tweets, + "tweets": list(tweets.values()), "number_of_tweets_pulled_today": number_of_tweets_pulled_today, "sleep_until": None, # we reset this on a successful request } @@ -583,7 +586,37 @@ class OlasWeekEvaluationBehaviour(OlasWeekBaseBehaviour): matching_round: Type[AbstractRound] = OlasWeekEvaluationRound - def async_act(self) -> Generator: + def _i_am_not_sending(self) -> bool: + """Indicates if the current agent is one of the sender or not.""" + return ( + self.context.agent_address + != self.synchronized_data.most_voted_keeper_address + ) + + def async_act(self) -> Generator[None, None, None]: + """ + Do the action. + + Steps: + - If the agent is the keeper, then prepare the transaction and send it. + - Otherwise, wait until the next round. + - If a timeout is hit, set exit A event, otherwise set done event. + """ + if self._i_am_not_sending(): + yield from self._not_sender_act() + else: + yield from self._sender_act() + + def _not_sender_act(self) -> Generator: + """Do the non-sender action.""" + with self.context.benchmark_tool.measure(self.behaviour_id).consensus(): + self.context.logger.info( + f"Waiting for the keeper to do its keeping: keepers={self.synchronized_data.most_voted_keeper_addresses}, me={self.context.agent_address}" + ) + yield from self.wait_until_round_end() + self.set_done() + + def _sender_act(self) -> Generator: """Do the act, supporting asynchronous execution.""" with self.context.benchmark_tool.measure(self.behaviour_id).local(): @@ -631,6 +664,7 @@ def evaluate_summary(self, text: str) -> Generator[None, None, list]: self.openai_calls.increase_call_count() self.context.logger.info(f"Got summary: {repr(data)}") summary = parse_summary(data) + self.context.logger.info(f"Parsed summary: {summary}") return summary def _do_request( diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index 357a8e56..2988269b 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -126,6 +126,11 @@ def most_voted_keeper_addresses(self) -> list: """Get the most_voted_keeper_addresses.""" return cast(list, self.db.get_strict("most_voted_keeper_addresses")) + @property + def most_voted_keeper_address(self) -> list: + """Get the most_voted_keeper_address.""" + return cast(list, self.db.get_strict("most_voted_keeper_address")) + @property def are_keepers_set(self) -> bool: """Check whether keepers are set.""" @@ -293,7 +298,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: return synchronized_data, Event.API_ERROR # Happy path - weekly_tweets = cast(SynchronizedData, self.synchronized_data).tweets + weekly_tweets = payload["tweets"] performed_olas_week_tasks["retrieve_tweets"] = Event.DONE.value updates = { @@ -333,6 +338,10 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: if self.keeper_payload is None: return None + payload = json.loads( + cast(OlasWeekEvaluationPayload, self.keeper_payload).content + ) + performed_olas_week_tasks = cast( SynchronizedData, self.synchronized_data ).performed_olas_week_tasks @@ -341,9 +350,7 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Enum]]: synchronized_data = self.synchronized_data.update( synchronized_data_class=SynchronizedData, **{ - get_name(SynchronizedData.summary_tweets): self.keeper_payload[ - "summary_tweets" - ], + get_name(SynchronizedData.summary_tweets): payload["summary_tweets"], get_name( SynchronizedData.performed_olas_week_tasks ): performed_olas_week_tasks, @@ -382,12 +389,15 @@ def end_block(self) -> Optional[Tuple[BaseSynchronizedData, Event]]: ).performed_olas_week_tasks performed_olas_week_tasks["select_keepers"] = Event.DONE.value + keepers = json.loads(self.most_voted_payload) + synchronized_data = self.synchronized_data.update( synchronized_data_class=SynchronizedData, **{ - get_name(SynchronizedData.most_voted_keeper_addresses): json.loads( - self.most_voted_payload - ), + get_name(SynchronizedData.most_voted_keeper_addresses): keepers, + get_name(SynchronizedData.most_voted_keeper_address): keepers[ + 0 + ], # we also set this for reusing the keeper get_name( SynchronizedData.performed_olas_week_tasks ): performed_olas_week_tasks, diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index a5d64640..1504bf26 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeibvgxh4baqhxapbbryg7qlglf4czricwqqs34gjs5vwwppg5nuvsq - behaviours.py: bafybeiekwpflgvusqg6nmdfwzsconsnhsd3qvmdozsmaxzh7qmjgzwj65e + behaviours.py: bafybeicemkdzirevjo2vkuay4zrb2scfaosrw2wixt2vcmk7ewufjtofla ceramic_db.py: bafybeicusdonrdq6kirgkpdqmi3a6kmeal4nctnm5ozjqf5s5se6jpitjm dialogues.py: bafybeia7zebqkgbubzenskcrgjocgyd2pc3q5yxcjddte4emys32qt6xpm fsm_specification.yaml: bafybeienycmc4m3wurhlsuj7hfumrsx5id3qfdn6eisoze4gdzeeojlrbu @@ -16,7 +16,7 @@ fingerprint: models.py: bafybeihsqzu4n2r5a4wlvcpmpnwkbtp3sr7axry53to5gpxoacqbkhx5cq payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 prompts.py: bafybeicz63x6rhrgm5amjkfsovnqvxqyzicfhhae3orw7jaubme2npnn2a - rounds.py: bafybeifxarx2mqwj5chtlhbdprew6767uyttmtikodzlquwn4fvwvuraqy + rounds.py: bafybeigkjt43nddhjh2qjncnseht3xrktmvvrtoqynxwcwun5ztwi3lmau fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq From 5e4fa1bb9b28734627aee7d556621332422a0e5c Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 17:00:02 +0200 Subject: [PATCH 24/26] fix: linters --- docs/index.md | 2 +- packages/packages.json | 10 +++++----- .../valory/agents/impact_evaluator/aea-config.yaml | 4 ++-- packages/valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../skills/decision_making_abci/fsm_specification.yaml | 2 -- packages/valory/skills/decision_making_abci/skill.yaml | 2 +- .../impact_evaluator_abci/fsm_specification.yaml | 2 -- .../valory/skills/impact_evaluator_abci/skill.yaml | 4 ++-- 9 files changed, 13 insertions(+), 17 deletions(-) diff --git a/docs/index.md b/docs/index.md index a94beb02..d69efa50 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeieynav3nrbb5uv253e3bdj2tlagsyj6wjpyb6j3i6f5dewbb27pve --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeidlzbqg62k4rpcmwahof2gbcusnh6dk4oplasfuknhio25umjkw54 --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 3766bd52..1994ffcb 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice", + "agent/valory/impact_evaluator/0.1.0": "bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeieynav3nrbb5uv253e3bdj2tlagsyj6wjpyb6j3i6f5dewbb27pve", + "service/valory/impact_evaluator/0.1.0": "bafybeidlzbqg62k4rpcmwahof2gbcusnh6dk4oplasfuknhio25umjkw54", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeidv4ywbjlyokgxarv6c5k6n5hawv2wm2v62gloq2egwbawmvjoc3q", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaiujql7raft2d77adkahczyxvfbzypt4iynms66vzntczhre5qli", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -15,8 +15,8 @@ "connection/valory/openai/0.1.0": "bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq", "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", - "skill/valory/decision_making_abci/0.1.0": "bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4", - "service/valory/impact_evaluator_local/0.1.0": "bafybeihq63vfjrk6b3yfu3ghawor4zvrwvxyuxozkdyntohv42l664hneu", + "skill/valory/decision_making_abci/0.1.0": "bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m", + "service/valory/impact_evaluator_local/0.1.0": "bafybeicpuatvzhnnn76ovhblj75n5k2fibkdbjx72d4wbpwrrfthkb7joq", "skill/valory/olas_week_abci/0.1.0": "bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a" }, "third_party": { diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 8ff19eb1..44c95834 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeidv4ywbjlyokgxarv6c5k6n5hawv2wm2v62gloq2egwbawmvjoc3q +- valory/impact_evaluator_abci:0.1.0:bafybeiaiujql7raft2d77adkahczyxvfbzypt4iynms66vzntczhre5qli - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -53,7 +53,7 @@ skills: - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/decision_making_abci:0.1.0:bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4 +- valory/decision_making_abci:0.1.0:bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a default_ledger: ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index 9fa800f5..df9b61fb 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice +agent: valory/impact_evaluator:0.1.0:bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index bf5af252..984de055 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeigwhm65gaaew4an7v64twkhfrezisew5yyvbp26ifxsug7etu7ice +agent: valory/impact_evaluator:0.1.0:bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/decision_making_abci/fsm_specification.yaml b/packages/valory/skills/decision_making_abci/fsm_specification.yaml index ddd408da..ea8616ce 100644 --- a/packages/valory/skills/decision_making_abci/fsm_specification.yaml +++ b/packages/valory/skills/decision_making_abci/fsm_specification.yaml @@ -13,7 +13,6 @@ alphabet_in: - SCORE - UPDATE_CENTAURS - WEEK_IN_OLAS_CREATE -- WEEK_IN_OLAS_WRITE - WRITE_CONTRIBUTE_DB default_start_state: DecisionMakingRound final_states: @@ -59,5 +58,4 @@ transition_func: (DecisionMakingRound, SCORE): FinishedDecisionMakingScoreRound (DecisionMakingRound, UPDATE_CENTAURS): FinishedDecisionMakingUpdateCentaurRound (DecisionMakingRound, WEEK_IN_OLAS_CREATE): FinishedDecisionMakingWeekInOlasRound - (DecisionMakingRound, WEEK_IN_OLAS_WRITE): FinishedDecisionMakingWriteTwitterRound (DecisionMakingRound, WRITE_CONTRIBUTE_DB): FinishedDecisionMakingWriteContributeDBRound diff --git a/packages/valory/skills/decision_making_abci/skill.yaml b/packages/valory/skills/decision_making_abci/skill.yaml index 66228640..8eb81cd6 100644 --- a/packages/valory/skills/decision_making_abci/skill.yaml +++ b/packages/valory/skills/decision_making_abci/skill.yaml @@ -9,7 +9,7 @@ fingerprint: __init__.py: bafybeicq2o3mkcgbmi4hkmpr3c6fieemutea2gxthymxnbhpemrzlcp2la behaviours.py: bafybeidlfdovcj37dowftf6xswhsf2rawx7issrkwgx2xz4mseo66zhtwu dialogues.py: bafybeic5nwnax5tz6plxi5rww6davp23vgb6fixnlhzv2isoknuvb2bhye - fsm_specification.yaml: bafybeihd5kd3pj52wqhki324pwfc5hpigv57tovdyuv3kpsrihsa3ykn6m + fsm_specification.yaml: bafybeiaz2ejzn654bckao54i3dicbm3ehdpq4obc6lfo4hvngjxteld7ye handlers.py: bafybeibo54pwzdc5o4zwsqqaveiebxsfqtk2px5nh662bb5mxydtc2oz5q models.py: bafybeictln7abrfqkm42euj2ldb2aqh3j3vuz45gltlepldzucgqgjy3va payloads.py: bafybeif5bomwy74bwnphsk6bty6qb6efugvjnnopsz7qjunpe6gtgjaxya diff --git a/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml b/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml index 7a2f3fb4..172949bd 100644 --- a/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml +++ b/packages/valory/skills/impact_evaluator_abci/fsm_specification.yaml @@ -34,7 +34,6 @@ alphabet_in: - UPDATE_CENTAURS - VERIFICATION_ERROR - WEEK_IN_OLAS_CREATE -- WEEK_IN_OLAS_WRITE - WRITE_CONTRIBUTE_DB default_start_state: RegistrationStartupRound final_states: [] @@ -92,7 +91,6 @@ transition_func: (DecisionMakingRound, SCORE): GenericScoringRound (DecisionMakingRound, UPDATE_CENTAURS): RandomnessRound (DecisionMakingRound, WEEK_IN_OLAS_CREATE): OlasWeekDecisionMakingRound - (DecisionMakingRound, WEEK_IN_OLAS_WRITE): RandomnessTwitterRound (DecisionMakingRound, WRITE_CONTRIBUTE_DB): RandomnessRound (GenericScoringRound, DONE): TwitterDecisionMakingRound (GenericScoringRound, NO_MAJORITY): GenericScoringRound diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 6edfe4a8..47b6275e 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -10,7 +10,7 @@ fingerprint: behaviours.py: bafybeia53iegibc2svkyw6ovhs7f32tig2ut2okvogyaaeoijo3uj5l6ke composition.py: bafybeialteytmbpts5e4fxeivs2fatvujyultp6tpbmvsinlu73dfgjvji dialogues.py: bafybeigjknz4qqynbsltjje46gidg4rftsqw6ybjwegz24wetmycutpzh4 - fsm_specification.yaml: bafybeicyfp5jhurpyhutevkabexrujx7xyywexnq2lfxzwkqmdxdv5ihgq + fsm_specification.yaml: bafybeig7tva5gvvk3tpbhb3z442q7755cur5q5u5cgrxgf2v3543pt3lwy handlers.py: bafybeidkli6fphcmdgwsys4lkyf3fx6fbawet4nt2pnixfypzijhg6b3ze models.py: bafybeigtb7k4gk22574epnpitr6lqv2coaf2j5pgwuymh2xsvtj4qta2t4 tests/__init__.py: bafybeievwzwojvq4aofk5kjpf4jzygfes7ew6s6svc6b6frktjnt3sicce @@ -33,7 +33,7 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeigeoc363gv3wp2rrmk6p2fdxney33nxd3owtpfugzapgruwe4klyu - valory/termination_abci:0.1.0:bafybeigqpij2sgrpnilqjljfciixop4fldq5qceixc7534q6af4potdmdm - valory/transaction_settlement_abci:0.1.0:bafybeia7rzsbea3ch4gcafyp3z6uvqh4npws2xpdwbkkdbrqqpjops7nui -- valory/decision_making_abci:0.1.0:bafybeigo6amdjgfnucejyuag2mrqzwzl5lynwc2veeojjqyq525ybytpd4 +- valory/decision_making_abci:0.1.0:bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a From 70e3abe733685bdaa59a37337470308eb0f57661 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 17:14:51 +0200 Subject: [PATCH 25/26] fix: remove cross_period key --- docs/index.md | 2 +- packages/packages.json | 10 +++++----- .../valory/agents/impact_evaluator/aea-config.yaml | 4 ++-- packages/valory/services/impact_evaluator/service.yaml | 2 +- .../services/impact_evaluator_local/service.yaml | 2 +- .../valory/skills/impact_evaluator_abci/skill.yaml | 2 +- packages/valory/skills/olas_week_abci/rounds.py | 2 +- packages/valory/skills/olas_week_abci/skill.yaml | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/index.md b/docs/index.md index d69efa50..d440bc96 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,7 +31,7 @@ In order to run a local demo service based on the IEKit: 2. Fetch the IEKit. ```bash - autonomy fetch valory/impact_evaluator:0.1.0:bafybeidlzbqg62k4rpcmwahof2gbcusnh6dk4oplasfuknhio25umjkw54 --service + autonomy fetch valory/impact_evaluator:0.1.0:bafybeiaapq7a5g464bya2ic7rkidai23whm7jn4mie54nrc6kc2jpb7bf4 --service ``` 3. Build the Docker image of the service agents diff --git a/packages/packages.json b/packages/packages.json index 1994ffcb..cda71c0d 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,13 +1,13 @@ { "dev": { - "agent/valory/impact_evaluator/0.1.0": "bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka", + "agent/valory/impact_evaluator/0.1.0": "bafybeihirytmmua4677vv5avrzias2vd47hvziogaq2mfucg5lmlqctz24", "contract/valory/dynamic_contribution/0.1.0": "bafybeiht364qavknmnuz7pwkw4zjzrkkugyzymgxrjvtasfcy7eya3nbxa", - "service/valory/impact_evaluator/0.1.0": "bafybeidlzbqg62k4rpcmwahof2gbcusnh6dk4oplasfuknhio25umjkw54", + "service/valory/impact_evaluator/0.1.0": "bafybeiaapq7a5g464bya2ic7rkidai23whm7jn4mie54nrc6kc2jpb7bf4", "skill/valory/dynamic_nft_abci/0.1.0": "bafybeiexenlxvf32jjlxrow35qlo4xtmi2ezznulczhayux2n2mx27ya6i", "skill/valory/twitter_scoring_abci/0.1.0": "bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q", "skill/valory/ceramic_read_abci/0.1.0": "bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm", "skill/valory/ceramic_write_abci/0.1.0": "bafybeihnalj6zhl5pbf7x2lkznuhivwj45jzrafbtxatwebrpb7st2v6oa", - "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiaiujql7raft2d77adkahczyxvfbzypt4iynms66vzntczhre5qli", + "skill/valory/impact_evaluator_abci/0.1.0": "bafybeiexzqy6nrkfw2b6fbhqk5b4yipvj246lxzhipndeuub2zrlytwtgi", "skill/valory/generic_scoring_abci/0.1.0": "bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga", "protocol/valory/twitter/0.1.0": "bafybeib4eyf7qbs7kdntqzhwqsaaj4o2mzcokcztaza6qgwt7sbxgkqu2m", "protocol/valory/llm/1.0.0": "bafybeigqybmg75vsxexmp57hkms7lkp7iwpf54r7wpygizxryvrhfqqpb4", @@ -16,8 +16,8 @@ "skill/valory/twitter_write_abci/0.1.0": "bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq", "skill/valory/llm_abci/0.1.0": "bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije", "skill/valory/decision_making_abci/0.1.0": "bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m", - "service/valory/impact_evaluator_local/0.1.0": "bafybeicpuatvzhnnn76ovhblj75n5k2fibkdbjx72d4wbpwrrfthkb7joq", - "skill/valory/olas_week_abci/0.1.0": "bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a" + "service/valory/impact_evaluator_local/0.1.0": "bafybeih35wij4e32htxntga7svxddkgrrmcq36jae3xrmf4s6yuuovvcme", + "skill/valory/olas_week_abci/0.1.0": "bafybeidegg3yi5qww6q6r24pgjmmbkgconyfnecuohacljvferqqg3tc2e" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeifuxs7gdg2okbn7uofymenjlmnih2wxwkym44lsgwmklgwuckxm2m", diff --git a/packages/valory/agents/impact_evaluator/aea-config.yaml b/packages/valory/agents/impact_evaluator/aea-config.yaml index 44c95834..9884d1a3 100644 --- a/packages/valory/agents/impact_evaluator/aea-config.yaml +++ b/packages/valory/agents/impact_evaluator/aea-config.yaml @@ -42,7 +42,7 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeigafjci7m7ezwzasav5xqo7v2mbxxn7qb4y7vnuc2wr2irzvn7wsy - valory/abstract_round_abci:0.1.0:bafybeih2fyfb6kkf7r45pvdk7pyyebr5xloia4xiqxtb3qsrasnstqmepq -- valory/impact_evaluator_abci:0.1.0:bafybeiaiujql7raft2d77adkahczyxvfbzypt4iynms66vzntczhre5qli +- valory/impact_evaluator_abci:0.1.0:bafybeiexzqy6nrkfw2b6fbhqk5b4yipvj246lxzhipndeuub2zrlytwtgi - valory/generic_scoring_abci:0.1.0:bafybeig4hoc5gjiyuwh2ye3mwneegq3s3cghl5j7yokvngacvn7ixwdoga - valory/twitter_scoring_abci:0.1.0:bafybeicngrngwq4fna57rj4lo4nsvt73t3x3d33jb52po5e6kc7stbkl3q - valory/ceramic_read_abci:0.1.0:bafybeide5tbobzkwfdi7yzw6bsau36h43hdlgbnk2bfqvvhmq3hl3ucjmm @@ -55,7 +55,7 @@ skills: - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq - valory/decision_making_abci:0.1.0:bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije -- valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a +- valory/olas_week_abci:0.1.0:bafybeidegg3yi5qww6q6r24pgjmmbkgconyfnecuohacljvferqqg3tc2e default_ledger: ethereum required_ledgers: - ethereum diff --git a/packages/valory/services/impact_evaluator/service.yaml b/packages/valory/services/impact_evaluator/service.yaml index df9b61fb..fdf02a8e 100644 --- a/packages/valory/services/impact_evaluator/service.yaml +++ b/packages/valory/services/impact_evaluator/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka +agent: valory/impact_evaluator:0.1.0:bafybeihirytmmua4677vv5avrzias2vd47hvziogaq2mfucg5lmlqctz24 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/impact_evaluator_local/service.yaml b/packages/valory/services/impact_evaluator_local/service.yaml index 984de055..581892b4 100644 --- a/packages/valory/services/impact_evaluator_local/service.yaml +++ b/packages/valory/services/impact_evaluator_local/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeign56hilwuoa6bgos3uqabss4gew4vadkik7vhj3ucpqw6nxtqtpe fingerprint_ignore_patterns: [] -agent: valory/impact_evaluator:0.1.0:bafybeiafxelntysmv6jjtmhzas7ylvsewle5fqwqs2fpntv4oppzjvv7ka +agent: valory/impact_evaluator:0.1.0:bafybeihirytmmua4677vv5avrzias2vd47hvziogaq2mfucg5lmlqctz24 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/impact_evaluator_abci/skill.yaml b/packages/valory/skills/impact_evaluator_abci/skill.yaml index 47b6275e..a0d348bb 100644 --- a/packages/valory/skills/impact_evaluator_abci/skill.yaml +++ b/packages/valory/skills/impact_evaluator_abci/skill.yaml @@ -36,7 +36,7 @@ skills: - valory/decision_making_abci:0.1.0:bafybeicjrztkcvqjnk6odukj3j2dr6ee4j2jaaw5nsga6byjhjyuxhng5m - valory/llm_abci:0.1.0:bafybeifesvwe5ya7imxefijpawgtd7aje5hhr4oh2bzgfsm2ucjp3lxije - valory/twitter_write_abci:0.1.0:bafybeidjumloxy2yvoyymgzuwbua3ks2p66fyybna2qhrz2upzkxzjrznq -- valory/olas_week_abci:0.1.0:bafybeidtsgafy6shzdazo5443jnqe6j2h7hx77sew7dbjg5jt5vqvtwi4a +- valory/olas_week_abci:0.1.0:bafybeidegg3yi5qww6q6r24pgjmmbkgconyfnecuohacljvferqqg3tc2e behaviours: main: args: {} diff --git a/packages/valory/skills/olas_week_abci/rounds.py b/packages/valory/skills/olas_week_abci/rounds.py index 2988269b..53c6822d 100644 --- a/packages/valory/skills/olas_week_abci/rounds.py +++ b/packages/valory/skills/olas_week_abci/rounds.py @@ -469,7 +469,7 @@ class WeekInOlasAbciApp(AbciApp[Event]): Event.TWEET_EVALUATION_ROUND_TIMEOUT: 600.0, } cross_period_persisted_keys: FrozenSet[str] = frozenset( - ["ceramic_db", "pending_write", "summary_tweets"] + ["ceramic_db", "pending_write"] ) db_pre_conditions: Dict[AppState, Set[str]] = { OlasWeekDecisionMakingRound: set(), diff --git a/packages/valory/skills/olas_week_abci/skill.yaml b/packages/valory/skills/olas_week_abci/skill.yaml index 1504bf26..08b16d95 100644 --- a/packages/valory/skills/olas_week_abci/skill.yaml +++ b/packages/valory/skills/olas_week_abci/skill.yaml @@ -16,7 +16,7 @@ fingerprint: models.py: bafybeihsqzu4n2r5a4wlvcpmpnwkbtp3sr7axry53to5gpxoacqbkhx5cq payloads.py: bafybeietg3ceghstjx5bytqv2t377k5pyww3cdq7zg7d7lxhscwmfelai4 prompts.py: bafybeicz63x6rhrgm5amjkfsovnqvxqyzicfhhae3orw7jaubme2npnn2a - rounds.py: bafybeigkjt43nddhjh2qjncnseht3xrktmvvrtoqynxwcwun5ztwi3lmau + rounds.py: bafybeihy72ld66pzdamubpuj6obtbnr4tbzsxl4axb36maw4eru6bb66em fingerprint_ignore_patterns: [] connections: - valory/openai:0.1.0:bafybeibn42k4zebenmjsumkngfxllxbofkwdno2fm65o6zf5y2uihmo2dq From 52d4cb716618d3787231592031c673627d156020 Mon Sep 17 00:00:00 2001 From: David Vilela Date: Wed, 11 Oct 2023 18:00:40 +0200 Subject: [PATCH 26/26] fix: update schema --- schemas/centaurs_stream_schema.json | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/schemas/centaurs_stream_schema.json b/schemas/centaurs_stream_schema.json index d36fbb71..b50212da 100644 --- a/schemas/centaurs_stream_schema.json +++ b/schemas/centaurs_stream_schema.json @@ -103,6 +103,25 @@ "required": ["daily", "enabled", "last_run", "run_hour_utc"], "additionalProperties": false }, + "week_in_olas_config": { + "type": "object", + "properties": { + "weekly": { + "type": "integer" + }, + "enabled": { + "type": "boolean" + }, + "last_run": { + "type": ["integer", "null"] + }, + "run_hour_utc": { + "type": "integer" + } + }, + "required": ["weekly", "enabled", "last_run", "run_hour_utc"], + "additionalProperties": false + }, "scheduled_tweet_data": { "type": "object", "properties": { @@ -198,9 +217,12 @@ }, "daily_orbis": { "$ref": "#/definitions/daily_orbis_config" + }, + "week_in_olas": { + "$ref": "#/definitions/week_in_olas_config" } }, - "required": ["daily_tweet", "scheduled_tweet", "daily_orbis"], + "required": ["daily_tweet", "scheduled_tweet", "daily_orbis", "week_in_olas"], "additionalProperties": false }, "memberWhitelist": {