mech-client 0.2.14__tar.gz → 0.2.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {mech_client-0.2.14 → mech_client-0.2.15}/PKG-INFO +1 -1
  2. mech_client-0.2.15/mech_client/__init__.py +3 -0
  3. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/interact.py +28 -10
  4. {mech_client-0.2.14 → mech_client-0.2.15}/pyproject.toml +1 -1
  5. mech_client-0.2.14/mech_client/__init__.py +0 -3
  6. {mech_client-0.2.14 → mech_client-0.2.15}/LICENSE +0 -0
  7. {mech_client-0.2.14 → mech_client-0.2.15}/README.md +0 -0
  8. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/acn.py +0 -0
  9. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/cli.py +0 -0
  10. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/configs/mechs.json +0 -0
  11. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/__init__.py +0 -0
  12. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/README.md +0 -0
  13. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/__init__.py +0 -0
  14. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/acn.proto +0 -0
  15. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/acn_pb2.py +0 -0
  16. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/custom_types.py +0 -0
  17. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/dialogues.py +0 -0
  18. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/message.py +0 -0
  19. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/protocol.yaml +0 -0
  20. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/serialization.py +0 -0
  21. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/__init__.py +0 -0
  22. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn.py +0 -0
  23. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_dialogues.py +0 -0
  24. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_messages.py +0 -0
  25. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/README.md +0 -0
  26. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/__init__.py +0 -0
  27. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share.proto +0 -0
  28. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share_pb2.py +0 -0
  29. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/dialogues.py +0 -0
  30. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/message.py +0 -0
  31. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/protocol.yaml +0 -0
  32. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/serialization.py +0 -0
  33. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_dialogues.py +0 -0
  34. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_messages.py +0 -0
  35. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/README.md +0 -0
  36. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/__init__.py +0 -0
  37. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.py +0 -0
  38. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.yaml +0 -0
  39. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/prompt_to_ipfs.py +0 -0
  40. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/push_to_ipfs.py +0 -0
  41. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/subgraph.py +0 -0
  42. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/to_png.py +0 -0
  43. {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/wss.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mech-client
3
- Version: 0.2.14
3
+ Version: 0.2.15
4
4
  Summary: Basic client to interact with a mech
5
5
  License: Apache-2.0
6
6
  Author: David Minarsch
@@ -0,0 +1,3 @@
1
+ """Mech client."""
2
+
3
+ __version__ = "0.2.15"
@@ -160,10 +160,18 @@ def get_mech_config(chain_config: Optional[str] = None) -> MechConfig:
160
160
  if chain_config is None:
161
161
  chain_config = next(iter(data))
162
162
 
163
- print(f"Chain configuration: {chain_config}")
163
+ print("Chain configuration:")
164
164
  entry = data[chain_config].copy()
165
165
  ledger_config = LedgerConfig(**entry.pop("ledger_config"))
166
166
  mech_config = MechConfig(**entry, ledger_config=ledger_config)
167
+
168
+ print(f" - Chain ID: {chain_config}")
169
+ print(f" - Gas limit: {mech_config.gas_limit}")
170
+ print(f" - Contract ABI URL: {mech_config.contract_abi_url}")
171
+ print(f" - Transation URL: {mech_config.transaction_url}")
172
+ print(f" - Subgraph URL: {mech_config.subgraph_url}")
173
+ print("")
174
+
167
175
  return mech_config
168
176
 
169
177
 
@@ -371,7 +379,9 @@ def send_request( # pylint: disable=too-many-arguments,too-many-locals
371
379
  v1_file_hash_hex_truncated, v1_file_hash_hex = push_metadata_to_ipfs(
372
380
  prompt, tool, extra_attributes
373
381
  )
374
- print(f"Prompt uploaded: https://gateway.autonolas.tech/ipfs/{v1_file_hash_hex}")
382
+ print(
383
+ f" - Prompt uploaded: https://gateway.autonolas.tech/ipfs/{v1_file_hash_hex}"
384
+ )
375
385
  method_name = "request"
376
386
  methord_args = {"data": v1_file_hash_hex_truncated}
377
387
  tx_args = {
@@ -573,7 +583,7 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
573
583
  request_signature=request_event_signature,
574
584
  deliver_signature=deliver_event_signature,
575
585
  )
576
- print("Sending request...")
586
+ print("Sending Mech request...")
577
587
  transaction_digest = send_request(
578
588
  crypto=crypto,
579
589
  ledger_api=ledger_api,
@@ -586,19 +596,26 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
586
596
  timeout=timeout,
587
597
  sleep=sleep,
588
598
  )
599
+
600
+ if not transaction_digest:
601
+ print("Unable to send request")
602
+ return None
603
+
589
604
  transaction_url_formatted = mech_config.transaction_url.format(
590
605
  transaction_digest=transaction_digest
591
606
  )
592
- print(f"Transaction sent: {transaction_url_formatted}")
593
- print("Waiting for transaction receipt...")
607
+ print(f" - Transaction sent: {transaction_url_formatted}")
608
+ print(" - Waiting for transaction receipt...")
594
609
  request_id = watch_for_request_id(
595
610
  wss=wss,
596
611
  mech_contract=mech_contract,
597
612
  ledger_api=ledger_api,
598
613
  request_signature=request_event_signature,
599
614
  )
600
- print(f"Created on-chain request with ID {request_id}")
601
- print("Waiting for Mech response...")
615
+ print(f" - Created on-chain request with ID {request_id}")
616
+ print("")
617
+
618
+ print("Waiting for Mech deliver...")
602
619
  data_url = wait_for_data_url(
603
620
  request_id=request_id,
604
621
  wss=wss,
@@ -610,8 +627,9 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
610
627
  confirmation_type=confirmation_type,
611
628
  )
612
629
  if data_url:
613
- print(f"Data arrived: {data_url}")
614
- data = requests.get(f"{data_url}/{request_id}").json()
615
- print(f"Data from agent: {data}")
630
+ print(f" - Data arrived: {data_url}")
631
+ data = requests.get(f"{data_url}/{request_id}", timeout=30).json()
632
+ print(" - Data from agent:")
633
+ print(json.dumps(data, indent=2))
616
634
  return data
617
635
  return None
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "mech-client"
3
- version = "0.2.14"
3
+ version = "0.2.15"
4
4
  description = "Basic client to interact with a mech"
5
5
  authors = ["David Minarsch <david.minarsch@googlemail.com>"]
6
6
  readme = "README.md"
@@ -1,3 +0,0 @@
1
- """Mech client."""
2
-
3
- __version__ = "0.2.14"
File without changes
File without changes