agent0-sdk 1.0.1__tar.gz → 1.2.0__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 (26) hide show
  1. {agent0_sdk-1.0.1/agent0_sdk.egg-info → agent0_sdk-1.2.0}/PKG-INFO +29 -17
  2. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/README.md +27 -15
  3. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/__init__.py +1 -1
  4. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/agent.py +10 -9
  5. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/contracts.py +23 -8
  6. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/feedback_manager.py +181 -124
  7. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/indexer.py +16 -15
  8. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/ipfs_client.py +8 -6
  9. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/models.py +5 -3
  10. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/sdk.py +64 -147
  11. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/subgraph_client.py +22 -27
  12. agent0_sdk-1.2.0/agent0_sdk/core/value_encoding.py +91 -0
  13. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0/agent0_sdk.egg-info}/PKG-INFO +29 -17
  14. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk.egg-info/SOURCES.txt +1 -0
  15. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk.egg-info/top_level.txt +1 -0
  16. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/pyproject.toml +2 -2
  17. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/LICENSE +0 -0
  18. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/MANIFEST.in +0 -0
  19. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/endpoint_crawler.py +0 -0
  20. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/oasf_validator.py +0 -0
  21. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/core/web3_client.py +0 -0
  22. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/taxonomies/all_domains.json +0 -0
  23. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk/taxonomies/all_skills.json +0 -0
  24. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk.egg-info/dependency_links.txt +0 -0
  25. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/agent0_sdk.egg-info/requires.txt +0 -0
  26. {agent0_sdk-1.0.1 → agent0_sdk-1.2.0}/setup.cfg +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent0-sdk
3
- Version: 1.0.1
3
+ Version: 1.2.0
4
4
  Summary: Python SDK for agent portability, discovery and trust based on ERC-8004
5
- Author-email: Marco De Rossi <marco@ag0.xyz>
5
+ Author-email: Agent0 Team <team@ag0.xyz>
6
6
  License: MIT License
7
7
 
8
8
  Copyright (c) 2025 Marco De Rossi
@@ -86,7 +86,7 @@ Agent0 SDK enables you to:
86
86
  - **Cross-chain registration** - One-line registration with IPFS nodes, Pinata, Filecoin, or HTTP URIs
87
87
  - **Public indexing** - Subgraph indexing both on-chain and IPFS data for fast search and retrieval
88
88
 
89
- **Bug reports & feedback:** GitHub: [Report issues](https://github.com/agent0lab/agent0-py/issues) | Telegram: [@marcoderossi](https://t.me/marcoderossi) | Email: marco@ag0.xyz
89
+ **Bug reports & feedback:** GitHub: [Report issues](https://github.com/agent0lab/agent0-py/issues) | Telegram: [Agent0 channel](https://t.me/agent0kitchen) | Email: team@ag0.xyz
90
90
 
91
91
  ## Installation
92
92
 
@@ -213,31 +213,43 @@ agent_summary = sdk.getAgent("11155111:123")
213
213
  ### 5. Give and Retrieve Feedback
214
214
 
215
215
  ```python
216
- # Prepare feedback (only score is mandatory)
217
- feedback_file = sdk.prepareFeedback(
216
+ # On-chain-only feedback (no off-chain upload, even if IPFS is configured)
217
+ feedback = sdk.giveFeedback(
218
218
  agentId="11155111:123",
219
- score=85, # 0-100 (mandatory)
220
- tags=["data_analyst", "finance"], # Optional: tags are now strings (not bytes32)
221
- endpoint="https://example.com/endpoint", # Optional: endpoint URI associated with feedback
222
- capability="tools", # Optional: MCP capability
223
- name="code_generation", # Optional: MCP tool name
224
- skill="python" # Optional: A2A skill
219
+ value=85, # number|string
220
+ tag1="data_analyst", # Optional: tags are strings
221
+ tag2="finance",
222
+ endpoint="https://example.com/endpoint", # Optional: saved on-chain
225
223
  )
226
224
 
227
- # Give feedback
228
- feedback = sdk.giveFeedback(agentId="11155111:123", feedbackFile=feedback_file)
225
+ # Rich feedback (optional off-chain file + on-chain fields)
226
+ feedback_file = sdk.prepareFeedbackFile({
227
+ "capability": "tools", # Optional: MCP capability
228
+ "name": "code_generation", # Optional: MCP tool name
229
+ "skill": "python", # Optional: A2A skill
230
+ "text": "Great agent!", # Optional
231
+ })
232
+
233
+ feedback = sdk.giveFeedback(
234
+ agentId="11155111:123",
235
+ value=85,
236
+ tag1="data_analyst",
237
+ tag2="finance",
238
+ endpoint="https://example.com/endpoint",
239
+ feedbackFile=feedback_file, # If provided, requires IPFS configured
240
+ )
229
241
 
230
242
  # Search feedback
231
243
  results = sdk.searchFeedback(
232
244
  agentId="11155111:123",
233
245
  capabilities=["tools"],
234
- minScore=80,
235
- maxScore=100
246
+ minValue=80,
247
+ maxValue=100
236
248
  )
237
249
 
238
250
  # Get reputation summary
239
251
  summary = sdk.getReputationSummary("11155111:123")
240
- print(f"Average score: {summary['averageScore']}")
252
+ print(f"Average value: {summary['averageValue']}")
241
253
  ```
242
254
 
243
255
  ## IPFS Configuration Options
@@ -305,7 +317,7 @@ OASF skills and domains appear in your agent's registration file:
305
317
  {
306
318
  "name": "OASF",
307
319
  "endpoint": "https://github.com/agntcy/oasf/",
308
- "version": "v0.8.0",
320
+ "version": "0.8",
309
321
  "skills": [
310
322
  "advanced_reasoning_planning/strategic_planning",
311
323
  "data_engineering/data_transformation_pipeline"
@@ -16,7 +16,7 @@ Agent0 SDK enables you to:
16
16
  - **Cross-chain registration** - One-line registration with IPFS nodes, Pinata, Filecoin, or HTTP URIs
17
17
  - **Public indexing** - Subgraph indexing both on-chain and IPFS data for fast search and retrieval
18
18
 
19
- **Bug reports & feedback:** GitHub: [Report issues](https://github.com/agent0lab/agent0-py/issues) | Telegram: [@marcoderossi](https://t.me/marcoderossi) | Email: marco@ag0.xyz
19
+ **Bug reports & feedback:** GitHub: [Report issues](https://github.com/agent0lab/agent0-py/issues) | Telegram: [Agent0 channel](https://t.me/agent0kitchen) | Email: team@ag0.xyz
20
20
 
21
21
  ## Installation
22
22
 
@@ -143,31 +143,43 @@ agent_summary = sdk.getAgent("11155111:123")
143
143
  ### 5. Give and Retrieve Feedback
144
144
 
145
145
  ```python
146
- # Prepare feedback (only score is mandatory)
147
- feedback_file = sdk.prepareFeedback(
146
+ # On-chain-only feedback (no off-chain upload, even if IPFS is configured)
147
+ feedback = sdk.giveFeedback(
148
148
  agentId="11155111:123",
149
- score=85, # 0-100 (mandatory)
150
- tags=["data_analyst", "finance"], # Optional: tags are now strings (not bytes32)
151
- endpoint="https://example.com/endpoint", # Optional: endpoint URI associated with feedback
152
- capability="tools", # Optional: MCP capability
153
- name="code_generation", # Optional: MCP tool name
154
- skill="python" # Optional: A2A skill
149
+ value=85, # number|string
150
+ tag1="data_analyst", # Optional: tags are strings
151
+ tag2="finance",
152
+ endpoint="https://example.com/endpoint", # Optional: saved on-chain
155
153
  )
156
154
 
157
- # Give feedback
158
- feedback = sdk.giveFeedback(agentId="11155111:123", feedbackFile=feedback_file)
155
+ # Rich feedback (optional off-chain file + on-chain fields)
156
+ feedback_file = sdk.prepareFeedbackFile({
157
+ "capability": "tools", # Optional: MCP capability
158
+ "name": "code_generation", # Optional: MCP tool name
159
+ "skill": "python", # Optional: A2A skill
160
+ "text": "Great agent!", # Optional
161
+ })
162
+
163
+ feedback = sdk.giveFeedback(
164
+ agentId="11155111:123",
165
+ value=85,
166
+ tag1="data_analyst",
167
+ tag2="finance",
168
+ endpoint="https://example.com/endpoint",
169
+ feedbackFile=feedback_file, # If provided, requires IPFS configured
170
+ )
159
171
 
160
172
  # Search feedback
161
173
  results = sdk.searchFeedback(
162
174
  agentId="11155111:123",
163
175
  capabilities=["tools"],
164
- minScore=80,
165
- maxScore=100
176
+ minValue=80,
177
+ maxValue=100
166
178
  )
167
179
 
168
180
  # Get reputation summary
169
181
  summary = sdk.getReputationSummary("11155111:123")
170
- print(f"Average score: {summary['averageScore']}")
182
+ print(f"Average value: {summary['averageValue']}")
171
183
  ```
172
184
 
173
185
  ## IPFS Configuration Options
@@ -235,7 +247,7 @@ OASF skills and domains appear in your agent's registration file:
235
247
  {
236
248
  "name": "OASF",
237
249
  "endpoint": "https://github.com/agntcy/oasf/",
238
- "version": "v0.8.0",
250
+ "version": "0.8",
239
251
  "skills": [
240
252
  "advanced_reasoning_planning/strategic_planning",
241
253
  "data_engineering/data_transformation_pipeline"
@@ -30,7 +30,7 @@ except ImportError:
30
30
  Agent = None
31
31
  _sdk_available = False
32
32
 
33
- __version__ = "1.0.1"
33
+ __version__ = "1.2.0"
34
34
  __all__ = [
35
35
  "SDK",
36
36
  "Agent",
@@ -327,7 +327,8 @@ class Agent:
327
327
  oasf_endpoint = Endpoint(
328
328
  type=EndpointType.OASF,
329
329
  value="https://github.com/agntcy/oasf/",
330
- meta={"version": "v0.8.0", "skills": [], "domains": []}
330
+ # Version string follows ERC-8004 spec example ("0.8")
331
+ meta={"version": "0.8", "skills": [], "domains": []}
331
332
  )
332
333
  self.registration_file.endpoints.append(oasf_endpoint)
333
334
  return oasf_endpoint
@@ -529,14 +530,14 @@ class Agent:
529
530
  raise ValueError("Wallet address cannot be empty. Use a non-zero address.")
530
531
 
531
532
  # Validate address format
532
- if not addr.startswith("0x") or len(addr) != 42:
533
- raise ValueError(f"Invalid Ethereum address format: {addr}. Must be 42 characters starting with '0x'")
534
-
535
- # Validate hexadecimal characters
536
- try:
537
- int(addr[2:], 16)
538
- except ValueError:
539
- raise ValueError(f"Invalid hexadecimal characters in address: {addr}")
533
+ if not addr.startswith("0x") or len(addr) != 42:
534
+ raise ValueError(f"Invalid Ethereum address format: {addr}. Must be 42 characters starting with '0x'")
535
+
536
+ # Validate hexadecimal characters
537
+ try:
538
+ int(addr[2:], 16)
539
+ except ValueError:
540
+ raise ValueError(f"Invalid hexadecimal characters in address: {addr}")
540
541
 
541
542
  # Determine chain ID to use (local bookkeeping)
542
543
  if chainId is None:
@@ -159,7 +159,7 @@ IDENTITY_REGISTRY_ABI = [
159
159
  {"internalType": "uint256", "name": "agentId", "type": "uint256"}
160
160
  ],
161
161
  "name": "getAgentWallet",
162
- "outputs": [{"internalType": "address", "name": "", "type": "address"}],
162
+ "outputs": [{"internalType": "bytes", "name": "", "type": "bytes"}],
163
163
  "stateMutability": "view",
164
164
  "type": "function"
165
165
  },
@@ -175,6 +175,15 @@ IDENTITY_REGISTRY_ABI = [
175
175
  "stateMutability": "nonpayable",
176
176
  "type": "function"
177
177
  },
178
+ {
179
+ "inputs": [
180
+ {"internalType": "uint256", "name": "agentId", "type": "uint256"}
181
+ ],
182
+ "name": "unsetAgentWallet",
183
+ "outputs": [],
184
+ "stateMutability": "nonpayable",
185
+ "type": "function"
186
+ },
178
187
 
179
188
  # Events
180
189
  {
@@ -222,7 +231,8 @@ REPUTATION_REGISTRY_ABI = [
222
231
  {
223
232
  "inputs": [
224
233
  {"internalType": "uint256", "name": "agentId", "type": "uint256"},
225
- {"internalType": "uint8", "name": "score", "type": "uint8"},
234
+ {"internalType": "int256", "name": "value", "type": "int256"},
235
+ {"internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
226
236
  {"internalType": "string", "name": "tag1", "type": "string"},
227
237
  {"internalType": "string", "name": "tag2", "type": "string"},
228
238
  {"internalType": "string", "name": "endpoint", "type": "string"},
@@ -275,7 +285,8 @@ REPUTATION_REGISTRY_ABI = [
275
285
  ],
276
286
  "name": "readFeedback",
277
287
  "outputs": [
278
- {"internalType": "uint8", "name": "score", "type": "uint8"},
288
+ {"internalType": "int256", "name": "value", "type": "int256"},
289
+ {"internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
279
290
  {"internalType": "string", "name": "tag1", "type": "string"},
280
291
  {"internalType": "string", "name": "tag2", "type": "string"},
281
292
  {"internalType": "bool", "name": "isRevoked", "type": "bool"}
@@ -293,7 +304,8 @@ REPUTATION_REGISTRY_ABI = [
293
304
  "name": "getSummary",
294
305
  "outputs": [
295
306
  {"internalType": "uint64", "name": "count", "type": "uint64"},
296
- {"internalType": "uint8", "name": "averageScore", "type": "uint8"}
307
+ {"internalType": "int256", "name": "summaryValue", "type": "int256"},
308
+ {"internalType": "uint8", "name": "summaryValueDecimals", "type": "uint8"}
297
309
  ],
298
310
  "stateMutability": "view",
299
311
  "type": "function"
@@ -308,9 +320,10 @@ REPUTATION_REGISTRY_ABI = [
308
320
  ],
309
321
  "name": "readAllFeedback",
310
322
  "outputs": [
311
- {"internalType": "address[]", "name": "clientAddresses", "type": "address[]"},
323
+ {"internalType": "address[]", "name": "clients", "type": "address[]"},
312
324
  {"internalType": "uint64[]", "name": "feedbackIndexes", "type": "uint64[]"},
313
- {"internalType": "uint8[]", "name": "scores", "type": "uint8[]"},
325
+ {"internalType": "int256[]", "name": "values", "type": "int256[]"},
326
+ {"internalType": "uint8[]", "name": "valueDecimals", "type": "uint8[]"},
314
327
  {"internalType": "string[]", "name": "tag1s", "type": "string[]"},
315
328
  {"internalType": "string[]", "name": "tag2s", "type": "string[]"},
316
329
  {"internalType": "bool[]", "name": "revokedStatuses", "type": "bool[]"}
@@ -345,8 +358,10 @@ REPUTATION_REGISTRY_ABI = [
345
358
  {"indexed": True, "internalType": "uint256", "name": "agentId", "type": "uint256"},
346
359
  {"indexed": True, "internalType": "address", "name": "clientAddress", "type": "address"},
347
360
  {"indexed": False, "internalType": "uint64", "name": "feedbackIndex", "type": "uint64"},
348
- {"indexed": False, "internalType": "uint8", "name": "score", "type": "uint8"},
349
- {"indexed": True, "internalType": "string", "name": "tag1", "type": "string"},
361
+ {"indexed": False, "internalType": "int256", "name": "value", "type": "int256"},
362
+ {"indexed": False, "internalType": "uint8", "name": "valueDecimals", "type": "uint8"},
363
+ {"indexed": True, "internalType": "string", "name": "indexedTag1", "type": "string"},
364
+ {"indexed": False, "internalType": "string", "name": "tag1", "type": "string"},
350
365
  {"indexed": False, "internalType": "string", "name": "tag2", "type": "string"},
351
366
  {"indexed": False, "internalType": "string", "name": "endpoint", "type": "string"},
352
367
  {"indexed": False, "internalType": "string", "name": "feedbackURI", "type": "string"},