attp-client 0.0.6__py3-none-any.whl → 0.0.8__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/inference.py +9 -13
- attp_client/session.py +1 -1
- attp_client/tools.py +15 -17
- {attp_client-0.0.6.dist-info → attp_client-0.0.8.dist-info}/METADATA +1 -1
- {attp_client-0.0.6.dist-info → attp_client-0.0.8.dist-info}/RECORD +6 -6
- {attp_client-0.0.6.dist-info → attp_client-0.0.8.dist-info}/WHEEL +0 -0
attp_client/inference.py
CHANGED
@@ -67,13 +67,11 @@ 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
|
-
"
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
"stream": stream
|
76
|
-
}
|
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
|
77
75
|
}), timeout=timeout, expected_response=IMessageResponse)
|
78
76
|
|
79
77
|
return response
|
@@ -110,10 +108,8 @@ class AttpInferenceAPI:
|
|
110
108
|
response = await self.router.send(
|
111
109
|
"messages:chat:invoke",
|
112
110
|
Serializable[dict[str, Any]]({
|
113
|
-
"
|
114
|
-
|
115
|
-
"stream": stream
|
116
|
-
}
|
111
|
+
"chat_id": str(chat_id),
|
112
|
+
"stream": stream
|
117
113
|
}),
|
118
114
|
timeout=timeout,
|
119
115
|
expected_response=IMessageResponse
|
@@ -132,6 +128,6 @@ class AttpInferenceAPI:
|
|
132
128
|
"""
|
133
129
|
if isinstance(message, Sequence):
|
134
130
|
for msg in message:
|
135
|
-
await self.router.emit("messages:append",
|
131
|
+
await self.router.emit("messages:append", msg)
|
136
132
|
else:
|
137
|
-
await self.router.emit("messages:append",
|
133
|
+
await self.router.emit("messages:append", message)
|
attp_client/session.py
CHANGED
@@ -303,7 +303,7 @@ class SessionDriver:
|
|
303
303
|
|
304
304
|
else:
|
305
305
|
if self.is_authenticated:
|
306
|
-
self.logger.debug("cyan]ATTP[/] ┆ Handing incoming message to a route handler.")
|
306
|
+
self.logger.debug("[cyan]ATTP[/] ┆ Handing incoming message to a route handler.")
|
307
307
|
self.messages.put_nowait(event)
|
308
308
|
|
309
309
|
async def start_listener(self):
|
attp_client/tools.py
CHANGED
@@ -20,23 +20,23 @@ class ToolsManager:
|
|
20
20
|
return_direct: bool = False,
|
21
21
|
schema_ver: str = "1.0",
|
22
22
|
timeout_ms: float = 20000,
|
23
|
-
idempotent: bool = False
|
23
|
+
idempotent: bool = False,
|
24
|
+
configs: Any | None = None
|
24
25
|
) -> UUID:
|
25
26
|
response = await self.router.send(
|
26
27
|
"tools:register",
|
27
28
|
Serializable[dict[str, Any]]({
|
28
|
-
"
|
29
|
-
|
30
|
-
"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
}
|
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
|
+
"config": configs or {}
|
40
40
|
}
|
41
41
|
}),
|
42
42
|
timeout=30,
|
@@ -53,10 +53,8 @@ class ToolsManager:
|
|
53
53
|
response = await self.router.send(
|
54
54
|
"tool:unregister",
|
55
55
|
Serializable[dict[str, Any]]({
|
56
|
-
"
|
57
|
-
|
58
|
-
"tool_id": tool_id
|
59
|
-
}
|
56
|
+
"catalog": catalog_name,
|
57
|
+
"tool_id": tool_id
|
60
58
|
}),
|
61
59
|
timeout=30,
|
62
60
|
expected_response=dict[str, Any]
|
@@ -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=
|
11
|
+
attp_client/inference.py,sha256=S_iAvUwROUIE4IJGC8-ZmVXJc1CP1nbbBHmR0U1k4ZQ,4655
|
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
|
@@ -24,12 +24,12 @@ attp_client/interfaces/route_mappings.py,sha256=j6hEdkCP5xPpHS16EWmlkdTlnHa7z6e8
|
|
24
24
|
attp_client/misc/fixed_basemodel.py,sha256=0MTVmlTrA75Oxv0pVfLdXFTSp5AmBzgiNwvDiLFGF_w,1853
|
25
25
|
attp_client/misc/serializable.py,sha256=tU08TsjiLiafAhU1jKd5BxajlHdEDcdKeEiKPqhMSTI,2102
|
26
26
|
attp_client/router.py,sha256=UDHU2xsvTjgSIzMtV0jkPvOYK9R7GFjKfIrjjBHws-Q,4575
|
27
|
-
attp_client/session.py,sha256=
|
28
|
-
attp_client/tools.py,sha256=
|
27
|
+
attp_client/session.py,sha256=oZx3Lgsr-y4onaL4yrM3Sj2caQck9wc14QcakhS42Js,11410
|
28
|
+
attp_client/tools.py,sha256=zyMCDbph77Ojm74bEQhGm3gzam8lolVpLobcOc89dTM,1920
|
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.
|
34
|
-
attp_client-0.0.
|
35
|
-
attp_client-0.0.
|
33
|
+
attp_client-0.0.8.dist-info/METADATA,sha256=4muzno9jFdb6WrogPMa4b0HFIvD1LbNeWB5OCUUkVP8,7137
|
34
|
+
attp_client-0.0.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
35
|
+
attp_client-0.0.8.dist-info/RECORD,,
|
File without changes
|