From fa4dfa241f96fadf581fd229080e72b979d69010 Mon Sep 17 00:00:00 2001 From: Ardian Date: Tue, 26 Mar 2024 20:11:03 +0100 Subject: [PATCH] feat: add metadata to ipfs response --- packages/packages.json | 6 +++--- packages/valory/agents/mech/aea-config.yaml | 2 +- packages/valory/services/mech/service.yaml | 2 +- packages/valory/skills/task_execution/behaviours.py | 6 ++++++ packages/valory/skills/task_execution/skill.yaml | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 0daee355..71f544a9 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -24,11 +24,11 @@ "skill/valory/contract_subscription/0.1.0": "bafybeicyugrkx5glat4p4ezwf6i7oduh26eycfie6ftd4uxrknztzl3ik4", "skill/valory/mech_abci/0.1.0": "bafybeicpuwyiiivolhfs3w6iwcx5gpcxtsf273ay7nch7f2ocxm7fd6bqm", "skill/valory/task_submission_abci/0.1.0": "bafybeidmkzpqpvyol3636eeprkloy3z3t2nipmwvu6da3dtk2q4tjlab6u", - "skill/valory/task_execution/0.1.0": "bafybeifb5ic5lczqiekojahagyw73ylp7me4nrn7ltgycpbryvzorrqbwa", + "skill/valory/task_execution/0.1.0": "bafybeibsh4npvg3emrfmc5actwu4z35jiepems63y2easnvk5wloffrqny", "skill/valory/websocket_client/0.1.0": "bafybeidwntmkk4b2ixq5454ycbkknclqx7a6vpn7aqpm2nw3duszqrxvta", "skill/valory/subscription_abci/0.1.0": "bafybeidoqeznyhbh3znaqbfdnftzq6fdh77m35qgftdwz46nz2iwda4yam", - "agent/valory/mech/0.1.0": "bafybeia6suywbe4ptwtrmccbgiotf5rmzz6xusqbmqclzebk6sbkgtwku4", - "service/valory/mech/0.1.0": "bafybeicpthl4524tdqcek5qfuof552ibbagz4jipczimi6c2osmyfxmnm4" + "agent/valory/mech/0.1.0": "bafybeiev4umy27jx2z5uqiwls6uqexqa2mpy5sftg234sf3bjk5vnfsq2m", + "service/valory/mech/0.1.0": "bafybeiejytztqmxbxl5r7jzq3fo3h6rc6o4ojnbipnkwxowhukr6bioegi" }, "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 be535b2b..fff4b3e2 100644 --- a/packages/valory/agents/mech/aea-config.yaml +++ b/packages/valory/agents/mech/aea-config.yaml @@ -42,7 +42,7 @@ skills: - valory/registration_abci:0.1.0:bafybeiek7zcsxbucjwzgqfftafhfrocvc7q4yxllh2q44jeemsjxg3rcfm - valory/reset_pause_abci:0.1.0:bafybeidw4mbx3os3hmv7ley7b3g3gja7ydpitr7mxbjpwzxin2mzyt5yam - valory/subscription_abci:0.1.0:bafybeidoqeznyhbh3znaqbfdnftzq6fdh77m35qgftdwz46nz2iwda4yam -- valory/task_execution:0.1.0:bafybeifb5ic5lczqiekojahagyw73ylp7me4nrn7ltgycpbryvzorrqbwa +- valory/task_execution:0.1.0:bafybeibsh4npvg3emrfmc5actwu4z35jiepems63y2easnvk5wloffrqny - valory/task_submission_abci:0.1.0:bafybeidmkzpqpvyol3636eeprkloy3z3t2nipmwvu6da3dtk2q4tjlab6u - valory/termination_abci:0.1.0:bafybeihq6qtbwt6i53ayqym63vhjexkcppy26gguzhhjqywfmiuqghvv44 - valory/transaction_settlement_abci:0.1.0:bafybeigtzlk4uakmd54rxnznorcrstsr52kta474lgrnvx5ovr546vj7sq diff --git a/packages/valory/services/mech/service.yaml b/packages/valory/services/mech/service.yaml index fbaf547b..9f763f50 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:bafybeia6suywbe4ptwtrmccbgiotf5rmzz6xusqbmqclzebk6sbkgtwku4 +agent: valory/mech:0.1.0:bafybeiev4umy27jx2z5uqiwls6uqexqa2mpy5sftg234sf3bjk5vnfsq2m number_of_agents: 4 deployment: agent: diff --git a/packages/valory/skills/task_execution/behaviours.py b/packages/valory/skills/task_execution/behaviours.py index d5d15037..1bc3ba0d 100644 --- a/packages/valory/skills/task_execution/behaviours.py +++ b/packages/valory/skills/task_execution/behaviours.py @@ -285,6 +285,7 @@ def _handle_done_task(self, task_result: Any) -> None: request_id_nonce = executing_task.get("requestIdWithNonce", None) mech_address = executing_task.get("contract_address", None) tool = executing_task.get("tool", None) + model = executing_task.get("model", None) response = {"requestId": req_id, "result": "Invalid response"} task_executor = self.context.agent_address self._done_task = { @@ -300,11 +301,16 @@ def _handle_done_task(self, task_result: Any) -> None: cost_dict = {} if counter_callback is not None: cost_dict = cast(TokenCounterCallback, counter_callback).cost_dict + metadata = { + "model": model, + "tool": tool, + } response = { **response, "result": deliver_msg, "prompt": prompt, "cost_dict": cost_dict, + "metadata": metadata, } self._done_task["transaction"] = transaction diff --git a/packages/valory/skills/task_execution/skill.yaml b/packages/valory/skills/task_execution/skill.yaml index 91045a6f..4b273789 100644 --- a/packages/valory/skills/task_execution/skill.yaml +++ b/packages/valory/skills/task_execution/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeidqhvvlnthkbnmrdkdeyjyx2f2ab6z4xdgmagh7welqnh2v6wczx4 - behaviours.py: bafybeidhr64btgmwngowvmu4vwbxb4jtrf5wq6y6yfz5qemwhsguxia7ze + behaviours.py: bafybeifkhzdmlrpfy7mixr4mvd2pk22xa3bx733c6xiukcckepkqp6x36q dialogues.py: bafybeid4zxalqdlo5mw4yfbuf34hx4jp5ay5z6chm4zviwu4cj7fudtwca handlers.py: bafybeidbt5ezj74cgfogk3w4uw4si2grlnk5g54veyumw7g5yh6gdscywu models.py: bafybeid6befxrrbiaw7nduz4zgbm5nfc246fn2eb6rfmja6v5hmq4wtcwe