sapiopycommons 2025.4.30a502__py3-none-any.whl → 2025.5.2a504__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/protobuf_utils.py +4 -2
- sapiopycommons/ai/tool_service_base.py +26 -0
- {sapiopycommons-2025.4.30a502.dist-info → sapiopycommons-2025.5.2a504.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.4.30a502.dist-info → sapiopycommons-2025.5.2a504.dist-info}/RECORD +6 -6
- {sapiopycommons-2025.4.30a502.dist-info → sapiopycommons-2025.5.2a504.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.4.30a502.dist-info → sapiopycommons-2025.5.2a504.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
1
3
|
from sapiopylib.rest.pojo.Sort import SortDirection
|
|
2
4
|
from sapiopylib.rest.pojo.datatype.FieldDefinition import AbstractVeloxFieldDefinition, FieldType, \
|
|
3
5
|
VeloxBooleanFieldDefinition, VeloxDateFieldDefinition, VeloxAccessionFieldDefinition, VeloxActionFieldDefinition, \
|
|
@@ -432,7 +434,7 @@ class ProtobufUtils:
|
|
|
432
434
|
)
|
|
433
435
|
|
|
434
436
|
@staticmethod
|
|
435
|
-
def field_pbo_to_value(field:
|
|
437
|
+
def field_pbo_to_value(field: Any, value: FieldValuePbo) -> FieldValue:
|
|
436
438
|
"""
|
|
437
439
|
Convert a StepRecordFieldValue to its corresponding Python value based on the field type.
|
|
438
440
|
|
|
@@ -440,7 +442,7 @@ class ProtobufUtils:
|
|
|
440
442
|
:param value: The StepRecordFieldValue object.
|
|
441
443
|
:return: The corresponding Python value.
|
|
442
444
|
"""
|
|
443
|
-
field_type = field.data_field_type if
|
|
445
|
+
field_type = field.data_field_type if hasattr(field, "data_field_type") else field
|
|
444
446
|
match field_type:
|
|
445
447
|
case FieldTypePbo.BOOLEAN:
|
|
446
448
|
return value.bool_value
|
|
@@ -536,6 +536,32 @@ class ToolBase(ABC):
|
|
|
536
536
|
)
|
|
537
537
|
))
|
|
538
538
|
|
|
539
|
+
def add_multi_list_config_field(self, field_name: str, display_name: str, description: str,
|
|
540
|
+
default_value: list[str], allowed_values: list[str]) -> None:
|
|
541
|
+
"""
|
|
542
|
+
Add a multi-select list configuration field to the tool. This field will be used to configure the tool in the
|
|
543
|
+
plan manager.
|
|
544
|
+
|
|
545
|
+
:param field_name: The name of the field.
|
|
546
|
+
:param display_name: The display name of the field.
|
|
547
|
+
:param description: The description of the field.
|
|
548
|
+
:param default_value: The default value of the field.
|
|
549
|
+
:param allowed_values: The list of allowed values for the field.
|
|
550
|
+
"""
|
|
551
|
+
self.configs.append(VeloxFieldDefPbo(
|
|
552
|
+
data_field_type=FieldTypePbo.SELECTION,
|
|
553
|
+
data_field_name=field_name,
|
|
554
|
+
display_name=display_name,
|
|
555
|
+
description=description,
|
|
556
|
+
required=True,
|
|
557
|
+
editable=True,
|
|
558
|
+
selection_properties=SelectionPropertiesPbo(
|
|
559
|
+
default_value=",".join(default_value),
|
|
560
|
+
static_list_values=allowed_values,
|
|
561
|
+
multi_select=True,
|
|
562
|
+
)
|
|
563
|
+
))
|
|
564
|
+
|
|
539
565
|
def to_pbo(self) -> ToolDetailsPbo:
|
|
540
566
|
"""
|
|
541
567
|
:return: The ToolDetailsPbo proto object representing this tool.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.5.2a504
|
|
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
|
-
sapiopycommons/ai/protobuf_utils.py,sha256=
|
|
4
|
-
sapiopycommons/ai/tool_service_base.py,sha256=
|
|
3
|
+
sapiopycommons/ai/protobuf_utils.py,sha256=XVHbtljuhSRVfiBpFZEBkVHdW6plCo3mbXS11Sw_DT0,22653
|
|
4
|
+
sapiopycommons/ai/tool_service_base.py,sha256=k52J8wyiWvlHiNZYqRMdJ5Uo1F4x9xjjz7pVFpU8U3k,30905
|
|
5
5
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.py,sha256=YcZjb_YM-XeLErM8hEC_S7vGMVGvcXAMGs2b-u5zvOE,2377
|
|
6
6
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2.pyi,sha256=FwtXmNAf7iYGEFm4kbqb04v77jNHbZg18ZmEDhle_bU,1444
|
|
7
7
|
sapiopycommons/ai/api/fielddefinitions/proto/fields_pb2_grpc.py,sha256=wPImJPdCUZNVEVoUWzsba9kGIXjEKPdUkawP5SnVyiU,932
|
|
@@ -85,7 +85,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
85
85
|
sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
|
|
86
86
|
sapiopycommons/webhook/webhook_handlers.py,sha256=L0HetSm43NvA5KyW3xbLpGFh2DbAaeZJVtXIEl2fvV8,39689
|
|
87
87
|
sapiopycommons/webhook/webservice_handlers.py,sha256=Y5dHx_UFWFuSqaoPL6Re-fsKYRuxvCWZ8bj6KSZ3jfM,14285
|
|
88
|
-
sapiopycommons-2025.
|
|
89
|
-
sapiopycommons-2025.
|
|
90
|
-
sapiopycommons-2025.
|
|
91
|
-
sapiopycommons-2025.
|
|
88
|
+
sapiopycommons-2025.5.2a504.dist-info/METADATA,sha256=6oj0oQLLCzxQkyLZa2jGXsAzsOjI8PJu8IbiB1iqx8U,3142
|
|
89
|
+
sapiopycommons-2025.5.2a504.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
90
|
+
sapiopycommons-2025.5.2a504.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
91
|
+
sapiopycommons-2025.5.2a504.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.4.30a502.dist-info → sapiopycommons-2025.5.2a504.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|