sapiopycommons 2025.7.1a576__py3-none-any.whl → 2025.7.2a578__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 +35 -0
- {sapiopycommons-2025.7.1a576.dist-info → sapiopycommons-2025.7.2a578.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.7.1a576.dist-info → sapiopycommons-2025.7.2a578.dist-info}/RECORD +5 -5
- {sapiopycommons-2025.7.1a576.dist-info → sapiopycommons-2025.7.2a578.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.7.1a576.dist-info → sapiopycommons-2025.7.2a578.dist-info}/licenses/LICENSE +0 -0
sapiopycommons/ai/test_client.py
CHANGED
|
@@ -79,6 +79,7 @@ class TestClient:
|
|
|
79
79
|
server_url: str
|
|
80
80
|
connection: SapioConnectionInfoPbo
|
|
81
81
|
_request_inputs: list[Any]
|
|
82
|
+
_config_fields: dict[str, Any]
|
|
82
83
|
|
|
83
84
|
def __init__(self, server_url: str):
|
|
84
85
|
"""
|
|
@@ -87,6 +88,7 @@ class TestClient:
|
|
|
87
88
|
self.create_user()
|
|
88
89
|
self.server_url = server_url
|
|
89
90
|
self._request_inputs = []
|
|
91
|
+
self._config_fields = {}
|
|
90
92
|
|
|
91
93
|
def create_user(self):
|
|
92
94
|
"""
|
|
@@ -143,6 +145,38 @@ class TestClient:
|
|
|
143
145
|
"""
|
|
144
146
|
self._request_inputs.clear()
|
|
145
147
|
|
|
148
|
+
def add_config_field(self, field_name: str, value: Any) -> None:
|
|
149
|
+
"""
|
|
150
|
+
Add a configuration field value to the next request.
|
|
151
|
+
|
|
152
|
+
:param field_name: The name of the configuration field.
|
|
153
|
+
:param value: The value to set for the configuration field.
|
|
154
|
+
"""
|
|
155
|
+
self._config_fields[field_name] = value
|
|
156
|
+
|
|
157
|
+
def add_config_fields(self, config_fields: dict[str, Any]) -> None:
|
|
158
|
+
"""
|
|
159
|
+
Add multiple configuration field values to the next request.
|
|
160
|
+
|
|
161
|
+
:param config_fields: A dictionary of configuration field names and their corresponding values.
|
|
162
|
+
"""
|
|
163
|
+
self._config_fields.update(config_fields)
|
|
164
|
+
|
|
165
|
+
def clear_configs(self) -> None:
|
|
166
|
+
"""
|
|
167
|
+
Clear all configuration field values that have been added to the next request.
|
|
168
|
+
This is useful if you want to start a new request without the previous configurations.
|
|
169
|
+
"""
|
|
170
|
+
self._config_fields.clear()
|
|
171
|
+
|
|
172
|
+
def clear_request(self) -> None:
|
|
173
|
+
"""
|
|
174
|
+
Clear all inputs and configuration fields that have been added to the next request.
|
|
175
|
+
This is useful if you want to start a new request without the previous inputs and configurations.
|
|
176
|
+
"""
|
|
177
|
+
self.clear_inputs()
|
|
178
|
+
self.clear_configs()
|
|
179
|
+
|
|
146
180
|
def _add_input(self, data_type: DataTypePbo, items: Any) -> None:
|
|
147
181
|
"""
|
|
148
182
|
Helper method for adding inputs to the next request.
|
|
@@ -187,6 +221,7 @@ class TestClient:
|
|
|
187
221
|
ProcessStepRequestPbo(
|
|
188
222
|
sapio_user=self.connection,
|
|
189
223
|
tool_name=tool_name,
|
|
224
|
+
config_field_values=self._config_fields,
|
|
190
225
|
input=[
|
|
191
226
|
StepInputBatchPbo(is_partial=False, item_container=item)
|
|
192
227
|
for item in self._request_inputs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.7.
|
|
3
|
+
Version: 2025.7.2a578
|
|
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=5Y0z_lRVipbHPJcHJf9GosK-ZjAh_I2JI3QwV8iyfKg,24884
|
|
4
|
-
sapiopycommons/ai/test_client.py,sha256=
|
|
4
|
+
sapiopycommons/ai/test_client.py,sha256=8AlRTuy7XUC40aU4SgTQkNc_ZBp_ANhVNEKbUx8ABRM,10430
|
|
5
5
|
sapiopycommons/ai/tool_service_base.py,sha256=8it0853p-kw3Y1SdEyEfmxCbxM3_poUTJKFUaZ5MrCQ,35366
|
|
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
|
|
@@ -86,7 +86,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
86
86
|
sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
|
|
87
87
|
sapiopycommons/webhook/webhook_handlers.py,sha256=L0HetSm43NvA5KyW3xbLpGFh2DbAaeZJVtXIEl2fvV8,39689
|
|
88
88
|
sapiopycommons/webhook/webservice_handlers.py,sha256=Y5dHx_UFWFuSqaoPL6Re-fsKYRuxvCWZ8bj6KSZ3jfM,14285
|
|
89
|
-
sapiopycommons-2025.7.
|
|
90
|
-
sapiopycommons-2025.7.
|
|
91
|
-
sapiopycommons-2025.7.
|
|
92
|
-
sapiopycommons-2025.7.
|
|
89
|
+
sapiopycommons-2025.7.2a578.dist-info/METADATA,sha256=GpEG5F8HYtYMzQaNR4RWRLc1N_9zcrIjKocgk8Oe6PU,3142
|
|
90
|
+
sapiopycommons-2025.7.2a578.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
91
|
+
sapiopycommons-2025.7.2a578.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
92
|
+
sapiopycommons-2025.7.2a578.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.7.1a576.dist-info → sapiopycommons-2025.7.2a578.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|