sapiopycommons 2025.4.25a496__py3-none-any.whl → 2025.4.25a497__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.

@@ -483,7 +483,7 @@ class ToolBase(ABC):
483
483
 
484
484
  :param message: The message to log.
485
485
  """
486
- self.logs.append(message)
486
+ self.logs.append(f"{self.name}: {message}")
487
487
 
488
488
  @abstractmethod
489
489
  def run(self, user: SapioUser, request: ProcessStepRequest, context: ServicerContext) -> list[SapioToolResult]:
@@ -530,8 +530,7 @@ class ToolBase(ABC):
530
530
  ret_val.append(value)
531
531
  return ret_val
532
532
 
533
- @staticmethod
534
- def get_config_fields(request: ProcessStepRequest) -> dict[str, Any]:
533
+ def get_config_fields(self, request: ProcessStepRequest) -> dict[str, Any]:
535
534
  """
536
535
  Get the configuration fields from the request object.
537
536
 
@@ -539,14 +538,19 @@ class ToolBase(ABC):
539
538
  :return: A dictionary of configuration field names and their values.
540
539
  """
541
540
  config_fields: dict[str, Any] = {}
541
+ # noinspection PyUnresolvedReferences,PyTypeChecker
542
+ field_defs: dict[str, VeloxFieldDefProto] = {x.data_field_name: x for x in self.to_proto().config_fields}
542
543
  for field, value in request.config_field_values.items():
543
- if value.bool_value is not None:
544
+ if field not in field_defs:
545
+ continue
546
+ field_type: FieldTypeProto = field_defs[field].data_field_type
547
+ if field_type == FieldTypeProto.BOOLEAN:
544
548
  value = value.bool_value
545
- elif value.string_value is not None:
546
- value = value.string_value
547
- elif value.int_value is not None:
548
- value = value.int_value
549
- elif value.double_value is not None:
549
+ elif field_type == FieldTypeProto.DOUBLE:
550
550
  value = value.double_value
551
+ elif field_type in [FieldTypeProto.INTEGER, FieldTypeProto.SHORT, FieldTypeProto.LONG, FieldTypeProto.ENUM]:
552
+ value = value.int_value
553
+ else:
554
+ value = value.string_value
551
555
  config_fields[field] = value
552
556
  return config_fields
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sapiopycommons
3
- Version: 2025.4.25a496
3
+ Version: 2025.4.25a497
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/tool_of_tools.py,sha256=zYmQ4rNX-qYQnc-vNDnYZjtv9JgmQAmVVuHfVOdBF3w,46984
4
- sapiopycommons/ai/tool_service_base.py,sha256=1SwXGsqT4ju3qpEQObNU7FWkAjxBlu4Ctxt7dcu9-JQ,22052
4
+ sapiopycommons/ai/tool_service_base.py,sha256=cjsIOP__P4rxE2sxacnpkMLjevj3kbcueibrLy_03p0,22429
5
5
  sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2.py,sha256=qPkyQsREtTLMliV9JB6tC5-NhmdWVWHJr70XNfcAfDI,20605
6
6
  sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2.pyi,sha256=gVXRsuscx9XavKsTcepzXWf0LDAAyQ_J5ZjFK6kPYuo,34028
7
7
  sapiopycommons/ai/api/fielddefinitions/proto/velox_field_def_pb2_grpc.py,sha256=4vD4jWanaJ4uclSkFmS7JIz_lwYXDWBE3DomuPjUyII,941
@@ -82,7 +82,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
82
82
  sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
83
83
  sapiopycommons/webhook/webhook_handlers.py,sha256=L0HetSm43NvA5KyW3xbLpGFh2DbAaeZJVtXIEl2fvV8,39689
84
84
  sapiopycommons/webhook/webservice_handlers.py,sha256=Y5dHx_UFWFuSqaoPL6Re-fsKYRuxvCWZ8bj6KSZ3jfM,14285
85
- sapiopycommons-2025.4.25a496.dist-info/METADATA,sha256=OP1zX7iUcVnA1H5hQFt5yD_ldzTXOsYZi400tQQWNsU,3143
86
- sapiopycommons-2025.4.25a496.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
87
- sapiopycommons-2025.4.25a496.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
88
- sapiopycommons-2025.4.25a496.dist-info/RECORD,,
85
+ sapiopycommons-2025.4.25a497.dist-info/METADATA,sha256=4XZ3Yv1xvJqHu2CpKTQDjfki9Du6aFq5xuPcyMih3xo,3143
86
+ sapiopycommons-2025.4.25a497.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
87
+ sapiopycommons-2025.4.25a497.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
88
+ sapiopycommons-2025.4.25a497.dist-info/RECORD,,