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.
- {mech_client-0.2.14 → mech_client-0.2.15}/PKG-INFO +1 -1
- mech_client-0.2.15/mech_client/__init__.py +3 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/interact.py +28 -10
- {mech_client-0.2.14 → mech_client-0.2.15}/pyproject.toml +1 -1
- mech_client-0.2.14/mech_client/__init__.py +0 -3
- {mech_client-0.2.14 → mech_client-0.2.15}/LICENSE +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/README.md +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/acn.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/cli.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/configs/mechs.json +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/__init__.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/README.md +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/__init__.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/acn.proto +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/acn_pb2.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/custom_types.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/dialogues.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/message.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/protocol.yaml +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/serialization.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/__init__.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_dialogues.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_messages.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/README.md +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/__init__.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share.proto +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share_pb2.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/dialogues.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/message.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/protocol.yaml +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/serialization.py +0 -0
- {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
- {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
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/README.md +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/__init__.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.yaml +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/prompt_to_ipfs.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/push_to_ipfs.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/subgraph.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/to_png.py +0 -0
- {mech_client-0.2.14 → mech_client-0.2.15}/mech_client/wss.py +0 -0
|
@@ -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(
|
|
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(
|
|
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("
|
|
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(
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_dialogues.py
RENAMED
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn/tests/test_acn_messages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share.proto
RENAMED
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/acn_data_share_pb2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/acn_data_share/serialization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.py
RENAMED
|
File without changes
|
{mech_client-0.2.14 → mech_client-0.2.15}/mech_client/helpers/p2p_libp2p_client/connection.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|