diff --git a/.gitleaksignore b/.gitleaksignore index 18b2ce44..602eb50c 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -137,4 +137,5 @@ eecbf34a242377fb07d28230cf11ea43fb07de8d:packages/valory/skills/task_execution/s d7f9fd6ad8bcf9ea2bf14bf3de221971ddb56268:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 c0dee637e3d520b9706e91db197e859ca5fce23a:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 c0aaf1331142b5e804d41ebe1a17be19b6014eb4:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 -bead325392d69c64be89a862c92134e5b8663832:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 \ No newline at end of file +bead325392d69c64be89a862c92134e5b8663832:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 +0d067561292282eee8a0b8036daeafba0eaa7734:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15 \ No newline at end of file diff --git a/packages/packages.json b/packages/packages.json index b29b0627..7da25bf1 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -8,14 +8,14 @@ "contract/valory/mech_marketplace/0.1.0": "bafybeigulghv7bvx4evl6kmogvv6gjxovyt22tkwlbdmeretmop2crdmem", "connection/valory/websocket_client/0.1.0": "bafybeic4ag3gqc7kd3k2o3pucddj2odck5yrfbgmwh5veqny7zao5qayli", "skill/valory/contract_subscription/0.1.0": "bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy", - "skill/valory/mech_abci/0.1.0": "bafybeibqrc3k3f5ozjzoe46p3tpsuwifn44xhhxlcigtx6hv6ozkbfaaoi", - "skill/valory/task_submission_abci/0.1.0": "bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e", - "skill/valory/task_execution/0.1.0": "bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q", + "skill/valory/mech_abci/0.1.0": "bafybeihshsjc2pngbaglptgeijgpcd6ns7darhhp75ryhfao5t4uuw3hym", + "skill/valory/task_submission_abci/0.1.0": "bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy", + "skill/valory/task_execution/0.1.0": "bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm", "skill/valory/websocket_client/0.1.0": "bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m", "skill/valory/subscription_abci/0.1.0": "bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq", - "agent/valory/mech/0.1.0": "bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324", - "service/valory/mech/0.1.0": "bafybeifai4fbkcxrljyko4jqqibaetg7npc3etksntu4tnnwazifodghgu", - "service/valory/mech_quickstart/0.1.0": "bafybeig544gw6i7ahlwj6d64djlwfltjuznz3p66kmwk4m6bzqtn2bjfbq" + "agent/valory/mech/0.1.0": "bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4", + "service/valory/mech/0.1.0": "bafybeic7hnfs3gum33ndinhyzablfa4yf5y4lkvivuxg4bgvhz5zdxn6oa", + "service/valory/mech_quickstart/0.1.0": "bafybeiezswb5cbhuauk23kd6gsdbwnp2ndjysgc4uabk44k3vy2lmwz5mu" }, "third_party": { "protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq", diff --git a/packages/valory/agents/mech/aea-config.yaml b/packages/valory/agents/mech/aea-config.yaml index 4131f9a1..094e9166 100644 --- a/packages/valory/agents/mech/aea-config.yaml +++ b/packages/valory/agents/mech/aea-config.yaml @@ -39,12 +39,12 @@ skills: - valory/abstract_abci:0.1.0:bafybeieo7pe5wqjphs5izpz5aujjbubymlxub62b3rhx6yglu65ibalffu - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/contract_subscription:0.1.0:bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy -- valory/mech_abci:0.1.0:bafybeibqrc3k3f5ozjzoe46p3tpsuwifn44xhhxlcigtx6hv6ozkbfaaoi +- valory/mech_abci:0.1.0:bafybeihshsjc2pngbaglptgeijgpcd6ns7darhhp75ryhfao5t4uuw3hym - valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq - valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e - valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq -- valory/task_execution:0.1.0:bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q -- valory/task_submission_abci:0.1.0:bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e +- valory/task_execution:0.1.0:bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm +- valory/task_submission_abci:0.1.0:bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy - valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy - valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m diff --git a/packages/valory/services/mech/service.yaml b/packages/valory/services/mech/service.yaml index d9a6e706..c4ae7a28 100644 --- a/packages/valory/services/mech/service.yaml +++ b/packages/valory/services/mech/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeif7ia4jdlazy6745ke2k2x5yoqlwsgwr6sbztbgqtwvs3ndm2p7ba fingerprint_ignore_patterns: [] -agent: valory/mech:0.1.0:bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324 +agent: valory/mech:0.1.0:bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/mech_quickstart/service.yaml b/packages/valory/services/mech_quickstart/service.yaml index 4c996e24..7c7859a3 100644 --- a/packages/valory/services/mech_quickstart/service.yaml +++ b/packages/valory/services/mech_quickstart/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeiaqaedhfzjxxdfxtygjulorvd4x2h3cbwtiw3xgbigjgsc6qfn7zy fingerprint_ignore_patterns: [] -agent: valory/mech:0.1.0:bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324 +agent: valory/mech:0.1.0:bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/mech_abci/skill.yaml b/packages/valory/skills/mech_abci/skill.yaml index 6ff324ce..5eba6073 100644 --- a/packages/valory/skills/mech_abci/skill.yaml +++ b/packages/valory/skills/mech_abci/skill.yaml @@ -23,7 +23,7 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq - valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e -- valory/task_submission_abci:0.1.0:bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e +- valory/task_submission_abci:0.1.0:bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy - valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy - valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq diff --git a/packages/valory/skills/task_execution/behaviours.py b/packages/valory/skills/task_execution/behaviours.py index 138f97b0..16c08b39 100644 --- a/packages/valory/skills/task_execution/behaviours.py +++ b/packages/valory/skills/task_execution/behaviours.py @@ -420,7 +420,8 @@ def _handle_timeout_task(self) -> None: def _safely_get_task_data(self, message: IpfsMessage) -> Optional[Dict[str, Any]]: """Safely get task data.""" try: - [json.loads(content) for content in message.files.values()][0] + task_data = [json.loads(content) for content in message.files.values()][0] + return task_data except Exception as e: # pylint: disable=broad-except self.context.logger.error( f"Exception raised while decoding task data: {str(e)}" @@ -436,9 +437,13 @@ def _handle_get_task(self, message: IpfsMessage, dialogue: Dialogue) -> None: and "prompt" in task_data and "tool" in task_data ) # pylint: disable=C0301 - if is_data_valid and task_data["tool"] in self._tools_to_package_hash: + if ( + is_data_valid + and task_data is not None + and task_data["tool"] in self._tools_to_package_hash + ): self._prepare_task(task_data) - elif is_data_valid: + elif is_data_valid and task_data is not None: tool = task_data["tool"] executing_task = cast(Dict[str, Any], self._executing_task) executing_task["tool"] = tool diff --git a/packages/valory/skills/task_execution/models.py b/packages/valory/skills/task_execution/models.py index bea644fe..ca32cef8 100644 --- a/packages/valory/skills/task_execution/models.py +++ b/packages/valory/skills/task_execution/models.py @@ -20,7 +20,7 @@ """This module contains the shared state for the abci skill of Mech.""" import dataclasses from collections import defaultdict -from typing import Any, Callable, Dict, Optional, List +from typing import Any, Callable, Dict, List, Optional from aea.exceptions import enforce from aea.skills.base import Model diff --git a/packages/valory/skills/task_execution/skill.yaml b/packages/valory/skills/task_execution/skill.yaml index 85582d89..1de2cc93 100644 --- a/packages/valory/skills/task_execution/skill.yaml +++ b/packages/valory/skills/task_execution/skill.yaml @@ -7,10 +7,10 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeidqhvvlnthkbnmrdkdeyjyx2f2ab6z4xdgmagh7welqnh2v6wczx4 - behaviours.py: bafybeiexshowozpbzuomhezg3a5b2re77ikidjkiy3fov2tsfiqyk6dmwe + behaviours.py: bafybeihuja3eox24bl7kyym2hbyrkuktkhso5s7yt3cvrjn7ng73bzvvga dialogues.py: bafybeid4zxalqdlo5mw4yfbuf34hx4jp5ay5z6chm4zviwu4cj7fudtwca handlers.py: bafybeidbt5ezj74cgfogk3w4uw4si2grlnk5g54veyumw7g5yh6gdscywu - models.py: bafybeibsnirbekd7ondvm2lkrabm5wxzwsl6xkf2ccmrbfugkz4cola77u + models.py: bafybeicohoprd4f6rxnt6zxgwzzb3djpyk4o72bepoty4lybnf7fdpkgbu utils/__init__.py: bafybeiccdijaigu6e5p2iruwo5mkk224o7ywedc7nr6xeu5fpmhjqgk24e utils/apis.py: bafybeigu73lfz3g3mc6iupisrvlsp3fyl4du3oqlyajgdpfvtqypddh3w4 utils/benchmarks.py: bafybeiafnee7iay6dyjnatyqyzjov5c4ibl3ojamjmgfjri7cyghl7qayq @@ -92,4 +92,6 @@ dependencies: version: ==0.2.1 eth-abi: version: ==4.0.0 + pyyaml: + version: ==6.0.1 is_abstract: false diff --git a/packages/valory/skills/task_submission_abci/behaviours.py b/packages/valory/skills/task_submission_abci/behaviours.py index a25bce63..c08273b5 100644 --- a/packages/valory/skills/task_submission_abci/behaviours.py +++ b/packages/valory/skills/task_submission_abci/behaviours.py @@ -146,13 +146,13 @@ def to_multihash(hash_string: str) -> str: return hex_multihash[6:] def get_contract_api_response( - self, - performative: ContractApiMessage.Performative, - contract_address: Optional[str], - contract_id: str, - contract_callable: str, - ledger_id: Optional[str] = None, - **kwargs: Any, + self, + performative: ContractApiMessage.Performative, + contract_address: Optional[str], + contract_id: str, + contract_callable: str, + ledger_id: Optional[str] = None, + **kwargs: Any, ) -> Generator[None, None, ContractApiMessage]: """Get the contract api response.""" return super().get_contract_api_response( diff --git a/packages/valory/skills/task_submission_abci/skill.yaml b/packages/valory/skills/task_submission_abci/skill.yaml index c66ccd2d..0479b2c7 100644 --- a/packages/valory/skills/task_submission_abci/skill.yaml +++ b/packages/valory/skills/task_submission_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeiholqak7ltw6bbmn2c5tn3j7xgzkdlfzp3kcskiqsvmxoih6m4muq - behaviours.py: bafybeicq6246kgnfbbk4gyp4ptje4u56bc5mkwsi7eln6bnmrtg7cdlepq + behaviours.py: bafybeigsgqxuwoacedl5yz36riqcl2j2bdohhpkq3m2u5c66rbvsan77ee dialogues.py: bafybeibmac3m5u5h6ucoyjr4dazay72dyga656wvjl6z6saapluvjo54ne fsm_specification.yaml: bafybeidtmsmpunr3t77pshd3k2s6dd6hlvhze6inu3gj7xyvlg4wi3tnuu handlers.py: bafybeibe5n7my2vd2wlwo73sbma65epjqc7kxgtittewlylcmvnmoxtxzq @@ -32,7 +32,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy -- valory/task_execution:0.1.0:bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q +- valory/task_execution:0.1.0:bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm behaviours: main: args: {} diff --git a/poetry.lock b/poetry.lock index 02b03a85..04ddac28 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -1972,7 +1972,7 @@ py-multicodec = ">=0.2.0" pymultihash = "0.8.2" pytest = {version = ">=7.0.0,<7.3.0", optional = true, markers = "extra == \"all\""} python-dotenv = ">=0.14.0,<1.0.1" -pyyaml = ">=6.0.1,<7" +pyyaml = {version = ">=6.0.1,<7", optional = true, markers = "extra == \"all\""} requests = ">=2.28.1,<3" semver = ">=2.9.1,<3.0.0"