attp-client 0.0.3__tar.gz → 0.0.4__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.
Files changed (35) hide show
  1. {attp_client-0.0.3 → attp_client-0.0.4}/PKG-INFO +1 -1
  2. {attp_client-0.0.3 → attp_client-0.0.4}/pyproject.toml +1 -1
  3. attp_client-0.0.4/src/attp_client/__init__.py +104 -0
  4. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/catalog.py +7 -0
  5. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/inference.py +0 -1
  6. {attp_client-0.0.3 → attp_client-0.0.4}/README.md +0 -0
  7. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/client.py +0 -0
  8. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/consts.py +0 -0
  9. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/attp_exception.py +0 -0
  10. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/correlated_rpc_exception.py +0 -0
  11. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/dead_session.py +0 -0
  12. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/not_found.py +0 -0
  13. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/serialization_error.py +0 -0
  14. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/errors/unauthenticated_error.py +0 -0
  15. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/catalogs/catalog.py +0 -0
  16. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/catalogs/tools/envelope.py +0 -0
  17. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/error.py +0 -0
  18. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/handshake/auth.py +0 -0
  19. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/handshake/hello.py +0 -0
  20. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/handshake/ready.py +0 -0
  21. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/inference/enums/message_data_type.py +0 -0
  22. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/inference/enums/message_emergency_type.py +0 -0
  23. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/inference/enums/message_type.py +0 -0
  24. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/inference/message.py +0 -0
  25. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/inference/tool.py +0 -0
  26. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/interfaces/route_mappings.py +0 -0
  27. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/misc/fixed_basemodel.py +0 -0
  28. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/misc/serializable.py +0 -0
  29. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/router.py +0 -0
  30. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/session.py +0 -0
  31. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/tools.py +0 -0
  32. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/types/route_mapping.py +0 -0
  33. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/utils/context_awaiter.py +0 -0
  34. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/utils/route_mapper.py +0 -0
  35. {attp_client-0.0.3 → attp_client-0.0.4}/src/attp_client/utils/serializer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: attp-client
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: A python-sdk client for interacting with AgentHub's ATTP protocol (Agent Tool Transport Protocol)
5
5
  License: MIT
6
6
  Author: Ascender Team
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "attp-client"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = "A python-sdk client for interacting with AgentHub's ATTP protocol (Agent Tool Transport Protocol)"
5
5
  authors = [
6
6
  {name = "Ascender Team"}
@@ -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
+ ]
@@ -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
 
@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  from logging import Logger, getLogger
3
2
  from typing import Any, Sequence
4
3
  from uuid import UUID
File without changes