agent0-sdk 1.2.0__tar.gz → 1.4.1__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.
- {agent0_sdk-1.2.0/agent0_sdk.egg-info → agent0_sdk-1.4.1}/PKG-INFO +26 -10
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/README.md +25 -9
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/__init__.py +6 -1
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/agent.py +232 -180
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/contracts.py +13 -7
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/feedback_manager.py +98 -55
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/indexer.py +73 -19
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/models.py +4 -3
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/sdk.py +42 -14
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/subgraph_client.py +9 -3
- agent0_sdk-1.4.1/agent0_sdk/core/transaction_handle.py +71 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/value_encoding.py +3 -3
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/web3_client.py +44 -4
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1/agent0_sdk.egg-info}/PKG-INFO +26 -10
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk.egg-info/SOURCES.txt +1 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/pyproject.toml +4 -1
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/LICENSE +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/MANIFEST.in +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/endpoint_crawler.py +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/ipfs_client.py +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/core/oasf_validator.py +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/taxonomies/all_domains.json +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk/taxonomies/all_skills.json +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk.egg-info/dependency_links.txt +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk.egg-info/requires.txt +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/agent0_sdk.egg-info/top_level.txt +0 -0
- {agent0_sdk-1.2.0 → agent0_sdk-1.4.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent0-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: Python SDK for agent portability, discovery and trust based on ERC-8004
|
|
5
5
|
Author-email: Agent0 Team <team@ag0.xyz>
|
|
6
6
|
License: MIT License
|
|
@@ -158,20 +158,23 @@ agent.setTrust(reputation=True, cryptoEconomic=True)
|
|
|
158
158
|
agent.setMetadata({"version": "1.0.0", "category": "ai-assistant"})
|
|
159
159
|
agent.setActive(True)
|
|
160
160
|
|
|
161
|
-
# Register on-chain with IPFS
|
|
162
|
-
agent.registerIPFS()
|
|
163
|
-
|
|
164
|
-
print(f"Agent
|
|
161
|
+
# Register on-chain with IPFS (submitted-by-default)
|
|
162
|
+
reg_tx = agent.registerIPFS()
|
|
163
|
+
reg = reg_tx.wait_confirmed(timeout=180).result
|
|
164
|
+
print(f"Agent registered: {reg.agentId}") # e.g., "11155111:123"
|
|
165
|
+
print(f"Agent URI: {reg.agentURI}") # e.g., "ipfs://Qm..."
|
|
165
166
|
|
|
166
167
|
# (Optional) Change the agent wallet after registration
|
|
167
168
|
# - On mint/registration, `agentWallet` defaults to the current owner address.
|
|
168
169
|
# - Call this only if you want a DIFFERENT wallet (or after a transfer, since the wallet resets to zero).
|
|
169
170
|
# - Transaction is sent by the SDK signer (agent owner), but the signature must be produced by the NEW wallet.
|
|
170
|
-
agent.
|
|
171
|
+
wallet_tx = agent.setWallet(
|
|
171
172
|
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
|
|
172
173
|
chainId=11155111,
|
|
173
174
|
new_wallet_signer=os.getenv("NEW_WALLET_PRIVATE_KEY"),
|
|
174
175
|
)
|
|
176
|
+
if wallet_tx:
|
|
177
|
+
wallet_tx.wait_confirmed(timeout=180)
|
|
175
178
|
```
|
|
176
179
|
|
|
177
180
|
### 3. Load and Edit Agent
|
|
@@ -185,8 +188,9 @@ agent.updateInfo(description="Updated description with new capabilities")
|
|
|
185
188
|
agent.setMCP("https://new-mcp.example.com/")
|
|
186
189
|
|
|
187
190
|
# Re-register to update on-chain
|
|
188
|
-
agent.registerIPFS()
|
|
189
|
-
|
|
191
|
+
update_tx = agent.registerIPFS()
|
|
192
|
+
update = update_tx.wait_confirmed(timeout=180).result
|
|
193
|
+
print(f"Updated: {update.agentURI}")
|
|
190
194
|
```
|
|
191
195
|
|
|
192
196
|
### 4. Search Agents
|
|
@@ -214,13 +218,14 @@ agent_summary = sdk.getAgent("11155111:123")
|
|
|
214
218
|
|
|
215
219
|
```python
|
|
216
220
|
# On-chain-only feedback (no off-chain upload, even if IPFS is configured)
|
|
217
|
-
|
|
221
|
+
tx = sdk.giveFeedback(
|
|
218
222
|
agentId="11155111:123",
|
|
219
223
|
value=85, # number|string
|
|
220
224
|
tag1="data_analyst", # Optional: tags are strings
|
|
221
225
|
tag2="finance",
|
|
222
226
|
endpoint="https://example.com/endpoint", # Optional: saved on-chain
|
|
223
227
|
)
|
|
228
|
+
feedback = tx.wait_confirmed(timeout=180).result
|
|
224
229
|
|
|
225
230
|
# Rich feedback (optional off-chain file + on-chain fields)
|
|
226
231
|
feedback_file = sdk.prepareFeedbackFile({
|
|
@@ -230,7 +235,7 @@ feedback_file = sdk.prepareFeedbackFile({
|
|
|
230
235
|
"text": "Great agent!", # Optional
|
|
231
236
|
})
|
|
232
237
|
|
|
233
|
-
|
|
238
|
+
tx = sdk.giveFeedback(
|
|
234
239
|
agentId="11155111:123",
|
|
235
240
|
value=85,
|
|
236
241
|
tag1="data_analyst",
|
|
@@ -238,6 +243,7 @@ feedback = sdk.giveFeedback(
|
|
|
238
243
|
endpoint="https://example.com/endpoint",
|
|
239
244
|
feedbackFile=feedback_file, # If provided, requires IPFS configured
|
|
240
245
|
)
|
|
246
|
+
feedback = tx.wait_confirmed(timeout=180).result
|
|
241
247
|
|
|
242
248
|
# Search feedback
|
|
243
249
|
results = sdk.searchFeedback(
|
|
@@ -247,6 +253,16 @@ results = sdk.searchFeedback(
|
|
|
247
253
|
maxValue=100
|
|
248
254
|
)
|
|
249
255
|
|
|
256
|
+
# NEW: Search feedback given by a reviewer wallet (across all agents; subgraph required)
|
|
257
|
+
given = sdk.searchFeedback(
|
|
258
|
+
reviewers=["0x742d35cc6634c0532925a3b844bc9e7595f0beb7"]
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
# NEW: Search feedback across multiple agents at once
|
|
262
|
+
multi = sdk.searchFeedback(
|
|
263
|
+
agents=["11155111:123", "11155111:456", "11155111:789"]
|
|
264
|
+
)
|
|
265
|
+
|
|
250
266
|
# Get reputation summary
|
|
251
267
|
summary = sdk.getReputationSummary("11155111:123")
|
|
252
268
|
print(f"Average value: {summary['averageValue']}")
|
|
@@ -88,20 +88,23 @@ agent.setTrust(reputation=True, cryptoEconomic=True)
|
|
|
88
88
|
agent.setMetadata({"version": "1.0.0", "category": "ai-assistant"})
|
|
89
89
|
agent.setActive(True)
|
|
90
90
|
|
|
91
|
-
# Register on-chain with IPFS
|
|
92
|
-
agent.registerIPFS()
|
|
93
|
-
|
|
94
|
-
print(f"Agent
|
|
91
|
+
# Register on-chain with IPFS (submitted-by-default)
|
|
92
|
+
reg_tx = agent.registerIPFS()
|
|
93
|
+
reg = reg_tx.wait_confirmed(timeout=180).result
|
|
94
|
+
print(f"Agent registered: {reg.agentId}") # e.g., "11155111:123"
|
|
95
|
+
print(f"Agent URI: {reg.agentURI}") # e.g., "ipfs://Qm..."
|
|
95
96
|
|
|
96
97
|
# (Optional) Change the agent wallet after registration
|
|
97
98
|
# - On mint/registration, `agentWallet` defaults to the current owner address.
|
|
98
99
|
# - Call this only if you want a DIFFERENT wallet (or after a transfer, since the wallet resets to zero).
|
|
99
100
|
# - Transaction is sent by the SDK signer (agent owner), but the signature must be produced by the NEW wallet.
|
|
100
|
-
agent.
|
|
101
|
+
wallet_tx = agent.setWallet(
|
|
101
102
|
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
|
|
102
103
|
chainId=11155111,
|
|
103
104
|
new_wallet_signer=os.getenv("NEW_WALLET_PRIVATE_KEY"),
|
|
104
105
|
)
|
|
106
|
+
if wallet_tx:
|
|
107
|
+
wallet_tx.wait_confirmed(timeout=180)
|
|
105
108
|
```
|
|
106
109
|
|
|
107
110
|
### 3. Load and Edit Agent
|
|
@@ -115,8 +118,9 @@ agent.updateInfo(description="Updated description with new capabilities")
|
|
|
115
118
|
agent.setMCP("https://new-mcp.example.com/")
|
|
116
119
|
|
|
117
120
|
# Re-register to update on-chain
|
|
118
|
-
agent.registerIPFS()
|
|
119
|
-
|
|
121
|
+
update_tx = agent.registerIPFS()
|
|
122
|
+
update = update_tx.wait_confirmed(timeout=180).result
|
|
123
|
+
print(f"Updated: {update.agentURI}")
|
|
120
124
|
```
|
|
121
125
|
|
|
122
126
|
### 4. Search Agents
|
|
@@ -144,13 +148,14 @@ agent_summary = sdk.getAgent("11155111:123")
|
|
|
144
148
|
|
|
145
149
|
```python
|
|
146
150
|
# On-chain-only feedback (no off-chain upload, even if IPFS is configured)
|
|
147
|
-
|
|
151
|
+
tx = sdk.giveFeedback(
|
|
148
152
|
agentId="11155111:123",
|
|
149
153
|
value=85, # number|string
|
|
150
154
|
tag1="data_analyst", # Optional: tags are strings
|
|
151
155
|
tag2="finance",
|
|
152
156
|
endpoint="https://example.com/endpoint", # Optional: saved on-chain
|
|
153
157
|
)
|
|
158
|
+
feedback = tx.wait_confirmed(timeout=180).result
|
|
154
159
|
|
|
155
160
|
# Rich feedback (optional off-chain file + on-chain fields)
|
|
156
161
|
feedback_file = sdk.prepareFeedbackFile({
|
|
@@ -160,7 +165,7 @@ feedback_file = sdk.prepareFeedbackFile({
|
|
|
160
165
|
"text": "Great agent!", # Optional
|
|
161
166
|
})
|
|
162
167
|
|
|
163
|
-
|
|
168
|
+
tx = sdk.giveFeedback(
|
|
164
169
|
agentId="11155111:123",
|
|
165
170
|
value=85,
|
|
166
171
|
tag1="data_analyst",
|
|
@@ -168,6 +173,7 @@ feedback = sdk.giveFeedback(
|
|
|
168
173
|
endpoint="https://example.com/endpoint",
|
|
169
174
|
feedbackFile=feedback_file, # If provided, requires IPFS configured
|
|
170
175
|
)
|
|
176
|
+
feedback = tx.wait_confirmed(timeout=180).result
|
|
171
177
|
|
|
172
178
|
# Search feedback
|
|
173
179
|
results = sdk.searchFeedback(
|
|
@@ -177,6 +183,16 @@ results = sdk.searchFeedback(
|
|
|
177
183
|
maxValue=100
|
|
178
184
|
)
|
|
179
185
|
|
|
186
|
+
# NEW: Search feedback given by a reviewer wallet (across all agents; subgraph required)
|
|
187
|
+
given = sdk.searchFeedback(
|
|
188
|
+
reviewers=["0x742d35cc6634c0532925a3b844bc9e7595f0beb7"]
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# NEW: Search feedback across multiple agents at once
|
|
192
|
+
multi = sdk.searchFeedback(
|
|
193
|
+
agents=["11155111:123", "11155111:456", "11155111:789"]
|
|
194
|
+
)
|
|
195
|
+
|
|
180
196
|
# Get reputation summary
|
|
181
197
|
summary = sdk.getReputationSummary("11155111:123")
|
|
182
198
|
print(f"Average value: {summary['averageValue']}")
|
|
@@ -24,16 +24,21 @@ from .core.models import (
|
|
|
24
24
|
try:
|
|
25
25
|
from .core.sdk import SDK
|
|
26
26
|
from .core.agent import Agent
|
|
27
|
+
from .core.transaction_handle import TransactionHandle, TransactionMined
|
|
27
28
|
_sdk_available = True
|
|
28
29
|
except ImportError:
|
|
29
30
|
SDK = None
|
|
30
31
|
Agent = None
|
|
32
|
+
TransactionHandle = None
|
|
33
|
+
TransactionMined = None
|
|
31
34
|
_sdk_available = False
|
|
32
35
|
|
|
33
|
-
__version__ = "1.
|
|
36
|
+
__version__ = "1.4.1"
|
|
34
37
|
__all__ = [
|
|
35
38
|
"SDK",
|
|
36
39
|
"Agent",
|
|
40
|
+
"TransactionHandle",
|
|
41
|
+
"TransactionMined",
|
|
37
42
|
"AgentId",
|
|
38
43
|
"ChainId",
|
|
39
44
|
"Address",
|