agentconnect-sdk 0.1.0a1__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.
- agentconnect_sdk/__init__.py +57 -0
- agentconnect_sdk/_log.py +7 -0
- agentconnect_sdk/client.py +733 -0
- agentconnect_sdk/dedupe.py +56 -0
- agentconnect_sdk/embedded.py +393 -0
- agentconnect_sdk/errors.py +41 -0
- agentconnect_sdk/models.py +310 -0
- agentconnect_sdk/py.typed +0 -0
- agentconnect_sdk/receiver.py +191 -0
- agentconnect_sdk/settings.py +96 -0
- agentconnect_sdk/signature.py +109 -0
- agentconnect_sdk-0.1.0a1.dist-info/METADATA +18 -0
- agentconnect_sdk-0.1.0a1.dist-info/RECORD +14 -0
- agentconnect_sdk-0.1.0a1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""AgentConnect Python SDK for headless agents.
|
|
2
|
+
|
|
3
|
+
Quickstart (embedded: the runtime runs in this process)::
|
|
4
|
+
|
|
5
|
+
from agentconnect_sdk import AgentConnect
|
|
6
|
+
|
|
7
|
+
async with AgentConnect.embedded(name="my-agent", relay="wss://relay.example.org") as ac:
|
|
8
|
+
group = await ac.create_group(purpose="plan the offsite")
|
|
9
|
+
url = await group.invite(max_uses=3)
|
|
10
|
+
|
|
11
|
+
@ac.on_message
|
|
12
|
+
async def handle(msg, group):
|
|
13
|
+
if msg.addressed_to_me:
|
|
14
|
+
await group.reply(msg, await my_agent.run(msg.text))
|
|
15
|
+
|
|
16
|
+
await ac.serve()
|
|
17
|
+
|
|
18
|
+
``AgentConnect.attach()`` talks to a separate daemon instead. Agent code
|
|
19
|
+
gets the agent-scope operations only. See ``docs/sdk.md``.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from agentconnect_sdk.client import AgentConnect, Group, TaskState
|
|
23
|
+
from agentconnect_sdk.dedupe import Deduper
|
|
24
|
+
from agentconnect_sdk.errors import (
|
|
25
|
+
AgentConnectError,
|
|
26
|
+
DataDirLockedError,
|
|
27
|
+
PayloadError,
|
|
28
|
+
ReplayError,
|
|
29
|
+
SignatureError,
|
|
30
|
+
SkewError,
|
|
31
|
+
)
|
|
32
|
+
from agentconnect_sdk.models import Event, GroupInfo, Message, Sender, TrustState, parse_payload
|
|
33
|
+
from agentconnect_sdk.signature import WebhookVerifier, sign, verify
|
|
34
|
+
|
|
35
|
+
__version__ = "0.1.0a1"
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"AgentConnect",
|
|
39
|
+
"AgentConnectError",
|
|
40
|
+
"DataDirLockedError",
|
|
41
|
+
"Deduper",
|
|
42
|
+
"Event",
|
|
43
|
+
"Group",
|
|
44
|
+
"GroupInfo",
|
|
45
|
+
"Message",
|
|
46
|
+
"PayloadError",
|
|
47
|
+
"ReplayError",
|
|
48
|
+
"Sender",
|
|
49
|
+
"SignatureError",
|
|
50
|
+
"SkewError",
|
|
51
|
+
"TaskState",
|
|
52
|
+
"TrustState",
|
|
53
|
+
"WebhookVerifier",
|
|
54
|
+
"parse_payload",
|
|
55
|
+
"sign",
|
|
56
|
+
"verify",
|
|
57
|
+
]
|