attp-client 0.0.2__py3-none-any.whl → 0.0.4__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.
- attp_client/__init__.py +104 -0
- attp_client/catalog.py +7 -0
- attp_client/inference.py +0 -1
- attp_client/interfaces/inference/message.py +2 -1
- {attp_client-0.0.2.dist-info → attp_client-0.0.4.dist-info}/METADATA +1 -1
- {attp_client-0.0.2.dist-info → attp_client-0.0.4.dist-info}/RECORD +7 -6
- {attp_client-0.0.2.dist-info → attp_client-0.0.4.dist-info}/WHEEL +0 -0
attp_client/__init__.py
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
"""ATTP Client Library
|
2
|
+
|
3
|
+
A Python client library for the ATTP (Agent Transfer Transfer Protocol) framework.
|
4
|
+
"""
|
5
|
+
|
6
|
+
# Main client class
|
7
|
+
from .client import ATTPClient
|
8
|
+
|
9
|
+
# Core API classes
|
10
|
+
from .catalog import AttpCatalog
|
11
|
+
from .inference import AttpInferenceAPI
|
12
|
+
from .router import AttpRouter
|
13
|
+
from .session import SessionDriver
|
14
|
+
from .tools import ToolsManager
|
15
|
+
|
16
|
+
# Exception classes
|
17
|
+
from .errors.attp_exception import AttpException
|
18
|
+
from .errors.correlated_rpc_exception import CorrelatedRPCException
|
19
|
+
from .errors.dead_session import DeadSessionError
|
20
|
+
from .errors.not_found import NotFoundError
|
21
|
+
from .errors.serialization_error import SerializationError
|
22
|
+
from .errors.unauthenticated_error import UnauthenticatedError
|
23
|
+
|
24
|
+
# Interface classes
|
25
|
+
from .interfaces.error import IErr
|
26
|
+
from .interfaces.route_mappings import IRouteMapping
|
27
|
+
from .interfaces.catalogs.catalog import ICatalogResponse
|
28
|
+
from .interfaces.catalogs.tools.envelope import IEnvelope
|
29
|
+
from .interfaces.handshake.auth import IAuth
|
30
|
+
from .interfaces.handshake.hello import IHello
|
31
|
+
from .interfaces.handshake.ready import IReady
|
32
|
+
from .interfaces.inference.message import IMessageResponse, IMessageDTOV2
|
33
|
+
from .interfaces.inference.tool import ToolV2
|
34
|
+
from .interfaces.inference.enums.message_data_type import MessageDataTypeEnum
|
35
|
+
from .interfaces.inference.enums.message_emergency_type import MessageEmergencyTypeEnum
|
36
|
+
from .interfaces.inference.enums.message_type import MessageTypeEnum
|
37
|
+
|
38
|
+
# Type definitions
|
39
|
+
from .types.route_mapping import AttpRouteMapping, RouteType
|
40
|
+
|
41
|
+
# Utility classes
|
42
|
+
from .utils.context_awaiter import ContextAwaiter
|
43
|
+
from .utils.route_mapper import resolve_route_by_id
|
44
|
+
from .utils.serializer import serialize, deserialize
|
45
|
+
|
46
|
+
# Misc classes
|
47
|
+
from .misc.fixed_basemodel import FixedBaseModel
|
48
|
+
from .misc.serializable import Serializable
|
49
|
+
|
50
|
+
# Constants
|
51
|
+
from .consts import ATTP_VERSION
|
52
|
+
|
53
|
+
__version__ = "0.1.0"
|
54
|
+
__all__ = [
|
55
|
+
# Main client
|
56
|
+
"ATTPClient",
|
57
|
+
|
58
|
+
# Core API classes
|
59
|
+
"AttpCatalog",
|
60
|
+
"AttpInferenceAPI",
|
61
|
+
"AttpRouter",
|
62
|
+
"SessionDriver",
|
63
|
+
"ToolsManager",
|
64
|
+
|
65
|
+
# Exceptions
|
66
|
+
"AttpException",
|
67
|
+
"CorrelatedRPCException",
|
68
|
+
"DeadSessionError",
|
69
|
+
"NotFoundError",
|
70
|
+
"SerializationError",
|
71
|
+
"UnauthenticatedError",
|
72
|
+
|
73
|
+
# Interfaces
|
74
|
+
"IErr",
|
75
|
+
"IRouteMapping",
|
76
|
+
"ICatalogResponse",
|
77
|
+
"IEnvelope",
|
78
|
+
"IAuth",
|
79
|
+
"IHello",
|
80
|
+
"IReady",
|
81
|
+
"IMessageResponse",
|
82
|
+
"IMessageDTOV2",
|
83
|
+
"ToolV2",
|
84
|
+
"MessageDataTypeEnum",
|
85
|
+
"MessageEmergencyTypeEnum",
|
86
|
+
"MessageTypeEnum",
|
87
|
+
|
88
|
+
# Types
|
89
|
+
"AttpRouteMapping",
|
90
|
+
"RouteType",
|
91
|
+
|
92
|
+
# Utils
|
93
|
+
"ContextAwaiter",
|
94
|
+
"resolve_route_by_id",
|
95
|
+
"serialize",
|
96
|
+
"deserialize",
|
97
|
+
|
98
|
+
# Misc
|
99
|
+
"FixedBaseModel",
|
100
|
+
"Serializable",
|
101
|
+
|
102
|
+
# Constants
|
103
|
+
"ATTP_VERSION",
|
104
|
+
]
|
attp_client/catalog.py
CHANGED
@@ -108,6 +108,13 @@ class AttpCatalog:
|
|
108
108
|
await self.tool_manager.unregister(self.catalog_name, tool_id)
|
109
109
|
return tool_id
|
110
110
|
|
111
|
+
async def detatch_all_tools(self):
|
112
|
+
for tool_id in list(self.attached_tools.keys()):
|
113
|
+
await self.tool_manager.unregister(self.catalog_name, tool_id)
|
114
|
+
del self.attached_tools[tool_id]
|
115
|
+
|
116
|
+
self.tool_name_to_id_symlink.clear()
|
117
|
+
|
111
118
|
async def handle_call(self, envelope: IEnvelope) -> Any:
|
112
119
|
tool = self.attached_tools.get(envelope.tool_id)
|
113
120
|
|
attp_client/inference.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Literal
|
1
|
+
from typing import Any, Literal
|
2
2
|
from uuid import UUID
|
3
3
|
from attp_client.interfaces.inference.enums.message_emergency_type import MessageEmergencyTypeEnum
|
4
4
|
from attp_client.interfaces.inference.enums.message_type import MessageTypeEnum
|
@@ -34,6 +34,7 @@ class IMessageDTOV2(FixedBaseModel):
|
|
34
34
|
tool_error_detail: str | None = None
|
35
35
|
|
36
36
|
specialist_required: MessageEmergencyTypeEnum | None = None
|
37
|
+
metadata: dict[str, Any] | None = None
|
37
38
|
|
38
39
|
def to_wrap(self) -> dict:
|
39
40
|
w = self.model_dump()
|
@@ -1,4 +1,5 @@
|
|
1
|
-
attp_client/
|
1
|
+
attp_client/__init__.py,sha256=25qGMUU_W8juBuW9N6318vWoqALrPQSp3ECHHkNzUcg,2749
|
2
|
+
attp_client/catalog.py,sha256=1w4rxxrOuqeB6qm0rn2VfrTnXEjcKVT7vZF2w8gFKnI,4571
|
2
3
|
attp_client/client.py,sha256=aSjDaH1pHkmPsVZBwIrSIMX8QXDtbDfGpVBXR5KgnF4,3989
|
3
4
|
attp_client/consts.py,sha256=6UZyqWddycOp-TKW5yvb0JW2fdfcS-J2xFVVNfuJQbU,18
|
4
5
|
attp_client/errors/attp_exception.py,sha256=HePYyYMknS4t6tMrwU-p9L_LPdj1i7chntrlM53ueK4,347
|
@@ -7,7 +8,7 @@ attp_client/errors/dead_session.py,sha256=BI-EuTqxVP7j23wcD0GfhteyPsKR2xqUsMNm9S
|
|
7
8
|
attp_client/errors/not_found.py,sha256=Y-Y_Mki1hQYihJttvO0ugHFu9-73--1wqwdOomp2IEM,39
|
8
9
|
attp_client/errors/serialization_error.py,sha256=Pa8PRzFJrrikA1Ikj0q-0euvXVUMb_qj-NRIp55SfOk,198
|
9
10
|
attp_client/errors/unauthenticated_error.py,sha256=F0V1FjO0qVLMl6Y120y3AXKZnwb5iDD17c4GEMbL5aI,46
|
10
|
-
attp_client/inference.py,sha256=
|
11
|
+
attp_client/inference.py,sha256=gYCCaUI_DPgCkmxSNNdEte-5dp9MDEazjV6D79ycKEU,4611
|
11
12
|
attp_client/interfaces/catalogs/catalog.py,sha256=3PxlRwR3y2tbQVfXAkhDIv07AJPraMfH0c_pyi7Y6z8,146
|
12
13
|
attp_client/interfaces/catalogs/tools/envelope.py,sha256=6aUx06ou9If9OYv4BODKiBybrgBL2YWfSHZ6ukIR1K0,693
|
13
14
|
attp_client/interfaces/error.py,sha256=fIrk5XlAhMs6mbYQ5PzgwS0v-LIbtne3OlQue4CjWXs,139
|
@@ -17,7 +18,7 @@ attp_client/interfaces/handshake/ready.py,sha256=0gEqwbvgRHkHb3FIn4YEyJ8LuzzP260
|
|
17
18
|
attp_client/interfaces/inference/enums/message_data_type.py,sha256=v68IW8DMyb-ezGnyR6T5kPE70FPDZ14AvCP2mI-iLPo,397
|
18
19
|
attp_client/interfaces/inference/enums/message_emergency_type.py,sha256=8s6PONMUdNzrxVLM5aTAicdKSk6BsRFLujVUsm5jopM,149
|
19
20
|
attp_client/interfaces/inference/enums/message_type.py,sha256=joo6t9vLDeupEtfE1II_-oW6Y_c9zSAGe0bl32TqAlA,508
|
20
|
-
attp_client/interfaces/inference/message.py,sha256=
|
21
|
+
attp_client/interfaces/inference/message.py,sha256=zoKf1yxRsbFqPlsDpO5zVFVgIqDAbc7xkbIcivao1HU,1637
|
21
22
|
attp_client/interfaces/inference/tool.py,sha256=Oabb7w0HJtpyO-AcezmojdsJMGuLH4JHXft7h4mlyX8,134
|
22
23
|
attp_client/interfaces/route_mappings.py,sha256=j6hEdkCP5xPpHS16EWmlkdTlnHa7z6e8ukbY-NolKcQ,416
|
23
24
|
attp_client/misc/fixed_basemodel.py,sha256=0MTVmlTrA75Oxv0pVfLdXFTSp5AmBzgiNwvDiLFGF_w,1853
|
@@ -29,6 +30,6 @@ attp_client/types/route_mapping.py,sha256=Kb9ZX88lqihRZr8IryfH1Vg_YAobW699Yjl6Ra
|
|
29
30
|
attp_client/utils/context_awaiter.py,sha256=oCptu5g8mY43j5cr-W4fOe85OCCaqQI9r_Pn92NgZSY,1035
|
30
31
|
attp_client/utils/route_mapper.py,sha256=uJNhKp6ipCSUxoiZS0Liix2lHOgUAnJM0kfgXWAh9RQ,554
|
31
32
|
attp_client/utils/serializer.py,sha256=O1tWYbQS9jC9aus-ISKtliKCgGmOEIb9hxykVrmMKGY,636
|
32
|
-
attp_client-0.0.
|
33
|
-
attp_client-0.0.
|
34
|
-
attp_client-0.0.
|
33
|
+
attp_client-0.0.4.dist-info/METADATA,sha256=p5aBKECM-TjvgN9E4DxKDo24fDopEdnkNTQUcpxV2nY,7137
|
34
|
+
attp_client-0.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
35
|
+
attp_client-0.0.4.dist-info/RECORD,,
|
File without changes
|