Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
KahanMajmudar committed Nov 22, 2024
1 parent cd1cf45 commit 3782d90
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 27 deletions.
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "bafybeiemt7z6giuvp3e2s5scfw6vvmjsgzx2ii7sdhxjsptm4u62upqicm",
"skill/valory/task_submission_abci/0.1.0": "bafybeifje4zaohdjppv6yl7m7qccmoch4gggkrmzfdyz4lphuzup2p24xy",
"skill/valory/task_execution/0.1.0": "bafybeiec7rlfiytedurta6xkgtxq4xcemshgixqfb5e5kohqtdpp7wedly",
"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": "bafybeieoqwmnwk4od2qt357nb5zbo7clapw5mz6a44up7p5ewdqm7s4gga",
"service/valory/mech/0.1.0": "bafybeidbosclijumymnvru4motqy5luna3oumx2tgvzbzfaahhezdd5624",
"service/valory/mech_quickstart/0.1.0": "bafybeibqujd4jvvfmmxc4tlpr6ajt5mqqwws5bwrftgx72hujtmw5yswvy"
},
"third_party": {
"protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeiemt7z6giuvp3e2s5scfw6vvmjsgzx2ii7sdhxjsptm4u62upqicm
- 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:bafybeiec7rlfiytedurta6xkgtxq4xcemshgixqfb5e5kohqtdpp7wedly
- valory/task_submission_abci:0.1.0:bafybeifje4zaohdjppv6yl7m7qccmoch4gggkrmzfdyz4lphuzup2p24xy
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/mech/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeieoqwmnwk4od2qt357nb5zbo7clapw5mz6a44up7p5ewdqm7s4gga
number_of_agents: 4
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/mech_quickstart/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeieoqwmnwk4od2qt357nb5zbo7clapw5mz6a44up7p5ewdqm7s4gga
number_of_agents: 1
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/mech_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeifje4zaohdjppv6yl7m7qccmoch4gggkrmzfdyz4lphuzup2p24xy
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq
Expand Down
11 changes: 8 additions & 3 deletions packages/valory/skills/task_execution/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/task_execution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/valory/skills/task_execution/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ dependencies:
version: ==0.2.1
eth-abi:
version: ==4.0.0
pyyaml:
version: ==6.0.1
is_abstract: false
14 changes: 7 additions & 7 deletions packages/valory/skills/task_submission_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/task_submission_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:bafybeiec7rlfiytedurta6xkgtxq4xcemshgixqfb5e5kohqtdpp7wedly
behaviours:
main:
args: {}
Expand Down
136 changes: 133 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ websocket_client = "<1,>=0.32.0"
toml = "==0.10.2"
eth-abi = "==4.0.0"
pytest = "==7.2.1"
openapi-core = "0.15.0"

[tool.poetry.group.dev.dependencies]
tomte = {version = ">=0.2.15", extras = ["cli", "tests"]}

0 comments on commit 3782d90

Please sign in to comment.