Skip to content

Commit

Permalink
feat: add metadata to ipfs response
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdi committed Mar 26, 2024
1 parent 443ffe9 commit fa4dfa2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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:bafybeia6suywbe4ptwtrmccbgiotf5rmzz6xusqbmqclzebk6sbkgtwku4
agent: valory/mech:0.1.0:bafybeiev4umy27jx2z5uqiwls6uqexqa2mpy5sftg234sf3bjk5vnfsq2m
number_of_agents: 4
deployment:
agent:
Expand Down
6 changes: 6 additions & 0 deletions packages/valory/skills/task_execution/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/task_execution/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa4dfa2

Please sign in to comment.