getagentid 0.1.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.
- getagentid-0.1.0/PKG-INFO +26 -0
- getagentid-0.1.0/agentid/__init__.py +6 -0
- getagentid-0.1.0/agentid/client.py +86 -0
- getagentid-0.1.0/getagentid.egg-info/PKG-INFO +26 -0
- getagentid-0.1.0/getagentid.egg-info/SOURCES.txt +9 -0
- getagentid-0.1.0/getagentid.egg-info/dependency_links.txt +1 -0
- getagentid-0.1.0/getagentid.egg-info/requires.txt +1 -0
- getagentid-0.1.0/getagentid.egg-info/top_level.txt +2 -0
- getagentid-0.1.0/setup.cfg +4 -0
- getagentid-0.1.0/setup.py +24 -0
- getagentid-0.1.0/tests/__init__.py +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: getagentid
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AgentID SDK — Identity & verification for AI agents
|
|
5
|
+
Home-page: https://getagentid.dev
|
|
6
|
+
Author: AgentID
|
|
7
|
+
Author-email: haroldmalikfrimpong@gmail.com
|
|
8
|
+
Project-URL: Documentation, https://getagentid.dev/docs
|
|
9
|
+
Project-URL: GitHub, https://github.com/haroldmalikfrimpong-ops/getagentid
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Requires-Dist: httpx>=0.27.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: project-url
|
|
22
|
+
Dynamic: requires-dist
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
The Identity & Discovery Layer for AI Agents. Register, verify, and discover agents with cryptographic certificates.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""AgentID Python Client."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
BASE_URL = "https://getagentid.dev/api/v1"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentResult:
|
|
11
|
+
def __init__(self, data: dict):
|
|
12
|
+
self._data = data
|
|
13
|
+
for k, v in data.items():
|
|
14
|
+
setattr(self, k, v)
|
|
15
|
+
|
|
16
|
+
def __repr__(self):
|
|
17
|
+
return f"AgentResult({self._data})"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Agents:
|
|
21
|
+
def __init__(self, client: 'Client'):
|
|
22
|
+
self._client = client
|
|
23
|
+
|
|
24
|
+
def register(self, name: str, description: str = "", capabilities: list = None,
|
|
25
|
+
platform: str = None, endpoint: str = None) -> AgentResult:
|
|
26
|
+
"""Register a new agent and get its certificate."""
|
|
27
|
+
res = self._client._post("/agents/register", {
|
|
28
|
+
"name": name,
|
|
29
|
+
"description": description,
|
|
30
|
+
"capabilities": capabilities or [],
|
|
31
|
+
"platform": platform,
|
|
32
|
+
"endpoint": endpoint,
|
|
33
|
+
})
|
|
34
|
+
return AgentResult(res)
|
|
35
|
+
|
|
36
|
+
def verify(self, agent_id: str) -> AgentResult:
|
|
37
|
+
"""Verify an agent's identity. No API key needed."""
|
|
38
|
+
res = httpx.post(f"{self._client._base_url}/agents/verify",
|
|
39
|
+
json={"agent_id": agent_id}, timeout=10).json()
|
|
40
|
+
return AgentResult(res)
|
|
41
|
+
|
|
42
|
+
def discover(self, capability: str = None, owner: str = None, limit: int = 20) -> list:
|
|
43
|
+
"""Search for agents by capability or owner."""
|
|
44
|
+
params = {"limit": limit}
|
|
45
|
+
if capability:
|
|
46
|
+
params["capability"] = capability
|
|
47
|
+
if owner:
|
|
48
|
+
params["owner"] = owner
|
|
49
|
+
res = httpx.get(f"{self._client._base_url}/agents/discover",
|
|
50
|
+
params=params, timeout=10).json()
|
|
51
|
+
return [AgentResult(a) for a in res.get("agents", [])]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class Client:
|
|
55
|
+
"""AgentID API Client.
|
|
56
|
+
|
|
57
|
+
Usage:
|
|
58
|
+
client = agentid.Client(api_key="agentid_sk_...")
|
|
59
|
+
result = client.agents.register(name="My Bot")
|
|
60
|
+
print(result.agent_id)
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
def __init__(self, api_key: str = None, base_url: str = None):
|
|
64
|
+
self._api_key = api_key
|
|
65
|
+
self._base_url = base_url or BASE_URL
|
|
66
|
+
self.agents = Agents(self)
|
|
67
|
+
|
|
68
|
+
def _post(self, path: str, data: dict) -> dict:
|
|
69
|
+
headers = {}
|
|
70
|
+
if self._api_key:
|
|
71
|
+
headers["Authorization"] = f"Bearer {self._api_key}"
|
|
72
|
+
res = httpx.post(f"{self._base_url}{path}", json=data, headers=headers, timeout=10)
|
|
73
|
+
if res.status_code >= 400:
|
|
74
|
+
error = res.json().get("error", "Unknown error")
|
|
75
|
+
raise Exception(f"AgentID API error: {error}")
|
|
76
|
+
return res.json()
|
|
77
|
+
|
|
78
|
+
def _get(self, path: str, params: dict = None) -> dict:
|
|
79
|
+
headers = {}
|
|
80
|
+
if self._api_key:
|
|
81
|
+
headers["Authorization"] = f"Bearer {self._api_key}"
|
|
82
|
+
res = httpx.get(f"{self._base_url}{path}", params=params, headers=headers, timeout=10)
|
|
83
|
+
if res.status_code >= 400:
|
|
84
|
+
error = res.json().get("error", "Unknown error")
|
|
85
|
+
raise Exception(f"AgentID API error: {error}")
|
|
86
|
+
return res.json()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: getagentid
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AgentID SDK — Identity & verification for AI agents
|
|
5
|
+
Home-page: https://getagentid.dev
|
|
6
|
+
Author: AgentID
|
|
7
|
+
Author-email: haroldmalikfrimpong@gmail.com
|
|
8
|
+
Project-URL: Documentation, https://getagentid.dev/docs
|
|
9
|
+
Project-URL: GitHub, https://github.com/haroldmalikfrimpong-ops/getagentid
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Requires-Dist: httpx>=0.27.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: project-url
|
|
22
|
+
Dynamic: requires-dist
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
The Identity & Discovery Layer for AI Agents. Register, verify, and discover agents with cryptographic certificates.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
httpx>=0.27.0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="getagentid",
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
packages=find_packages(),
|
|
7
|
+
install_requires=["httpx>=0.27.0"],
|
|
8
|
+
python_requires=">=3.8",
|
|
9
|
+
description="AgentID SDK — Identity & verification for AI agents",
|
|
10
|
+
long_description="The Identity & Discovery Layer for AI Agents. Register, verify, and discover agents with cryptographic certificates.",
|
|
11
|
+
author="AgentID",
|
|
12
|
+
author_email="haroldmalikfrimpong@gmail.com",
|
|
13
|
+
url="https://getagentid.dev",
|
|
14
|
+
project_urls={
|
|
15
|
+
"Documentation": "https://getagentid.dev/docs",
|
|
16
|
+
"GitHub": "https://github.com/haroldmalikfrimpong-ops/getagentid",
|
|
17
|
+
},
|
|
18
|
+
classifiers=[
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
],
|
|
24
|
+
)
|
|
File without changes
|