sapiopycommons 2025.7.22a638__py3-none-any.whl → 2025.7.22a645__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 +1 -1
- sapiopycommons/ai/tool_service_base.py +7 -2
- sapiopycommons/webhook/webservice_handlers.py +1 -1
- {sapiopycommons-2025.7.22a638.dist-info → sapiopycommons-2025.7.22a645.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.7.22a638.dist-info → sapiopycommons-2025.7.22a645.dist-info}/RECORD +7 -7
- {sapiopycommons-2025.7.22a638.dist-info → sapiopycommons-2025.7.22a645.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.7.22a638.dist-info → sapiopycommons-2025.7.22a645.dist-info}/licenses/LICENSE +0 -0
sapiopycommons/ai/test_client.py
CHANGED
|
@@ -110,7 +110,7 @@ class TestClient:
|
|
|
110
110
|
self.connection.secret_type = SapioUserSecretTypePbo.PASSWORD
|
|
111
111
|
self.connection.secret = "Basic " + base64.b64encode(f'{user.username}:{user.password}'.encode()).decode()
|
|
112
112
|
else:
|
|
113
|
-
self.connection.secret_type = SapioUserSecretTypePbo.
|
|
113
|
+
self.connection.secret_type = SapioUserSecretTypePbo.SESSION_TOKEN
|
|
114
114
|
self.connection.secret = user.api_token if user and user.api_token else "test_api_token"
|
|
115
115
|
|
|
116
116
|
def add_binary_input(self, input_data: list[bytes]) -> None:
|
|
@@ -252,7 +252,7 @@ class ToolServiceBase(ToolServiceServicer, ABC):
|
|
|
252
252
|
secret: str = info.secret
|
|
253
253
|
if secret.startswith("Basic "):
|
|
254
254
|
secret = secret[6:]
|
|
255
|
-
credentials: list[str] = base64.b64decode(secret).decode().split(":")
|
|
255
|
+
credentials: list[str] = base64.b64decode(secret).decode().split(":", 1)
|
|
256
256
|
user.username = credentials[0]
|
|
257
257
|
user.password = credentials[1]
|
|
258
258
|
case _:
|
|
@@ -301,7 +301,12 @@ class ToolServiceBase(ToolServiceServicer, ABC):
|
|
|
301
301
|
# Setup the tool with details from the request.
|
|
302
302
|
tool.setup(user, request, context)
|
|
303
303
|
# Validate that the provided inputs match the tool's expected inputs.
|
|
304
|
-
|
|
304
|
+
if not request.input:
|
|
305
|
+
msg: str = "No inputs provided to this tool!"
|
|
306
|
+
elif len(request.input) != len(tool.inputs):
|
|
307
|
+
msg: str = f"Expected {len(tool.inputs)} inputs for this tool, but got {len(request.input)} instead."
|
|
308
|
+
else:
|
|
309
|
+
msg: str = tool.validate_input()
|
|
305
310
|
# If there is no error message, then the inputs are valid.
|
|
306
311
|
success: bool = not bool(msg)
|
|
307
312
|
# If this is a dry run, then provide the fixed dry run output.
|
|
@@ -140,7 +140,7 @@ class AbstractWebserviceHandler(AbstractWebhookHandler):
|
|
|
140
140
|
# Get the login credentials from the headers.
|
|
141
141
|
auth: str = headers.get("Authorization")
|
|
142
142
|
if auth and auth.startswith("Basic "):
|
|
143
|
-
credentials: list[str] = b64decode(auth.split("Basic ")[1]).decode().split(":")
|
|
143
|
+
credentials: list[str] = b64decode(auth.split("Basic ")[1]).decode().split(":", 1)
|
|
144
144
|
user = self.basic_auth(url, credentials[0], credentials[1])
|
|
145
145
|
elif auth and auth.startswith("Bearer "):
|
|
146
146
|
user = self.bearer_token_auth(url, auth.split("Bearer ")[1])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.7.
|
|
3
|
+
Version: 2025.7.22a645
|
|
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,8 +1,8 @@
|
|
|
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=
|
|
5
|
-
sapiopycommons/ai/tool_service_base.py,sha256=
|
|
4
|
+
sapiopycommons/ai/test_client.py,sha256=d5P01dUNRKpEgTENZQoIHUvPE0nEut5D9upT5txQWB8,11173
|
|
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
|
|
8
8
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2_grpc.py,sha256=wPImJPdCUZNVEVoUWzsba9kGIXjEKPdUkawP5SnVyiU,932
|
|
@@ -89,8 +89,8 @@ sapiopycommons/sftpconnect/sftp_builder.py,sha256=lFK3FeXk-sFLefW0hqY8WGUQDeYiGa
|
|
|
89
89
|
sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
90
|
sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
|
|
91
91
|
sapiopycommons/webhook/webhook_handlers.py,sha256=7o_wXOruhT9auNh8OfhJAh4WhhiPKij67FMBSpGPICc,39939
|
|
92
|
-
sapiopycommons/webhook/webservice_handlers.py,sha256=
|
|
93
|
-
sapiopycommons-2025.7.
|
|
94
|
-
sapiopycommons-2025.7.
|
|
95
|
-
sapiopycommons-2025.7.
|
|
96
|
-
sapiopycommons-2025.7.
|
|
92
|
+
sapiopycommons/webhook/webservice_handlers.py,sha256=cvW6Mk_110BzYqkbk63Kg7jWrltBCDALOlkJRu8h4VQ,14300
|
|
93
|
+
sapiopycommons-2025.7.22a645.dist-info/METADATA,sha256=3xkEPFb_VlBP8y6_6kkFX3J2HNMmwibStcVQUQs-uCk,3143
|
|
94
|
+
sapiopycommons-2025.7.22a645.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
95
|
+
sapiopycommons-2025.7.22a645.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
96
|
+
sapiopycommons-2025.7.22a645.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.7.22a638.dist-info → sapiopycommons-2025.7.22a645.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|