agent0-sdk 0.31__py3-none-any.whl

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.
@@ -0,0 +1,367 @@
1
+ Metadata-Version: 2.4
2
+ Name: agent0-sdk
3
+ Version: 0.31
4
+ Summary: Python SDK for agent portability, discovery and trust based on ERC-8004
5
+ Author-email: Marco De Rossi <marco.derossi@consensys.net>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Marco De Rossi
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+
29
+ Project-URL: Homepage, https://sdk.ag0.xyz
30
+ Project-URL: Repository, https://github.com/agent0lab/agent0-py
31
+ Project-URL: Documentation, https://sdk.ag0.xyz
32
+ Project-URL: Source Code, https://github.com/agent0lab/agent0-py
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.8
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Requires-Python: >=3.8
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: web3>=6.0.0
46
+ Requires-Dist: eth-account>=0.8.0
47
+ Requires-Dist: requests>=2.28.0
48
+ Requires-Dist: pydantic>=2.0.0
49
+ Requires-Dist: ipfshttpclient>=0.8.0a2
50
+ Requires-Dist: aiohttp>=3.8.0
51
+ Requires-Dist: asyncio-throttle>=1.0.0
52
+ Requires-Dist: python-dotenv>=1.0.0
53
+ Requires-Dist: typing-extensions>=4.0.0
54
+ Provides-Extra: indexer
55
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "indexer"
56
+ Provides-Extra: dev
57
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
58
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
59
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
60
+ Requires-Dist: black>=22.0.0; extra == "dev"
61
+ Requires-Dist: isort>=5.10.0; extra == "dev"
62
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
63
+ Requires-Dist: flake8>=5.0.0; extra == "dev"
64
+ Provides-Extra: test
65
+ Requires-Dist: pytest>=7.0.0; extra == "test"
66
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
67
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
68
+ Requires-Dist: pytest-mock>=3.10.0; extra == "test"
69
+ Dynamic: license-file
70
+
71
+ # Agent0 SDK
72
+
73
+ Python SDK for agent portability, discovery and trust based on ERC-8004.
74
+
75
+ Agent0 is the SDK for agentic economies. It enables agents to register, advertise their capabilities and how to communicate with them, and give each other feedback and reputation signals. All this using blockchain infrastructure (ERC-8004) and decentralized storage, enabling permissionless discovery without relying on proprietary catalogues or intermediaries.
76
+
77
+ ## What Does Agent0 SDK Do?
78
+
79
+ Agent0 SDK v0.31 enables you to:
80
+
81
+ - **Create and manage agent identities** - Register your AI agent on-chain with a unique identity, configure presentation fields (name, description, image), set wallet addresses, and manage trust models with x402 support
82
+ - **Advertise agent capabilities** - Publish MCP and A2A endpoints, with automated extraction of MCP tools and A2A skills from endpoints
83
+ - **OASF taxonomies** - Advertise standardized skills and domains using the Open Agentic Schema Framework (OASF) taxonomies for better discovery and interoperability
84
+ - **Enable permissionless discovery** - Make your agent discoverable by other agents and platforms using rich search by attributes, capabilities, skills, tools, tasks, and x402 support
85
+ - **Build reputation** - Give and receive feedback, retrieve feedback history, and search agents by reputation with cryptographic authentication
86
+ - **Cross-chain registration** - One-line registration with IPFS nodes, Pinata, Filecoin, or HTTP URIs
87
+ - **Public indexing** - Subgraph indexing both on-chain and IPFS data for fast search and retrieval
88
+
89
+ ## ⚠️ Alpha Release
90
+
91
+ Agent0 SDK v0.31 is in **alpha** with bugs and is not production ready. We're actively testing and improving it.
92
+
93
+ **Bug reports & feedback:** GitHub: [Report issues](https://github.com/agent0lab/agent0-py/issues) | Telegram: [@marcoderossi](https://t.me/marcoderossi) | Email: marco.derossi@consensys.net
94
+
95
+ ## Installation
96
+
97
+ ### Prerequisites
98
+
99
+ - Python 3.8 or higher
100
+ - pip package manager
101
+ - Private key for signing transactions (or run in read-only mode)
102
+ - Access to an Ethereum RPC endpoint (e.g., Alchemy, Infura)
103
+ - (Optional) IPFS provider account (Pinata, Filecoin, or local IPFS node)
104
+
105
+ ### Install from PyPI
106
+
107
+ ```bash
108
+ pip install agent0-sdk
109
+ ```
110
+
111
+ ### Install from Source
112
+
113
+ ```bash
114
+ git clone https://github.com/agent0lab/agent0-py.git
115
+ cd agent0-py
116
+ pip install -e .
117
+ ```
118
+
119
+ ## Quick Start
120
+
121
+ ### 1. Initialize SDK
122
+
123
+ ```python
124
+ from agent0_sdk import SDK
125
+ import os
126
+
127
+ # Initialize SDK with IPFS and subgraph
128
+ sdk = SDK(
129
+ chainId=11155111, # Ethereum Sepolia testnet
130
+ rpcUrl=os.getenv("RPC_URL"),
131
+ signer=os.getenv("PRIVATE_KEY"),
132
+ ipfs="pinata", # Options: "pinata", "filecoinPin", "node"
133
+ pinataJwt=os.getenv("PINATA_JWT") # For Pinata
134
+ # Subgraph URL auto-defaults from DEFAULT_SUBGRAPH_URLS
135
+ )
136
+ ```
137
+
138
+ ### 2. Create and Register Agent
139
+
140
+ ```python
141
+ # Create agent
142
+ agent = sdk.createAgent(
143
+ name="My AI Agent",
144
+ description="An intelligent assistant for various tasks. Skills: data analysis, code generation.",
145
+ image="https://example.com/agent-image.png"
146
+ )
147
+
148
+ # Configure endpoints (automatically extracts capabilities)
149
+ agent.setMCP("https://mcp.example.com/") # Extracts tools, prompts, resources
150
+ agent.setA2A("https://a2a.example.com/agent-card.json") # Extracts skills
151
+ agent.setENS("myagent.eth")
152
+
153
+ # Add OASF skills and domains (standardized taxonomies)
154
+ agent.addSkill("data_engineering/data_transformation_pipeline", validate_oasf=True)
155
+ agent.addSkill("natural_language_processing/summarization", validate_oasf=True)
156
+ agent.addDomain("finance_and_business/investment_services", validate_oasf=True)
157
+ agent.addDomain("technology/data_science", validate_oasf=True)
158
+
159
+ # Configure wallet and trust
160
+ agent.setAgentWallet("0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", chainId=11155111)
161
+ agent.setTrust(reputation=True, cryptoEconomic=True)
162
+
163
+ # Add metadata and set status
164
+ agent.setMetadata({"version": "1.0.0", "category": "ai-assistant"})
165
+ agent.setActive(True)
166
+
167
+ # Register on-chain with IPFS
168
+ agent.registerIPFS()
169
+ print(f"Agent registered: {agent.agentId}") # e.g., "11155111:123"
170
+ print(f"Agent URI: {agent.agentURI}") # e.g., "ipfs://Qm..."
171
+ ```
172
+
173
+ ### 3. Load and Edit Agent
174
+
175
+ ```python
176
+ # Load existing agent for editing
177
+ agent = sdk.loadAgent("11155111:123") # Format: "chainId:agentId"
178
+
179
+ # Edit agent properties
180
+ agent.updateInfo(description="Updated description with new capabilities")
181
+ agent.setMCP("https://new-mcp.example.com/")
182
+
183
+ # Re-register to update on-chain
184
+ agent.registerIPFS()
185
+ print(f"Updated: {agent.agentURI}")
186
+ ```
187
+
188
+ ### 4. Search Agents
189
+
190
+ ```python
191
+ # Search by name, capabilities, or attributes
192
+ results = sdk.searchAgents(
193
+ name="AI", # Substring search
194
+ mcpTools=["code_generation"], # Specific MCP tools
195
+ a2aSkills=["python"], # Specific A2A skills
196
+ active=True, # Only active agents
197
+ x402support=True # Payment support
198
+ )
199
+
200
+ for agent in results['items']:
201
+ print(f"{agent.name}: {agent.description}")
202
+ print(f" Tools: {agent.mcpTools}")
203
+ print(f" Skills: {agent.a2aSkills}")
204
+
205
+ # Get single agent (read-only, faster)
206
+ agent_summary = sdk.getAgent("11155111:123")
207
+ ```
208
+
209
+ ### 5. Give and Retrieve Feedback
210
+
211
+ ```python
212
+ # Prepare feedback (only score is mandatory)
213
+ feedback_file = sdk.prepareFeedback(
214
+ agentId="11155111:123",
215
+ score=85, # 0-100 (mandatory)
216
+ tags=["data_analyst", "finance"], # Optional
217
+ capability="tools", # Optional: MCP capability
218
+ name="code_generation", # Optional: MCP tool name
219
+ skill="python" # Optional: A2A skill
220
+ )
221
+
222
+ # Give feedback
223
+ feedback = sdk.giveFeedback(agentId="11155111:123", feedbackFile=feedback_file)
224
+
225
+ # Search feedback
226
+ results = sdk.searchFeedback(
227
+ agentId="11155111:123",
228
+ capabilities=["tools"],
229
+ minScore=80,
230
+ maxScore=100
231
+ )
232
+
233
+ # Get reputation summary
234
+ summary = sdk.getReputationSummary("11155111:123")
235
+ print(f"Average score: {summary['averageScore']}")
236
+ ```
237
+
238
+ ## IPFS Configuration Options
239
+
240
+ ```python
241
+ # Option 1: Filecoin Pin (free for ERC-8004 agents)
242
+ sdk = SDK(
243
+ chainId=11155111,
244
+ rpcUrl="...",
245
+ signer=private_key,
246
+ ipfs="filecoinPin",
247
+ filecoinPrivateKey="your-filecoin-private-key"
248
+ )
249
+
250
+ # Option 2: IPFS Node
251
+ sdk = SDK(
252
+ chainId=11155111,
253
+ rpcUrl="...",
254
+ signer=private_key,
255
+ ipfs="node",
256
+ ipfsNodeUrl="https://ipfs.infura.io:5001"
257
+ )
258
+
259
+ # Option 3: Pinata (free for ERC-8004 agents)
260
+ sdk = SDK(
261
+ chainId=11155111,
262
+ rpcUrl="...",
263
+ signer=private_key,
264
+ ipfs="pinata",
265
+ pinataJwt="your-pinata-jwt-token"
266
+ )
267
+
268
+ # Option 4: HTTP registration (no IPFS)
269
+ sdk = SDK(chainId=11155111, rpcUrl="...", signer=private_key)
270
+ agent.register("https://example.com/agent-registration.json")
271
+ ```
272
+
273
+ ## OASF Taxonomies
274
+
275
+ The SDK includes support for the **Open Agentic Schema Framework (OASF)** taxonomies, enabling agents to advertise standardized skills and domains. This improves discoverability and interoperability across agent platforms.
276
+
277
+ ### Adding Skills and Domains
278
+
279
+ ```python
280
+ # Add OASF skills (with optional validation)
281
+ agent.addSkill("advanced_reasoning_planning/strategic_planning", validate_oasf=True)
282
+ agent.addSkill("data_engineering/data_transformation_pipeline", validate_oasf=True)
283
+
284
+ # Add OASF domains (with optional validation)
285
+ agent.addDomain("finance_and_business/investment_services", validate_oasf=True)
286
+ agent.addDomain("technology/data_science/data_visualization", validate_oasf=True)
287
+
288
+ # Remove skills/domains
289
+ agent.removeSkill("old_skill")
290
+ agent.removeDomain("old_domain")
291
+ ```
292
+
293
+ ### OASF in Registration Files
294
+
295
+ OASF skills and domains appear in your agent's registration file:
296
+
297
+ ```json
298
+ {
299
+ "endpoints": [
300
+ {
301
+ "name": "OASF",
302
+ "endpoint": "https://github.com/agntcy/oasf/",
303
+ "version": "v0.8.0",
304
+ "skills": [
305
+ "advanced_reasoning_planning/strategic_planning",
306
+ "data_engineering/data_transformation_pipeline"
307
+ ],
308
+ "domains": [
309
+ "finance_and_business/investment_services",
310
+ "technology/data_science"
311
+ ]
312
+ }
313
+ ]
314
+ }
315
+ ```
316
+
317
+ ### Taxonomy Files
318
+
319
+ The SDK includes complete OASF v0.8.0 taxonomy files:
320
+ - **Skills**: `agent0_sdk/taxonomies/all_skills.json` (136 skills)
321
+ - **Domains**: `agent0_sdk/taxonomies/all_domains.json` (204 domains)
322
+
323
+ Browse these files to find appropriate skill and domain slugs. For more information, see the [OASF specification](https://github.com/agntcy/oasf) and [Release Notes v0.31](RELEASE_NOTES_0.31.md).
324
+
325
+ ## Use Cases
326
+
327
+ - **Building agent marketplaces** - Create platforms where developers can discover, evaluate, and integrate agents based on their capabilities and reputation
328
+ - **Agent interoperability** - Discover agents by specific capabilities (skills, tools, tasks), evaluate them through reputation signals, and integrate them via standard protocols (MCP/A2A)
329
+ - **Managing agent reputation** - Track agent performance, collect feedback from users and other agents, and build trust signals for your agent ecosystem
330
+ - **Cross-chain agent operations** - Deploy and manage agents across multiple blockchain networks with consistent identity and reputation
331
+
332
+ ## 🚀 Coming Soon
333
+
334
+ - More chains (currently Ethereum Sepolia only)
335
+ - Support for validations
336
+ - Enhanced x402 payments
337
+ - Semantic/Vectorial search
338
+ - Advanced reputation aggregation
339
+ - Import/Export to centralized catalogues
340
+
341
+ ## Tests
342
+
343
+ Complete working examples are available in the `tests/` directory:
344
+
345
+ - `test_registration.py` - Agent registration with HTTP URI
346
+ - `test_registrationIpfs.py` - Agent registration with IPFS
347
+ - `test_feedback.py` - Complete feedback flow with IPFS storage
348
+ - `test_search.py` - Agent search and discovery
349
+ - `test_transfer.py` - Agent ownership transfer
350
+
351
+ ## Documentation
352
+
353
+ Full documentation is available at [sdk.ag0.xyz](https://sdk.ag0.xyz), including:
354
+
355
+ - [Installation Guide](https://sdk.ag0.xyz/2-usage/2-1-install/)
356
+ - [Agent Configuration](https://sdk.ag0.xyz/2-usage/2-2-configure-agents/)
357
+ - [Registration](https://sdk.ag0.xyz/2-usage/2-3-registration-ipfs/)
358
+ - [Search](https://sdk.ag0.xyz/2-usage/2-5-search/)
359
+ - [Feedback](https://sdk.ag0.xyz/2-usage/2-6-use-feedback/)
360
+ - [Key Concepts](https://sdk.ag0.xyz/1-welcome/1-2-key-concepts/)
361
+ - [API Reference](https://sdk.ag0.xyz/5-reference/5-1-sdk/)
362
+
363
+ ## License
364
+
365
+ Agent0 SDK is MIT-licensed public good brought to you by Marco De Rossi in collaboration with Consensys, 🦊 MetaMask and Agent0, Inc. We are looking for co-maintainers. Please reach out if you want to help.
366
+
367
+ Thanks also to Edge & Node (The Graph), Protocol Labs and Pinata for their support.
@@ -0,0 +1,33 @@
1
+ agent0_sdk/__init__.py,sha256=b1gWy_m93dJucBqmwz9zx2M3zs8JTO-S0CN1B0xBHcQ,918
2
+ agent0_sdk/core/agent.py,sha256=vqgQRQVrCBV0zAGkZeYHeYvWlRAG9-m0Wy61DxvEiD4,38001
3
+ agent0_sdk/core/contracts.py,sha256=LJY07PIyAb3ZSH_m2xD4OdXawsXKxaTUGhYHwGWUpmI,20435
4
+ agent0_sdk/core/endpoint_crawler.py,sha256=QBkFc3tBSQqHj6PtSTZ5D3_HVB00KJZJdxE3uYpI9po,13611
5
+ agent0_sdk/core/feedback_manager.py,sha256=MV3srP-rgFaDXXELeLTJBj2aDUPdENy0tzWUsJUqrL4,39860
6
+ agent0_sdk/core/indexer.py,sha256=erkDKrtyvAtfrblz0YHekPB2Hpw7tJm-1KJjafTMaHc,68470
7
+ agent0_sdk/core/ipfs_client.py,sha256=fml1ai1BdBkgb95xAkf-ft8QsahV1HL30hBYRz7rQwI,13929
8
+ agent0_sdk/core/models.py,sha256=SnHmy9nmKHnD5hMIv-r8Ztj1zfXF_1qxHwfnBFAjkAA,12505
9
+ agent0_sdk/core/oasf_validator.py,sha256=X_V6mZsrp9z2So2fAJ66fm5EypiVEl4Fxtg10Ot3cgQ,2952
10
+ agent0_sdk/core/sdk.py,sha256=CQUpKaP7g1Lu7aokRYs-QChv78XIdkfz6Yax6nhaWqQ,40166
11
+ agent0_sdk/core/subgraph_client.py,sha256=Iw-YEtT1-Rm9f-kY4EXZlCuwEkJQAq5-bHDpxrMVyGg,28419
12
+ agent0_sdk/core/web3_client.py,sha256=859ntu5dAmNlcJ3YM1w_VV2gI3mpCC9QEr-GN1236zU,6850
13
+ agent0_sdk/taxonomies/all_domains.json,sha256=buM8_6mpY8_AMbBIPzM-gtu14Tl30QDmhuQxxrlJU4c,74625
14
+ agent0_sdk/taxonomies/all_skills.json,sha256=WVsutw3fqoj1jfDPru3CyWTr1kc1a5-EhBOWPfXnEi8,47483
15
+ agent0_sdk-0.31.dist-info/licenses/LICENSE,sha256=rhZZbZm_Ovz4Oa9LNQ-ms8a1tA36wWh90ZkC0OR7WMw,1072
16
+ tests/__init__.py,sha256=60ffheccPhuMCtwiiKP1X-CJJXKpxJ_Ywa0aXGHR9bY,23
17
+ tests/config.py,sha256=1uePvkLBNubOQsvYkQSno0m007PMD1VACgm33fCYY6s,1429
18
+ tests/conftest.py,sha256=P-HCtVVYwSvscuaJqhrgZcv39XXNnr932ekEamzIqis,589
19
+ tests/discover_test_data.py,sha256=Fu0uQKnFk8m7qEqEp293BWbo_mT1CK5szVZcdcdlJQw,17678
20
+ tests/test_feedback.py,sha256=7lszWYSmseJE0I4BhKzZdBiIzf2bgpPqZTZvhRrCTjY,14638
21
+ tests/test_models.py,sha256=kCZdoPasIIcOjEw7ToPldqARdbGVK8v8byOhFwVo7OI,7115
22
+ tests/test_multi_chain.py,sha256=6C-HD037Lsjd7_H0pwp7NDU04jLTjhardT1LHBjahFM,26711
23
+ tests/test_oasf_management.py,sha256=SIC_YgnuapNXAstjm9y8gky3cLG1FCcujZ-y5dlHxYo,17738
24
+ tests/test_real_public_servers.py,sha256=pCo4aLSCG9qv4D6T7jbyVmP1gt3r1jWxdes6z5XSNhU,3433
25
+ tests/test_registration.py,sha256=pYanDPLAFETIfabBUvO34ZDmyD0Rbcv8vecSfgSrQ70,9542
26
+ tests/test_registrationIpfs.py,sha256=9O3IBiN2CVMKzB19bqb-jN-nhqsN22kQINMpe9THqiI,8400
27
+ tests/test_sdk.py,sha256=dALLFm_A6aXx0ec-CNOLGQoadaSPZ08EEeCS6Tgnm0M,9362
28
+ tests/test_search.py,sha256=SiUio8H-M6Za8OXD_h9tUZdln0ayzkPJ3doTrkHv-Fs,18382
29
+ tests/test_transfer.py,sha256=zRBllpoMs6NhagAmaZWmD4ckbYjSvsSUerBK4oS-HlA,9258
30
+ agent0_sdk-0.31.dist-info/METADATA,sha256=xsGC93w2qox04MG419dufzAAQO-l5W9TpNXMHomzbwA,13623
31
+ agent0_sdk-0.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ agent0_sdk-0.31.dist-info/top_level.txt,sha256=rgGBfOJlLi1zInQ85jBL2MpDu_ZJNbPjIGz-3Vn5rZs,17
33
+ agent0_sdk-0.31.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Marco De Rossi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,2 @@
1
+ agent0_sdk
2
+ tests
tests/__init__.py ADDED
@@ -0,0 +1 @@
1
+ # Tests for Agent0 SDK
tests/config.py ADDED
@@ -0,0 +1,46 @@
1
+ """
2
+ Shared configuration loader for test examples.
3
+ Loads configuration from environment variables (.env file).
4
+ """
5
+
6
+ import os
7
+ from pathlib import Path
8
+ from dotenv import load_dotenv
9
+
10
+ # Load environment variables from .env file
11
+ # Look for .env in parent directory (project root)
12
+ env_path = Path(__file__).parent.parent.parent / ".env"
13
+ load_dotenv(dotenv_path=env_path)
14
+
15
+ # Chain Configuration
16
+ CHAIN_ID = int(os.getenv("CHAIN_ID", "11155111"))
17
+ RPC_URL = os.getenv(
18
+ "RPC_URL",
19
+ "https://eth-sepolia.g.alchemy.com/v2/7nkA4bJ0tKWcl2-5Wn15c5eRdpGZ8DDr"
20
+ )
21
+ AGENT_PRIVATE_KEY = os.getenv("AGENT_PRIVATE_KEY", "")
22
+
23
+ # IPFS Configuration (Pinata)
24
+ PINATA_JWT = os.getenv("PINATA_JWT", "")
25
+
26
+ # Subgraph Configuration
27
+ SUBGRAPH_URL = os.getenv(
28
+ "SUBGRAPH_URL",
29
+ "https://gateway.thegraph.com/api/00a452ad3cd1900273ea62c1bf283f93/subgraphs/id/6wQRC7geo9XYAhckfmfo8kbMRLeWU8KQd3XsJqFKmZLT"
30
+ )
31
+
32
+ # Agent ID for testing (can be overridden via env)
33
+ AGENT_ID = os.getenv("AGENT_ID", "11155111:374")
34
+
35
+
36
+ def print_config():
37
+ """Print current configuration (hiding sensitive values)."""
38
+ print("Configuration:")
39
+ print(f" CHAIN_ID: {CHAIN_ID}")
40
+ print(f" RPC_URL: {RPC_URL[:50]}...")
41
+ print(f" AGENT_PRIVATE_KEY: {'***' if AGENT_PRIVATE_KEY else 'NOT SET'}")
42
+ print(f" PINATA_JWT: {'***' if PINATA_JWT else 'NOT SET'}")
43
+ print(f" SUBGRAPH_URL: {SUBGRAPH_URL[:50]}...")
44
+ print(f" AGENT_ID: {AGENT_ID}")
45
+ print()
46
+
tests/conftest.py ADDED
@@ -0,0 +1,22 @@
1
+ """
2
+ Pytest configuration file for Agent0 SDK tests.
3
+ Sets up logging to debug level for agent0_sdk only.
4
+ """
5
+
6
+ import logging
7
+ import sys
8
+
9
+ # Configure logging: root logger at WARNING to suppress noisy dependencies
10
+ logging.basicConfig(
11
+ level=logging.WARNING,
12
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
13
+ datefmt='%Y-%m-%d %H:%M:%S',
14
+ handlers=[
15
+ logging.StreamHandler(sys.stdout)
16
+ ]
17
+ )
18
+
19
+ # Set debug level ONLY for agent0_sdk loggers
20
+ logging.getLogger('agent0_sdk').setLevel(logging.DEBUG)
21
+ logging.getLogger('agent0_sdk.core').setLevel(logging.DEBUG)
22
+