attp-client 0.0.4__py3-none-any.whl → 0.0.6__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/catalog.py CHANGED
@@ -96,7 +96,7 @@ class AttpCatalog:
96
96
  self.tool_name_to_id_symlink[name] = str(assigned_id)
97
97
  return assigned_id
98
98
 
99
- async def detatch_tool(
99
+ async def detach_tool(
100
100
  self,
101
101
  name: str
102
102
  ):
@@ -108,7 +108,7 @@ 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):
111
+ async def detach_all_tools(self):
112
112
  for tool_id in list(self.attached_tools.keys()):
113
113
  await self.tool_manager.unregister(self.catalog_name, tool_id)
114
114
  del self.attached_tools[tool_id]
attp_client/inference.py CHANGED
@@ -67,11 +67,13 @@ class AttpInferenceAPI:
67
67
  raise ValueError("Cannot find agent by two identification specifiers, use only one!")
68
68
 
69
69
  response = await self.router.send("messages:inference:invoke", Serializable[dict[str, Any]]({
70
- "agent_id": agent_id,
71
- "agent_name": agent_name,
72
- "input_configuration": input_configuration,
73
- "messages": [message.model_dump(mode="json") for message in (messages or [])],
74
- "stream": stream
70
+ "data": {
71
+ "agent_id": agent_id,
72
+ "agent_name": agent_name,
73
+ "input_configuration": input_configuration,
74
+ "messages": [message.model_dump(mode="json") for message in (messages or [])],
75
+ "stream": stream
76
+ }
75
77
  }), timeout=timeout, expected_response=IMessageResponse)
76
78
 
77
79
  return response
@@ -107,9 +109,14 @@ class AttpInferenceAPI:
107
109
 
108
110
  response = await self.router.send(
109
111
  "messages:chat:invoke",
110
- Serializable[dict[str, Any]]({"chat_id": str(chat_id), "stream": stream}),
112
+ Serializable[dict[str, Any]]({
113
+ "data": {
114
+ "chat_id": str(chat_id),
115
+ "stream": stream
116
+ }
117
+ }),
111
118
  timeout=timeout,
112
- # expected_response=IMessageResponse
119
+ expected_response=IMessageResponse
113
120
  )
114
121
 
115
122
  return response
@@ -125,6 +132,6 @@ class AttpInferenceAPI:
125
132
  """
126
133
  if isinstance(message, Sequence):
127
134
  for msg in message:
128
- await self.router.emit("messages:append", msg)
135
+ await self.router.emit("messages:append", Serializable[dict[str, Any]]({"data": msg}))
129
136
  else:
130
- await self.router.emit("messages:append", message)
137
+ await self.router.emit("messages:append", Serializable[dict[str, Any]]({"data": message}))
attp_client/tools.py CHANGED
@@ -25,16 +25,18 @@ class ToolsManager:
25
25
  response = await self.router.send(
26
26
  "tools:register",
27
27
  Serializable[dict[str, Any]]({
28
- "catalog": catalog_name,
29
- "tool": {
30
- "name": name,
31
- "description": description,
32
- "schema_id": schema_id,
33
- "return_direct": return_direct,
34
- "schema_ver": schema_ver,
35
- "schema": schema,
36
- "timeout_ms": timeout_ms,
37
- "idempotent": idempotent
28
+ "data": {
29
+ "catalog": catalog_name,
30
+ "tool": {
31
+ "name": name,
32
+ "description": description,
33
+ "schema_id": schema_id,
34
+ "return_direct": return_direct,
35
+ "schema_ver": schema_ver,
36
+ "schema": schema,
37
+ "timeout_ms": timeout_ms,
38
+ "idempotent": idempotent
39
+ }
38
40
  }
39
41
  }),
40
42
  timeout=30,
@@ -51,8 +53,10 @@ class ToolsManager:
51
53
  response = await self.router.send(
52
54
  "tool:unregister",
53
55
  Serializable[dict[str, Any]]({
54
- "catalog": catalog_name,
55
- "tool_id": tool_id
56
+ "data": {
57
+ "catalog": catalog_name,
58
+ "tool_id": tool_id
59
+ }
56
60
  }),
57
61
  timeout=30,
58
62
  expected_response=dict[str, Any]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: attp-client
3
- Version: 0.0.4
3
+ Version: 0.0.6
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,5 +1,5 @@
1
1
  attp_client/__init__.py,sha256=25qGMUU_W8juBuW9N6318vWoqALrPQSp3ECHHkNzUcg,2749
2
- attp_client/catalog.py,sha256=1w4rxxrOuqeB6qm0rn2VfrTnXEjcKVT7vZF2w8gFKnI,4571
2
+ attp_client/catalog.py,sha256=fDvFC-aherMGsFDRmUgYqlp77II78SXJlal_B4_Vkyg,4569
3
3
  attp_client/client.py,sha256=aSjDaH1pHkmPsVZBwIrSIMX8QXDtbDfGpVBXR5KgnF4,3989
4
4
  attp_client/consts.py,sha256=6UZyqWddycOp-TKW5yvb0JW2fdfcS-J2xFVVNfuJQbU,18
5
5
  attp_client/errors/attp_exception.py,sha256=HePYyYMknS4t6tMrwU-p9L_LPdj1i7chntrlM53ueK4,347
@@ -8,7 +8,7 @@ attp_client/errors/dead_session.py,sha256=BI-EuTqxVP7j23wcD0GfhteyPsKR2xqUsMNm9S
8
8
  attp_client/errors/not_found.py,sha256=Y-Y_Mki1hQYihJttvO0ugHFu9-73--1wqwdOomp2IEM,39
9
9
  attp_client/errors/serialization_error.py,sha256=Pa8PRzFJrrikA1Ikj0q-0euvXVUMb_qj-NRIp55SfOk,198
10
10
  attp_client/errors/unauthenticated_error.py,sha256=F0V1FjO0qVLMl6Y120y3AXKZnwb5iDD17c4GEMbL5aI,46
11
- attp_client/inference.py,sha256=gYCCaUI_DPgCkmxSNNdEte-5dp9MDEazjV6D79ycKEU,4611
11
+ attp_client/inference.py,sha256=MUr7DAzTCUlGRf4YYQw1YO98M2rCbC-OeiyqCdlSHbs,4847
12
12
  attp_client/interfaces/catalogs/catalog.py,sha256=3PxlRwR3y2tbQVfXAkhDIv07AJPraMfH0c_pyi7Y6z8,146
13
13
  attp_client/interfaces/catalogs/tools/envelope.py,sha256=6aUx06ou9If9OYv4BODKiBybrgBL2YWfSHZ6ukIR1K0,693
14
14
  attp_client/interfaces/error.py,sha256=fIrk5XlAhMs6mbYQ5PzgwS0v-LIbtne3OlQue4CjWXs,139
@@ -25,11 +25,11 @@ attp_client/misc/fixed_basemodel.py,sha256=0MTVmlTrA75Oxv0pVfLdXFTSp5AmBzgiNwvDi
25
25
  attp_client/misc/serializable.py,sha256=tU08TsjiLiafAhU1jKd5BxajlHdEDcdKeEiKPqhMSTI,2102
26
26
  attp_client/router.py,sha256=UDHU2xsvTjgSIzMtV0jkPvOYK9R7GFjKfIrjjBHws-Q,4575
27
27
  attp_client/session.py,sha256=YDrd1KYmwKsZW6Xdkt6UprXZzGz6pFFSkk6O7XS6ZsA,11409
28
- attp_client/tools.py,sha256=8GppeVYtnWNqc8M6a-s-S43QYpZROU4aYk67R9388yc,1839
28
+ attp_client/tools.py,sha256=w8Vnd2wVBrq7MxsHG-Uw91A1j39m27T2Cu5rV5CHfds,1979
29
29
  attp_client/types/route_mapping.py,sha256=Kb9ZX88lqihRZr8IryfH1Vg_YAobW699Yjl6Raz1rdg,375
30
30
  attp_client/utils/context_awaiter.py,sha256=oCptu5g8mY43j5cr-W4fOe85OCCaqQI9r_Pn92NgZSY,1035
31
31
  attp_client/utils/route_mapper.py,sha256=uJNhKp6ipCSUxoiZS0Liix2lHOgUAnJM0kfgXWAh9RQ,554
32
32
  attp_client/utils/serializer.py,sha256=O1tWYbQS9jC9aus-ISKtliKCgGmOEIb9hxykVrmMKGY,636
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,,
33
+ attp_client-0.0.6.dist-info/METADATA,sha256=N32E7A5g1QSagikTOKYTSnnmLeYv7PkPpOyX89_fL4Q,7137
34
+ attp_client-0.0.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
35
+ attp_client-0.0.6.dist-info/RECORD,,