sapiopycommons 2025.5.12a521__py3-none-any.whl → 2025.5.13a523__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/tool_service_base.py +22 -14
- {sapiopycommons-2025.5.12a521.dist-info → sapiopycommons-2025.5.13a523.dist-info}/METADATA +1 -1
- {sapiopycommons-2025.5.12a521.dist-info → sapiopycommons-2025.5.13a523.dist-info}/RECORD +5 -5
- {sapiopycommons-2025.5.12a521.dist-info → sapiopycommons-2025.5.13a523.dist-info}/WHEEL +0 -0
- {sapiopycommons-2025.5.12a521.dist-info → sapiopycommons-2025.5.13a523.dist-info}/licenses/LICENSE +0 -0
|
@@ -437,8 +437,8 @@ class ToolBase(ABC):
|
|
|
437
437
|
"""
|
|
438
438
|
self.configs.append(ProtobufUtils.field_def_to_pbo(field))
|
|
439
439
|
|
|
440
|
-
def add_boolean_config_field(self, field_name: str, display_name: str, description: str, default_value: bool
|
|
441
|
-
|
|
440
|
+
def add_boolean_config_field(self, field_name: str, display_name: str, description: str, default_value: bool,
|
|
441
|
+
optional: bool = False) -> None:
|
|
442
442
|
"""
|
|
443
443
|
Add a boolean configuration field to the tool. This field will be used to configure the tool in the plan
|
|
444
444
|
manager.
|
|
@@ -447,13 +447,14 @@ class ToolBase(ABC):
|
|
|
447
447
|
:param display_name: The display name of the field.
|
|
448
448
|
:param description: The description of the field.
|
|
449
449
|
:param default_value: The default value of the field.
|
|
450
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
450
451
|
"""
|
|
451
452
|
self.configs.append(VeloxFieldDefPbo(
|
|
452
453
|
data_field_type=FieldTypePbo.BOOLEAN,
|
|
453
454
|
data_field_name=field_name,
|
|
454
455
|
display_name=display_name,
|
|
455
456
|
description=description,
|
|
456
|
-
required=
|
|
457
|
+
required=not optional,
|
|
457
458
|
editable=True,
|
|
458
459
|
boolean_properties=BooleanPropertiesPbo(
|
|
459
460
|
default_value=default_value
|
|
@@ -461,7 +462,8 @@ class ToolBase(ABC):
|
|
|
461
462
|
))
|
|
462
463
|
|
|
463
464
|
def add_double_config_field(self, field_name: str, display_name: str, description: str, default_value: float,
|
|
464
|
-
min_value: float = -10.**120, max_value: float = 10.**120, precision: int = 2
|
|
465
|
+
min_value: float = -10.**120, max_value: float = 10.**120, precision: int = 2,
|
|
466
|
+
optional: bool = False) -> None:
|
|
465
467
|
"""
|
|
466
468
|
Add a double configuration field to the tool. This field will be used to configure the tool in the plan
|
|
467
469
|
manager.
|
|
@@ -473,13 +475,14 @@ class ToolBase(ABC):
|
|
|
473
475
|
:param min_value: The minimum value of the field.
|
|
474
476
|
:param max_value: The maximum value of the field.
|
|
475
477
|
:param precision: The precision of the field.
|
|
478
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
476
479
|
"""
|
|
477
480
|
self.configs.append(VeloxFieldDefPbo(
|
|
478
481
|
data_field_type=FieldTypePbo.DOUBLE,
|
|
479
482
|
data_field_name=field_name,
|
|
480
483
|
display_name=display_name,
|
|
481
484
|
description=description,
|
|
482
|
-
required=
|
|
485
|
+
required=not optional,
|
|
483
486
|
editable=True,
|
|
484
487
|
double_properties=DoublePropertiesPbo(
|
|
485
488
|
default_value=default_value,
|
|
@@ -490,7 +493,8 @@ class ToolBase(ABC):
|
|
|
490
493
|
))
|
|
491
494
|
|
|
492
495
|
def add_integer_config_field(self, field_name: str, display_name: str, description: str,
|
|
493
|
-
default_value: int, min_value: int = -2**31, max_value: int = 2**31-1
|
|
496
|
+
default_value: int, min_value: int = -2**31, max_value: int = 2**31-1,
|
|
497
|
+
optional: bool = False) -> None:
|
|
494
498
|
"""
|
|
495
499
|
Add an integer configuration field to the tool. This field will be used to configure the tool in the plan
|
|
496
500
|
manager.
|
|
@@ -501,13 +505,14 @@ class ToolBase(ABC):
|
|
|
501
505
|
:param default_value: The default value of the field.
|
|
502
506
|
:param min_value: The minimum value of the field.
|
|
503
507
|
:param max_value: The maximum value of the field.
|
|
508
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
504
509
|
"""
|
|
505
510
|
self.configs.append(VeloxFieldDefPbo(
|
|
506
511
|
data_field_type=FieldTypePbo.INTEGER,
|
|
507
512
|
data_field_name=field_name,
|
|
508
513
|
display_name=display_name,
|
|
509
514
|
description=description,
|
|
510
|
-
required=
|
|
515
|
+
required=not optional,
|
|
511
516
|
editable=True,
|
|
512
517
|
integer_properties=IntegerPropertiesPbo(
|
|
513
518
|
default_value=default_value,
|
|
@@ -517,7 +522,7 @@ class ToolBase(ABC):
|
|
|
517
522
|
))
|
|
518
523
|
|
|
519
524
|
def add_string_config_field(self, field_name: str, display_name: str, description: str,
|
|
520
|
-
default_value: str, max_length: int = 1000) -> None:
|
|
525
|
+
default_value: str, max_length: int = 1000, optional: bool = False) -> None:
|
|
521
526
|
"""
|
|
522
527
|
Add a string configuration field to the tool. This field will be used to configure the tool in the plan
|
|
523
528
|
manager.
|
|
@@ -527,13 +532,14 @@ class ToolBase(ABC):
|
|
|
527
532
|
:param description: The description of the field.
|
|
528
533
|
:param default_value: The default value of the field.
|
|
529
534
|
:param max_length: The maximum length of the field.
|
|
535
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
530
536
|
"""
|
|
531
537
|
self.configs.append(VeloxFieldDefPbo(
|
|
532
538
|
data_field_type=FieldTypePbo.STRING,
|
|
533
539
|
data_field_name=field_name,
|
|
534
540
|
display_name=display_name,
|
|
535
541
|
description=description,
|
|
536
|
-
required=
|
|
542
|
+
required=not optional,
|
|
537
543
|
editable=True,
|
|
538
544
|
string_properties=StringPropertiesPbo(
|
|
539
545
|
default_value=default_value,
|
|
@@ -542,7 +548,7 @@ class ToolBase(ABC):
|
|
|
542
548
|
))
|
|
543
549
|
|
|
544
550
|
def add_list_config_field(self, field_name: str, display_name: str, description: str, default_value: str,
|
|
545
|
-
allowed_values: list[str], direct_edit: bool = False) -> None:
|
|
551
|
+
allowed_values: list[str], direct_edit: bool = False, optional: bool = False) -> None:
|
|
546
552
|
"""
|
|
547
553
|
Add a list configuration field to the tool. This field will be used to configure the tool in the plan
|
|
548
554
|
manager.
|
|
@@ -554,13 +560,14 @@ class ToolBase(ABC):
|
|
|
554
560
|
:param allowed_values: The list of allowed values for the field.
|
|
555
561
|
:param direct_edit: If true, the user can enter a value that is not in the list of allowed values. If false,
|
|
556
562
|
the user can only select from the list of allowed values.
|
|
563
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
557
564
|
"""
|
|
558
565
|
self.configs.append(VeloxFieldDefPbo(
|
|
559
566
|
data_field_type=FieldTypePbo.SELECTION,
|
|
560
567
|
data_field_name=field_name,
|
|
561
568
|
display_name=display_name,
|
|
562
569
|
description=description,
|
|
563
|
-
required=
|
|
570
|
+
required=not optional,
|
|
564
571
|
editable=True,
|
|
565
572
|
selection_properties=SelectionPropertiesPbo(
|
|
566
573
|
default_value=default_value,
|
|
@@ -570,8 +577,8 @@ class ToolBase(ABC):
|
|
|
570
577
|
))
|
|
571
578
|
|
|
572
579
|
def add_multi_list_config_field(self, field_name: str, display_name: str, description: str,
|
|
573
|
-
default_value: list[str], allowed_values: list[str], direct_edit: bool = False
|
|
574
|
-
|
|
580
|
+
default_value: list[str], allowed_values: list[str], direct_edit: bool = False,
|
|
581
|
+
optional: bool = False) -> None:
|
|
575
582
|
"""
|
|
576
583
|
Add a multi-select list configuration field to the tool. This field will be used to configure the tool in the
|
|
577
584
|
plan manager.
|
|
@@ -583,13 +590,14 @@ class ToolBase(ABC):
|
|
|
583
590
|
:param allowed_values: The list of allowed values for the field.
|
|
584
591
|
:param direct_edit: If true, the user can enter a value that is not in the list of allowed values. If false,
|
|
585
592
|
the user can only select from the list of allowed values.
|
|
593
|
+
:param optional: If true, this field is optional. If false, this field is required.
|
|
586
594
|
"""
|
|
587
595
|
self.configs.append(VeloxFieldDefPbo(
|
|
588
596
|
data_field_type=FieldTypePbo.SELECTION,
|
|
589
597
|
data_field_name=field_name,
|
|
590
598
|
display_name=display_name,
|
|
591
599
|
description=description,
|
|
592
|
-
required=
|
|
600
|
+
required=not optional,
|
|
593
601
|
editable=True,
|
|
594
602
|
selection_properties=SelectionPropertiesPbo(
|
|
595
603
|
default_value=",".join(default_value),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.5.
|
|
3
|
+
Version: 2025.5.13a523
|
|
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=aKmZtNLrrzUe_LFsdW0zYpG4VI-ZGgukyXVDFtIqfes,22656
|
|
4
|
-
sapiopycommons/ai/tool_service_base.py,sha256=
|
|
4
|
+
sapiopycommons/ai/tool_service_base.py,sha256=adsC1kesRZJGdUmvcp1KrXgQ1RuLE7OMnPwRUsaP8DM,34578
|
|
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.5.
|
|
89
|
-
sapiopycommons-2025.5.
|
|
90
|
-
sapiopycommons-2025.5.
|
|
91
|
-
sapiopycommons-2025.5.
|
|
88
|
+
sapiopycommons-2025.5.13a523.dist-info/METADATA,sha256=QqPGY0nDOqra3OvNj_CbyA5SNwYfSzf8DOZm1HbjPfo,3143
|
|
89
|
+
sapiopycommons-2025.5.13a523.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
90
|
+
sapiopycommons-2025.5.13a523.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
91
|
+
sapiopycommons-2025.5.13a523.dist-info/RECORD,,
|
|
File without changes
|
{sapiopycommons-2025.5.12a521.dist-info → sapiopycommons-2025.5.13a523.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|