Skip to content

Commit 653947f

Browse files
RainbowRainbow
Rainbow
authored and
Rainbow
committed
Refactor project structure for better organization
1 parent e27e8c2 commit 653947f

16 files changed

+38
-38
lines changed

README.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
# AgentSDK.py
1+
# ATTPs SDK
22

3-
This library is a simple asynchronous python wrapper around [AI Agent SDK](https://github.com/APRO-com/ai-agent-sdk-python).
3+
This library is a simple asynchronous python wrapper around [ATTPs SDK](https://github.com/APRO-com/ATTPs-sdk-python).
44

55
# Installation
66
```bash
7-
$ pip3 install ai-agent-sdk
7+
$ pip3 install attps-sdk
88
```
99

1010
# Usage
1111

1212
### Initialize AgentSDK
1313

1414
```python
15-
from ai_agent.agent import AgentSDK
15+
from attps.verify.agent import AgentSDK
1616

17-
AGENT_PROXY_ADDRESS = "0x07771A3026E60776deC8C1C61106FB9623521394"
18-
NETWORK_RPC = "https://testnet-rpc.bitlayer.org"
17+
AGENT_PROXY_ADDRESS = "0x07771A3026E60776deC8C1C61106FB9623521394" # ATTPs verify module agent contract deployment address (EVM)
18+
NETWORK_RPC = "https://testnet-rpc.bitlayer.org" # ATTPs verify module agent contract deployment chain RPC address
1919

2020
agent = AgentSDK(endpoint_uri=NETWORK_RPC, proxy_address=AGENT_PROXY_ADDRESS)
2121
```
2222

23-
To create a new agent, call the createAndRegisterAgent method:
23+
To create a new verify agent, call the createAndRegisterAgent method:
2424

2525
```python
2626
import time
27-
from ai_agent.entities import (
27+
from attps.verify.entities import (
2828
AgentSettings,
2929
AgentHeader,
3030
MessageType,
3131
Priority
3232
)
33-
from ai_agent.utils import (
33+
from utils.utils import (
3434
generate_uuid_v4
3535
)
3636

@@ -45,17 +45,17 @@ AGENT_SETTINGS = AgentSettings(
4545
"0xD4E157c36E7299bB40800e4aE7909DDcA8097f67",
4646
"0xA3866A07ABEf3fD0643BD7e1c32600520F465ca8",
4747
"0x62f642Ae0Ed7F12Bc40F2a9Bf82ccD0a3F3b7531"
48-
],
49-
threshold=2,
50-
converter_address="0xaB303EF87774D9D259d1098E9aA4dD6c07F69240",
48+
], # Signer list corresponding to the Agent's signed data
49+
threshold=2, # Verification threshold, minimum number of correct signatures from signers
50+
converter_address="0xaB303EF87774D9D259d1098E9aA4dD6c07F69240", # Converter contract address for intermediate data processing between signed data and final signed data
5151
agent_header=AgentHeader(
52-
version="1.0",
53-
message_id="d4d0813f-ceb7-4ce1-8988-12899b26c4b6",
54-
source_agent_id="da70f6b3-e580-470f-b88b-caa5369e7778",
55-
source_agent_name="APRO Pull Mode Agent",
56-
target_agent_id="",
57-
timestamp=int(time.time()),
58-
message_type=MessageType.Event,
52+
version="1.0", # agent version
53+
message_id="d4d0813f-ceb7-4ce1-8988-12899b26c4b6", # Agent‘s Message ID, Used for target agent uniqueness verification
54+
source_agent_id="da70f6b3-e580-470f-b88b-caa5369e7778", # Source Agent ID, globally unique in the system
55+
source_agent_name="APRO Pull Mode Agent", # Source agent name
56+
target_agent_id="", # Target Agent ID
57+
timestamp=int(time.time()), # Agent registration time
58+
message_type=MessageType.Event, # Agent data transmission type, currently only supports Event
5959
priority=Priority.Low,
6060
ttl=60 * 60
6161
)
@@ -67,7 +67,7 @@ dynamic_setting.agent_header.target_agent_id = generate_uuid_v4()
6767
dynamic_setting.agent_header.message_id = generate_uuid_v4()
6868
user_owner = agent.add_account("0x_user_private_key")
6969
result = agent.create_and_register_agent(
70-
transmitter="",
70+
transmitter="",
7171
nonce=None,
7272
settings=AGENT_SETTINGS)
7373
print("created agent:", result)
@@ -76,17 +76,17 @@ print("created agent:", result)
7676
To verify the data integrity, call the verify method:
7777

7878
```python
79-
from ai_agent.entities import (
79+
from attps.verify.entities import (
8080
AgentMessagePayload,
8181
Proofs,
8282
AgentMetadata,
8383
)
8484

85-
AGENT_CONTRACT = "0xA1903361Ee8Ec35acC7c8951b4008dbE8D12C155"
86-
AGENT_SETTING_DIGEST = "0x010038164dba6abffb84eb5cb538850d9bc5d8f815149a371069b3255fd177a4"
85+
AGENT_CONTRACT = "0xA1903361Ee8Ec35acC7c8951b4008dbE8D12C155" # Verification contract corresponding to the agent
86+
AGENT_SETTING_DIGEST = "0x010038164dba6abffb84eb5cb538850d9bc5d8f815149a371069b3255fd177a4" # Agent's configuration information identifier, returned in the blockchain event during registration or modification
8787
AGENT_PAYLOAD = AgentMessagePayload(
8888
data="0x0006e706cf7ab41fa599311eb3de68be869198ce62aef1cd079475ca50e5b3f60000000000000000000000000000000000000000000000000000000002b1bf0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200003665949c883f9e0f6f002eac32e00bd59dfe6c34e92a91c37d6a8322d6489000000000000000000000000000000000000000000000000000000006762677d000000000000000000000000000000000000000000000000000000006762677d000000000000000000000000000000000000000000000000000003128629ec0800000000000000000000000000000000000000000000000004db732547630000000000000000000000000000000000000000000000000000000000006763b8fd0000000000000000000000000000000000000000000015f0f60671beb95cc0000000000000000000000000000000000000000000000015f083baa654a7b900000000000000000000000000000000000000000000000015f103ec7cb057ea80000000000000000000000000000000000000000000000000000000000000000003b64f7e72208147bb898e8b215d0997967bef0219263726c76995d8a19107d6ba5306a176474f9ccdb1bc5841f97e0592013e404e15b0de0839b81d0efb26179f222e0191269a8560ebd9096707d225bc606d61466b85d8568d7620a3b59a73e800000000000000000000000000000000000000000000000000000000000000037cae0f05c1bf8353eb5db27635f02b40a534d4192099de445764891198231c597a303cd15f302dafbb1263eb6e8e19cbacea985c66c6fed3231fd84a84ebe0276f69f481fe7808c339a04ceb905bb49980846c8ceb89a27b1c09713cb356f773",
89-
data_hash="0x53d9f133f1265bd4391fcdf89b63424cbcfd316c8448f76cc515647267ac0a8e",
89+
data_hash="0x53d9f133f1265bd4391fcdf89b63424cbcfd316c8448f76cc515647267ac0a8e", # Hash of the corresponding data
9090
proofs=Proofs(
9191
zk_proof="0x",
9292
merkle_proof="0x",
File renamed without changes.
File renamed without changes.

ai_agent/agent.py renamed to attps/verify/agent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
URI
1616
)
1717

18-
from ai_agent.core.core import Agent
19-
from ai_agent.entities import (
18+
from attps.verify.core.core import Agent
19+
from attps.verify.entities import (
2020
AgentSettings,
2121
AgentMessagePayload,
2222
AgentRegisterResults,

attps/verify/core/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ai_agent/core/core.py renamed to attps/verify/core/core.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
Union, Optional, Any,
2727
)
2828

29-
from ai_agent.core.abis.manger import AGENT_MANAGER_ABI
30-
from ai_agent.core.abis.proxy import AGENT_PROXY_ABI
31-
from ai_agent.core.abis.agent import AGENT_AGENT_ABI
29+
from attps.verify.core.abis import AGENT_MANAGER_ABI
30+
from attps.verify.core.abis import AGENT_PROXY_ABI
31+
from attps.verify.core.abis import AGENT_AGENT_ABI
3232

33-
from ai_agent.entities import (
33+
from attps.verify.entities import (
3434
AgentSettings,
3535
AgentMessagePayload,
3636
AgentRegisterResults,
@@ -39,7 +39,7 @@
3939
Priority,
4040
_EIP1559GAS
4141
)
42-
from ai_agent.utils import (
42+
from utils.utils import (
4343
add_0x_prefix,
4444
is_valid_private_key,
4545
is_valid_address,
File renamed without changes.
File renamed without changes.

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
from pathlib import Path
88

99
version = {}
10-
version_path = Path('ai_agent/version.py').resolve()
10+
version_path = Path('attps/version.py').resolve()
1111
with open(version_path) as f:
1212
exec(f.read(), version)
1313

1414
with open("README.md", "r") as fh:
1515
long_description = fh.read()
1616

1717
setup(
18-
name='ai-agent-sdk',
18+
name='attps-sdk',
1919
version=version['__version__'],
2020
author='APRO',
2121
author_email='apro@apro.com',
22-
description='ai agent sdk for apro',
22+
description='ATTPs sdk for APRO',
2323
long_description=long_description,
2424
long_description_content_type="text/markdown",
25-
url='https://github.com/APRO-com/ai-agent-sdk-python',
25+
url='https://github.com/APRO-com/ATTPs-sdk-python',
2626
packages=find_packages(),
2727
install_requires=[
2828
'web3 > 7.0.0',

tests/test_agent.py renamed to tests/test_attps_verify.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import time
33

44
from dotenv import load_dotenv
5-
from ai_agent.agent import AgentSDK
6-
from ai_agent.entities import (
5+
from attps.verify.agent import AgentSDK
6+
from attps.verify.entities import (
77
AgentSettings,
88
AgentHeader,
99
MessageType,
1010
Priority, AgentMessagePayload, Proofs, AgentMetadata
1111
)
12-
from ai_agent.utils import (
12+
from utils.utils import (
1313
generate_uuid_v4,
1414
is_valid_uuid_v4,
1515
is_valid_address,

utils/__init__.py

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)