a2a-adapter 0.1.4__py3-none-any.whl → 0.1.5__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.
- a2a_adapter/__init__.py +1 -1
- a2a_adapter/client.py +57 -13
- a2a_adapter/integrations/__init__.py +5 -0
- a2a_adapter/integrations/openclaw.py +1297 -0
- a2a_adapter/loader.py +31 -1
- {a2a_adapter-0.1.4.dist-info → a2a_adapter-0.1.5.dist-info}/METADATA +39 -12
- a2a_adapter-0.1.5.dist-info/RECORD +16 -0
- {a2a_adapter-0.1.4.dist-info → a2a_adapter-0.1.5.dist-info}/WHEEL +1 -1
- a2a_adapter-0.1.4.dist-info/RECORD +0 -15
- {a2a_adapter-0.1.4.dist-info → a2a_adapter-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {a2a_adapter-0.1.4.dist-info → a2a_adapter-0.1.5.dist-info}/top_level.txt +0 -0
a2a_adapter/loader.py
CHANGED
|
@@ -30,6 +30,10 @@ async def load_a2a_agent(config: Dict[str, Any]) -> BaseAgentAdapter:
|
|
|
30
30
|
optional 'input_key', 'output_key', 'async_mode'
|
|
31
31
|
- callable: requires 'callable' (async function),
|
|
32
32
|
optional 'supports_streaming'
|
|
33
|
+
- openclaw: optional 'session_id', 'agent_id', 'thinking',
|
|
34
|
+
'timeout', 'openclaw_path', 'working_directory',
|
|
35
|
+
'env_vars', 'async_mode', 'task_store',
|
|
36
|
+
'task_ttl_seconds', 'cleanup_interval_seconds'
|
|
33
37
|
|
|
34
38
|
Returns:
|
|
35
39
|
Configured BaseAgentAdapter instance
|
|
@@ -86,6 +90,15 @@ async def load_a2a_agent(config: Dict[str, Any]) -> BaseAgentAdapter:
|
|
|
86
90
|
... "adapter": "callable",
|
|
87
91
|
... "callable": my_agent
|
|
88
92
|
... })
|
|
93
|
+
|
|
94
|
+
>>> # Load OpenClaw adapter
|
|
95
|
+
>>> adapter = await load_a2a_agent({
|
|
96
|
+
... "adapter": "openclaw",
|
|
97
|
+
... "session_id": "my-session",
|
|
98
|
+
... "agent_id": "main",
|
|
99
|
+
... "thinking": "low",
|
|
100
|
+
... "timeout": 300,
|
|
101
|
+
... })
|
|
89
102
|
"""
|
|
90
103
|
adapter_type = config.get("adapter")
|
|
91
104
|
|
|
@@ -167,8 +180,25 @@ async def load_a2a_agent(config: Dict[str, Any]) -> BaseAgentAdapter:
|
|
|
167
180
|
supports_streaming=config.get("supports_streaming", False),
|
|
168
181
|
)
|
|
169
182
|
|
|
183
|
+
elif adapter_type == "openclaw":
|
|
184
|
+
from .integrations.openclaw import OpenClawAgentAdapter
|
|
185
|
+
|
|
186
|
+
return OpenClawAgentAdapter(
|
|
187
|
+
session_id=config.get("session_id"),
|
|
188
|
+
agent_id=config.get("agent_id"),
|
|
189
|
+
thinking=config.get("thinking", "low"),
|
|
190
|
+
timeout=config.get("timeout", 600),
|
|
191
|
+
openclaw_path=config.get("openclaw_path", "openclaw"),
|
|
192
|
+
working_directory=config.get("working_directory"),
|
|
193
|
+
env_vars=config.get("env_vars"),
|
|
194
|
+
async_mode=config.get("async_mode", True),
|
|
195
|
+
task_store=config.get("task_store"),
|
|
196
|
+
task_ttl_seconds=config.get("task_ttl_seconds", 3600),
|
|
197
|
+
cleanup_interval_seconds=config.get("cleanup_interval_seconds", 300),
|
|
198
|
+
)
|
|
199
|
+
|
|
170
200
|
else:
|
|
171
201
|
raise ValueError(
|
|
172
202
|
f"Unknown adapter type: {adapter_type}. "
|
|
173
|
-
f"Supported types: n8n, crewai, langchain, langgraph, callable"
|
|
203
|
+
f"Supported types: n8n, crewai, langchain, langgraph, callable, openclaw"
|
|
174
204
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: a2a-adapter
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: A2A Protocol Adapter SDK for integrating various agent frameworks
|
|
5
5
|
Author-email: HYBRO AI <info@hybro.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -52,7 +52,7 @@ Dynamic: license-file
|
|
|
52
52
|
|
|
53
53
|
**🚀 Open Source A2A Protocol Adapter SDK - Make Any Agent Framework A2A-Compatible in 3 Lines**
|
|
54
54
|
|
|
55
|
-
A Python SDK that enables seamless integration of various agent frameworks (n8n, LangGraph, CrewAI, LangChain, etc.) with the [A2A (Agent-to-Agent) Protocol](https://github.com/a2aproject/A2A). Build interoperable AI agent systems that can communicate across different platforms and frameworks.
|
|
55
|
+
A Python SDK that enables seamless integration of various agent frameworks (n8n, LangGraph, CrewAI, LangChain, etc.) and personal AI agents (OpenClaw) with the [A2A (Agent-to-Agent) Protocol](https://github.com/a2aproject/A2A). Build interoperable AI agent systems that can communicate across different platforms and frameworks.
|
|
56
56
|
|
|
57
57
|
**✨ Key Benefits:**
|
|
58
58
|
|
|
@@ -67,7 +67,7 @@ A Python SDK that enables seamless integration of various agent frameworks (n8n,
|
|
|
67
67
|
|
|
68
68
|
## Features
|
|
69
69
|
|
|
70
|
-
✨ **Framework Agnostic**: Integrate n8n workflows, LangGraph workflows, CrewAI crews, LangChain chains, and more
|
|
70
|
+
✨ **Framework Agnostic**: Integrate n8n workflows, LangGraph workflows, CrewAI crews, LangChain chains, OpenClaw personal agents, and more
|
|
71
71
|
🔌 **Simple API**: 3-line setup to expose any agent as A2A-compliant
|
|
72
72
|
🌊 **Streaming Support**: Built-in streaming for LangGraph, LangChain, and custom adapters
|
|
73
73
|
🎯 **Type Safe**: Leverages official A2A SDK types
|
|
@@ -88,12 +88,13 @@ A Python SDK that enables seamless integration of various agent frameworks (n8n,
|
|
|
88
88
|
│ - LangGraph │
|
|
89
89
|
│ - CrewAI │
|
|
90
90
|
│ - LangChain │
|
|
91
|
+
│ - OpenClaw │
|
|
91
92
|
│ - Callable │
|
|
92
93
|
└────────┬────────┘
|
|
93
94
|
│
|
|
94
95
|
▼
|
|
95
96
|
┌─────────────────┐
|
|
96
|
-
│ Your Agent │ (n8n workflow / CrewAI crew / Chain)
|
|
97
|
+
│ Your Agent │ (n8n workflow / CrewAI crew / Chain / OpenClaw)
|
|
97
98
|
└─────────────────┘
|
|
98
99
|
```
|
|
99
100
|
|
|
@@ -226,6 +227,16 @@ adapter = await load_a2a_agent({
|
|
|
226
227
|
})
|
|
227
228
|
```
|
|
228
229
|
|
|
230
|
+
### OpenClaw Agent → A2A Agent
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
adapter = await load_a2a_agent({
|
|
234
|
+
"adapter": "openclaw",
|
|
235
|
+
"thinking": "low",
|
|
236
|
+
"async_mode": True
|
|
237
|
+
})
|
|
238
|
+
```
|
|
239
|
+
|
|
229
240
|
📚 **[View all examples →](https://github.com/hybroai/a2a-adapter/tree/main/examples/)**
|
|
230
241
|
|
|
231
242
|
## Advanced Usage
|
|
@@ -397,6 +408,19 @@ See [examples/06_langgraph_single_agent.py](https://github.com/hybroai/a2a-adapt
|
|
|
397
408
|
}
|
|
398
409
|
```
|
|
399
410
|
|
|
411
|
+
### OpenClaw Adapter
|
|
412
|
+
|
|
413
|
+
```python
|
|
414
|
+
{
|
|
415
|
+
"adapter": "openclaw",
|
|
416
|
+
"session_id": "my-session", # Optional, auto-generated if not provided
|
|
417
|
+
"agent_id": None, # Optional, use default agent
|
|
418
|
+
"thinking": "low", # Optional: off|minimal|low|medium|high|xhigh
|
|
419
|
+
"timeout": 600, # Optional, command timeout in seconds
|
|
420
|
+
"async_mode": True # Optional, return Task immediately (default: True)
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
400
424
|
## Examples
|
|
401
425
|
|
|
402
426
|
The `examples/` directory contains complete working examples:
|
|
@@ -408,6 +432,7 @@ The `examples/` directory contains complete working examples:
|
|
|
408
432
|
- **05_custom_adapter.py** - Custom adapter implementations
|
|
409
433
|
- **06_langgraph_single_agent.py** - Calling A2A agents from LangGraph
|
|
410
434
|
- **07_langgraph_server.py** - LangGraph workflow as A2A server
|
|
435
|
+
- **08_openclaw_agent.py** - OpenClaw personal AI agent
|
|
411
436
|
|
|
412
437
|
Run any example:
|
|
413
438
|
|
|
@@ -511,15 +536,16 @@ Convert framework output to A2A Message or Task.
|
|
|
511
536
|
|
|
512
537
|
Check if this adapter supports streaming responses.
|
|
513
538
|
|
|
514
|
-
##
|
|
539
|
+
## Adapter Support
|
|
515
540
|
|
|
516
|
-
| Framework
|
|
517
|
-
|
|
|
518
|
-
| **n8n**
|
|
519
|
-
| **LangGraph**
|
|
520
|
-
| **CrewAI**
|
|
521
|
-
| **LangChain**
|
|
522
|
-
| **
|
|
541
|
+
| Agent/Framework | Adapter | Non-Streaming | Streaming | Async Tasks | Status |
|
|
542
|
+
| --------------- | ------------------------ | ------------- | --------- | ----------- | --------- |
|
|
543
|
+
| **n8n** | `N8nAgentAdapter` | ✅ | ❌ | ✅ | ✅ Stable |
|
|
544
|
+
| **LangGraph** | `LangGraphAgentAdapter` | ✅ | ✅ | ✅ | ✅ Stable |
|
|
545
|
+
| **CrewAI** | `CrewAIAgentAdapter` | ✅ | ❌ | ✅ | ✅ Stable |
|
|
546
|
+
| **LangChain** | `LangChainAgentAdapter` | ✅ | ✅ | ❌ | ✅ Stable |
|
|
547
|
+
| **OpenClaw** | `OpenClawAgentAdapter` | ✅ | ❌ | ✅ | ✅ Stable |
|
|
548
|
+
| **Callable** | `CallableAgentAdapter` | ✅ | ✅ | ❌ | ✅ Stable |
|
|
523
549
|
|
|
524
550
|
## 🤝 Contributing
|
|
525
551
|
|
|
@@ -551,6 +577,7 @@ We welcome contributions from the community! Whether you're fixing bugs, adding
|
|
|
551
577
|
- [x] CrewAI adapter (with async task support)
|
|
552
578
|
- [x] LangChain adapter (with streaming)
|
|
553
579
|
- [x] Callable adapter (with streaming)
|
|
580
|
+
- [x] OpenClaw adapter (with async tasks)
|
|
554
581
|
- [x] Comprehensive examples
|
|
555
582
|
- [x] Task support (async execution pattern)
|
|
556
583
|
- [ ] Artifact support (file uploads/downloads)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
a2a_adapter/__init__.py,sha256=rGARy2mP88R-gM0A-0ZxUAGIbZaF9Kzp-Gfg1tO8cZ8,1252
|
|
2
|
+
a2a_adapter/adapter.py,sha256=xCHmNNi5C_71A8OlIf_UZ1gUcvAFAIMrq8vGV_tYuTM,6098
|
|
3
|
+
a2a_adapter/client.py,sha256=YvKgeMS7bPFsnIKhkzUv9wZ0QmBG8UJGsz_AdIn-SNA,9468
|
|
4
|
+
a2a_adapter/loader.py,sha256=HxUYzmD_BOZy4L_fVcl6lq8n3xvhytZqEP0wbO-deiw,7759
|
|
5
|
+
a2a_adapter/integrations/__init__.py,sha256=vhBLCVHqqN_YVdZGw55TMuKU1YcC_RLbGtcrQhGHEGA,1518
|
|
6
|
+
a2a_adapter/integrations/callable.py,sha256=TLtHtFwYr3vPmYWCcCvYGqSEAPV3QZxm8DnYAsy92KM,9404
|
|
7
|
+
a2a_adapter/integrations/crewai.py,sha256=YjTR-qU5m5XK0ojkngVRB6vWicfi6c6ZkGBoHBxrbR8,20410
|
|
8
|
+
a2a_adapter/integrations/langchain.py,sha256=0zpjd2vTTAEBdywsG-3rc04hVGl7Wsw-7mwJfPyc2ZM,11118
|
|
9
|
+
a2a_adapter/integrations/langgraph.py,sha256=euOpSXmgsqEw-mYzn_fmMxX3INaFI7gYqiNULvplTDw,27035
|
|
10
|
+
a2a_adapter/integrations/n8n.py,sha256=d9RqAS7y4eJZPWBaSOHBnT-wqFvTuJtmbE4rsvu5V2o,30171
|
|
11
|
+
a2a_adapter/integrations/openclaw.py,sha256=5qE9MdDQeCV0zwlPYAEySe0Piejz9tq7R83GW0OoRcc,48298
|
|
12
|
+
a2a_adapter-0.1.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
13
|
+
a2a_adapter-0.1.5.dist-info/METADATA,sha256=9MhhgcTByuH_VqKStSIxuNWJkABbLIwZsK4Lb_yIdSo,20405
|
|
14
|
+
a2a_adapter-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
15
|
+
a2a_adapter-0.1.5.dist-info/top_level.txt,sha256=b1O1dTJ2AoPEB2x-r5IHEsS2x1fczOzTrpR2DgF3LgE,12
|
|
16
|
+
a2a_adapter-0.1.5.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
a2a_adapter/__init__.py,sha256=vnE2Qh7pjEP7nXUjqxgcE_hk0MpTzseeY4_5LTltHW8,1252
|
|
2
|
-
a2a_adapter/adapter.py,sha256=xCHmNNi5C_71A8OlIf_UZ1gUcvAFAIMrq8vGV_tYuTM,6098
|
|
3
|
-
a2a_adapter/client.py,sha256=TLkYBGQitZdrw_FY_ov9EjHicJX0dqqXaQ-dwfkUv2I,7397
|
|
4
|
-
a2a_adapter/loader.py,sha256=_A4Bqa9urE1mrV16emNJWJljvtKOhHDnz_FO4imDEDc,6399
|
|
5
|
-
a2a_adapter/integrations/__init__.py,sha256=W5k7qzAHwaqxpS2ojMGd-6R_L1PQU7N1bXWHktL_Aj0,1314
|
|
6
|
-
a2a_adapter/integrations/callable.py,sha256=TLtHtFwYr3vPmYWCcCvYGqSEAPV3QZxm8DnYAsy92KM,9404
|
|
7
|
-
a2a_adapter/integrations/crewai.py,sha256=YjTR-qU5m5XK0ojkngVRB6vWicfi6c6ZkGBoHBxrbR8,20410
|
|
8
|
-
a2a_adapter/integrations/langchain.py,sha256=0zpjd2vTTAEBdywsG-3rc04hVGl7Wsw-7mwJfPyc2ZM,11118
|
|
9
|
-
a2a_adapter/integrations/langgraph.py,sha256=euOpSXmgsqEw-mYzn_fmMxX3INaFI7gYqiNULvplTDw,27035
|
|
10
|
-
a2a_adapter/integrations/n8n.py,sha256=d9RqAS7y4eJZPWBaSOHBnT-wqFvTuJtmbE4rsvu5V2o,30171
|
|
11
|
-
a2a_adapter-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
-
a2a_adapter-0.1.4.dist-info/METADATA,sha256=GLrBjqSJUMWsUT1e01G3KtdYzUKc0y7fzAprMMoJP3g,19474
|
|
13
|
-
a2a_adapter-0.1.4.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
14
|
-
a2a_adapter-0.1.4.dist-info/top_level.txt,sha256=b1O1dTJ2AoPEB2x-r5IHEsS2x1fczOzTrpR2DgF3LgE,12
|
|
15
|
-
a2a_adapter-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|