sapiopycommons 2025.7.22a645__py3-none-any.whl → 2025.7.22a651__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.
Potentially problematic release.
This version of sapiopycommons might be problematic. Click here for more details.
- sapiopycommons/ai/test_client.py +19 -3
- {sapiopycommons-2025.7.22a645.dist-info → sapiopycommons-2025.7.22a651.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.7.22a645.dist-info → sapiopycommons-2025.7.22a651.dist-info}/RECORD +5 -5
- {sapiopycommons-2025.7.22a645.dist-info → sapiopycommons-2025.7.22a651.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.7.22a645.dist-info → sapiopycommons-2025.7.22a651.dist-info}/licenses/LICENSE +0 -0
sapiopycommons/ai/test_client.py
CHANGED
|
@@ -10,7 +10,7 @@ from sapiopycommons.ai.api.plan.tool.proto.entry_pb2 import DataTypePbo, StepBin
|
|
|
10
10
|
StepCsvHeaderRowPbo, StepCsvContainerPbo, StepJsonContainerPbo, StepImageContainerPbo, StepTextContainerPbo, \
|
|
11
11
|
StepItemContainerPbo, StepInputBatchPbo
|
|
12
12
|
from sapiopycommons.ai.api.plan.tool.proto.tool_pb2 import ProcessStepResponsePbo, ProcessStepRequestPbo, \
|
|
13
|
-
ToolDetailsRequestPbo, ToolDetailsResponsePbo
|
|
13
|
+
ToolDetailsRequestPbo, ToolDetailsResponsePbo, ProcessStepResponseStatusPbo
|
|
14
14
|
from sapiopycommons.ai.api.plan.tool.proto.tool_pb2_grpc import ToolServiceStub
|
|
15
15
|
from sapiopycommons.ai.api.session.proto.sapio_conn_info_pb2 import SapioConnectionInfoPbo, SapioUserSecretTypePbo
|
|
16
16
|
|
|
@@ -23,6 +23,9 @@ class ToolOutput:
|
|
|
23
23
|
"""
|
|
24
24
|
tool_name: str
|
|
25
25
|
|
|
26
|
+
status: str
|
|
27
|
+
message: str
|
|
28
|
+
|
|
26
29
|
binary_output: list[bytes]
|
|
27
30
|
csv_output: list[dict[str, Any]]
|
|
28
31
|
json_output: list[Any]
|
|
@@ -45,6 +48,8 @@ class ToolOutput:
|
|
|
45
48
|
|
|
46
49
|
def __str__(self):
|
|
47
50
|
ret_val: str = f"{self.tool_name} Output:\n"
|
|
51
|
+
ret_val += f"\tStatus: {self.status}\n"
|
|
52
|
+
ret_val += f"\tMessage: {self.message}\n"
|
|
48
53
|
ret_val += "-" * 25 + "\n"
|
|
49
54
|
ret_val += f"Binary Output: {len(self.binary_output)} item(s)\n"
|
|
50
55
|
for binary in self.binary_output:
|
|
@@ -215,12 +220,13 @@ class TestClient:
|
|
|
215
220
|
stub = ToolServiceStub(channel)
|
|
216
221
|
return stub.GetToolDetails(ToolDetailsRequestPbo(sapio_conn_info=self.connection))
|
|
217
222
|
|
|
218
|
-
def call_tool(self, tool_name: str) -> ToolOutput:
|
|
223
|
+
def call_tool(self, tool_name: str, is_dry_run: bool = False) -> ToolOutput:
|
|
219
224
|
"""
|
|
220
225
|
Send the request to the tool service for a particular tool name. This will send all the inputs that have been
|
|
221
226
|
added using the add_X_input functions.
|
|
222
227
|
|
|
223
228
|
:param tool_name: The name of the tool to call on the server.
|
|
229
|
+
:param is_dry_run: If True, the tool will not be executed, but the request will be validated.
|
|
224
230
|
:return: A ToolOutput object containing the results of the tool service call.
|
|
225
231
|
"""
|
|
226
232
|
with grpc.insecure_channel(self.grpc_server_url) as channel:
|
|
@@ -234,11 +240,21 @@ class TestClient:
|
|
|
234
240
|
input=[
|
|
235
241
|
StepInputBatchPbo(is_partial=False, item_container=item)
|
|
236
242
|
for item in self._request_inputs
|
|
237
|
-
]
|
|
243
|
+
],
|
|
244
|
+
dry_run=is_dry_run,
|
|
245
|
+
verbose_logging=True
|
|
238
246
|
)
|
|
239
247
|
)
|
|
240
248
|
|
|
241
249
|
results = ToolOutput(tool_name)
|
|
250
|
+
match response.status:
|
|
251
|
+
case ProcessStepResponseStatusPbo.SUCCESS:
|
|
252
|
+
results.status = "Success"
|
|
253
|
+
case ProcessStepResponseStatusPbo.FAILURE:
|
|
254
|
+
results.status = "Failure"
|
|
255
|
+
case _:
|
|
256
|
+
results.status = "Unknown"
|
|
257
|
+
results.message = response.status_message
|
|
242
258
|
for item in response.output:
|
|
243
259
|
container = item.item_container
|
|
244
260
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.7.
|
|
3
|
+
Version: 2025.7.22a651
|
|
4
4
|
Summary: Official Sapio Python API Utilities Package
|
|
5
5
|
Project-URL: Homepage, https://github.com/sapiosciences
|
|
6
6
|
Author-email: Jonathan Steck <jsteck@sapiosciences.com>, Yechen Qiao <yqiao@sapiosciences.com>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
sapiopycommons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
sapiopycommons/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
sapiopycommons/ai/protobuf_utils.py,sha256=8VYGhAdD731Ojy5PTy61PlTcvfEdydkIdX-4rOFPtxM,24911
|
|
4
|
-
sapiopycommons/ai/test_client.py,sha256=
|
|
4
|
+
sapiopycommons/ai/test_client.py,sha256=ty-D_xemOiPbp-2hj57aam4-l74HvxKLpPf22i5pPqY,11917
|
|
5
5
|
sapiopycommons/ai/tool_service_base.py,sha256=8SvmxWyu2nKeRjtq5qNAizL-lnfURr4Cbuw4K7hpWxs,41947
|
|
6
6
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.py,sha256=YcZjb_YM-XeLErM8hEC_S7vGMVGvcXAMGs2b-u5zvOE,2377
|
|
7
7
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.pyi,sha256=FwtXmNAf7iYGEFm4kbqb04v77jNHbZg18ZmEDhle_bU,1444
|
|
@@ -90,7 +90,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
90
90
|
sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
|
|
91
91
|
sapiopycommons/webhook/webhook_handlers.py,sha256=7o_wXOruhT9auNh8OfhJAh4WhhiPKij67FMBSpGPICc,39939
|
|
92
92
|
sapiopycommons/webhook/webservice_handlers.py,sha256=cvW6Mk_110BzYqkbk63Kg7jWrltBCDALOlkJRu8h4VQ,14300
|
|
93
|
-
sapiopycommons-2025.7.
|
|
94
|
-
sapiopycommons-2025.7.
|
|
95
|
-
sapiopycommons-2025.7.
|
|
96
|
-
sapiopycommons-2025.7.
|
|
93
|
+
sapiopycommons-2025.7.22a651.dist-info/METADATA,sha256=ij7R4yByMHiMKB3NljyGKKk34lsMoufPai-38qbEB3A,3143
|
|
94
|
+
sapiopycommons-2025.7.22a651.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
95
|
+
sapiopycommons-2025.7.22a651.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
96
|
+
sapiopycommons-2025.7.22a651.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.7.22a645.dist-info → sapiopycommons-2025.7.22a651.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|