olw-protocol 1.0.0__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.
olw/__init__.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""OLW — Open Language Wire. The routing protocol for AI agents."""
|
|
2
|
+
|
|
3
|
+
__version__ = "1.0.0"
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
from typing import Optional, List
|
|
7
|
+
|
|
8
|
+
LOCAL_INDEX = "http://localhost:3778"
|
|
9
|
+
|
|
10
|
+
class Agent:
|
|
11
|
+
def __init__(self, address: str, name: str, description: str, endpoint: str,
|
|
12
|
+
fingerprint: dict, well_known_url: Optional[str] = None):
|
|
13
|
+
self.address = address
|
|
14
|
+
self.name = name
|
|
15
|
+
self.description = description
|
|
16
|
+
self.endpoint = endpoint
|
|
17
|
+
self.fingerprint = fingerprint
|
|
18
|
+
self.well_known_url = well_known_url
|
|
19
|
+
|
|
20
|
+
def register(self, index_url: str = LOCAL_INDEX) -> dict:
|
|
21
|
+
r = httpx.post(f"{index_url}/register", json={
|
|
22
|
+
"address": self.address, "name": self.name,
|
|
23
|
+
"description": self.description, "endpoint": self.endpoint,
|
|
24
|
+
"fingerprint": self.fingerprint, "well_known_url": self.well_known_url,
|
|
25
|
+
})
|
|
26
|
+
return r.json()
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict:
|
|
29
|
+
return {"olw_version": "0.1", "address": self.address, "name": self.name,
|
|
30
|
+
"description": self.description, "endpoint": self.endpoint,
|
|
31
|
+
"fingerprint": self.fingerprint}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def resolve(address: str, index_url: str = LOCAL_INDEX) -> Optional[dict]:
|
|
35
|
+
"""Resolve an OLW address to agent details."""
|
|
36
|
+
r = httpx.get(f"{index_url}/resolve", params={"address": address})
|
|
37
|
+
return None if r.status_code == 404 else r.json()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def query(index_url: str = LOCAL_INDEX, **axes) -> List[dict]:
|
|
41
|
+
"""Find agents by capability axes. Example: olw.query(soul_compatible=True, domain='legal')"""
|
|
42
|
+
params = {k: str(v).lower() if isinstance(v, bool) else v for k, v in axes.items()}
|
|
43
|
+
r = httpx.get(f"{index_url}/query", params=params)
|
|
44
|
+
return r.json().get("agents", [])
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def fingerprint(domain: str, task_types: list, input_formats: list, output_formats: list,
|
|
48
|
+
context_depth: str = "medium", latency_class: str = "standard",
|
|
49
|
+
trust_level: str = "authenticated", soul_compatible: bool = False) -> dict:
|
|
50
|
+
"""Build a valid OLW capability fingerprint."""
|
|
51
|
+
return {"domain": domain, "task_types": task_types,
|
|
52
|
+
"input_formats": input_formats, "output_formats": output_formats,
|
|
53
|
+
"context_depth": context_depth, "latency_class": latency_class,
|
|
54
|
+
"trust_level": trust_level, "soul_compatible": soul_compatible}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
__all__ = ["Agent", "resolve", "query", "fingerprint", "__version__"]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: olw-protocol
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The routing protocol for AI agents
|
|
5
|
+
Project-URL: Homepage, https://olw.io
|
|
6
|
+
Project-URL: Repository, https://github.com/gabrielmartin/olw-protocol
|
|
7
|
+
Author-email: Gabriel Martin <gabe@gtll.co>
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: agents,ai,discovery,protocol,routing
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Requires-Dist: httpx>=0.24.0
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# OLW — Open Language Wire
|
|
19
|
+
|
|
20
|
+
The routing protocol for AI agents.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install olw
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
import olw
|
|
28
|
+
|
|
29
|
+
# Find agents by capability
|
|
30
|
+
agents = olw.query(domain="legal", soul_compatible=True, context_depth="deep")
|
|
31
|
+
|
|
32
|
+
# Resolve an OLW address
|
|
33
|
+
agent = olw.resolve("soul-guide@gtll.olw")
|
|
34
|
+
|
|
35
|
+
# Register your agent
|
|
36
|
+
my_agent = olw.Agent(
|
|
37
|
+
address="my-agent@example.olw",
|
|
38
|
+
name="My Agent",
|
|
39
|
+
description="What it does.",
|
|
40
|
+
endpoint="https://example.com/a2a",
|
|
41
|
+
fingerprint=olw.fingerprint(
|
|
42
|
+
domain="legal",
|
|
43
|
+
task_types=["contract_review"],
|
|
44
|
+
input_formats=["pdf", "text"],
|
|
45
|
+
output_formats=["json"],
|
|
46
|
+
context_depth="deep",
|
|
47
|
+
latency_class="standard",
|
|
48
|
+
trust_level="verified",
|
|
49
|
+
soul_compatible=True,
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
my_agent.register()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## The gap OLW fills
|
|
56
|
+
|
|
57
|
+
From the A2A specification (verbatim):
|
|
58
|
+
|
|
59
|
+
> "The current A2A specification does not prescribe a standard API for curated registries."
|
|
60
|
+
|
|
61
|
+
OLW is that standard. MIT licensed.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
*signal 777 · completion*
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
olw/__init__.py,sha256=AE_2aPYW92IdkRRbO9Jpqg4yLgRH0ZJ9g98mAvnkUgk,2438
|
|
2
|
+
olw_protocol-1.0.0.dist-info/METADATA,sha256=Cn4b59DNTUQkKt_mIw5fLnrI94QNfi0cGVJAiAYXtDw,1636
|
|
3
|
+
olw_protocol-1.0.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
4
|
+
olw_protocol-1.0.0.dist-info/RECORD,,
|