sapiopycommons 2025.10.20a789__tar.gz → 2025.10.21a792__tar.gz
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-2025.10.20a789 → sapiopycommons-2025.10.21a792}/PKG-INFO +1 -1
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/pyproject.toml +1 -1
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/agent_service_base.py +98 -32
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/.gitignore +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/LICENSE +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/README.md +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/converter_service_base.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/external_credentials.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/step_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/protobuf_utils.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/request_validation.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/server.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/test_client.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/callbacks/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/callbacks/callback_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/callbacks/field_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/chem/IndigoMolecules.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/chem/Molecules.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/chem/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/customreport/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/customreport/auto_pagers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/customreport/column_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/customreport/custom_report_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/customreport/term_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/datatype/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/datatype/attachment_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/datatype/data_fields.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/datatype/pseudo_data_types.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/experiment_cache.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/experiment_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/experiment_report_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/experiment_step_factory.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/experiment_tags.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/plate_designer.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/step_creation.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/assay_plate_reader.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/complex_data_loader.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_bridge.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_bridge_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_data_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_text_converter.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_validator.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/file_writer.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/temp_files.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/flowcyto/flow_cyto.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/flowcyto/flowcyto_data.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/accession_service.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/aliases.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/audit_log.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/custom_report_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/data_structure_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/directive_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/exceptions.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/html_formatter.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/popup_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/sapio_links.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/storage_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/general/time_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/multimodal/multimodal.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/multimodal/multimodal_data.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/processtracking/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/processtracking/custom_workflow_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/processtracking/endpoints.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/recordmodel/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/recordmodel/record_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/rules/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/rules/eln_rule_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/rules/on_save_rule_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/samples/aliquot.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/sftpconnect/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/sftpconnect/sftp_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/webhook/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/webhook/webhook_context.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/webhook/webhook_handlers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/webhook/webservice_handlers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/AF-A0A009IHW8-F1-model_v4.cif +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/_do_not_add_init_py_here +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/accession_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/aliquot_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/assay_plate_reader/BMGLabtech96.txt +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/assay_plate_reader/assay_plate_processing_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/bio_reg_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/chem_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/chem_test_curation_queue.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/curation_queue_test.sdf +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/data_type_models.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/file_compression_tests.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/flowcyto/8_color_ICS.wsp +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/flowcyto_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/kappa.chains.fasta +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/mafft_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/test.gb +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sapiopycommons
|
|
3
|
-
Version: 2025.10.
|
|
3
|
+
Version: 2025.10.21a792
|
|
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>
|
|
@@ -336,9 +336,9 @@ class AgentServiceBase(ToolServiceServicer, ABC):
|
|
|
336
336
|
|
|
337
337
|
# Instantiate the agent class.
|
|
338
338
|
agent: AgentBase = registered_agents[find_agent]()
|
|
339
|
+
# Setup the agent with details from the request.
|
|
340
|
+
agent.setup(user, request, context, self.debug_mode)
|
|
339
341
|
try:
|
|
340
|
-
# Setup the agent with details from the request.
|
|
341
|
-
agent.setup(user, request, context, self.debug_mode)
|
|
342
342
|
# Validate that the provided inputs match the agent's expected inputs.
|
|
343
343
|
msg: str = ""
|
|
344
344
|
if len(request.input) != len(agent.input_configs):
|
|
@@ -387,14 +387,52 @@ class AgentBase(ABC):
|
|
|
387
387
|
|
|
388
388
|
logs: list[str]
|
|
389
389
|
logger: Logger
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
390
|
+
_verbose_logging: bool | None = None
|
|
391
|
+
|
|
392
|
+
_temp_data: TempFileHandler | None = None
|
|
393
|
+
|
|
394
|
+
_user: SapioUser | None = None
|
|
395
|
+
_request: ProcessStepRequestPbo | None = None
|
|
396
|
+
_context: ServicerContext | None = None
|
|
397
|
+
_debug_mode: bool | None = None
|
|
398
|
+
|
|
399
|
+
__is_setup: bool
|
|
400
|
+
|
|
401
|
+
@property
|
|
402
|
+
def verbose_logging(self) -> bool:
|
|
403
|
+
if not self.__is_setup:
|
|
404
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
405
|
+
return self._verbose_logging
|
|
406
|
+
|
|
407
|
+
@property
|
|
408
|
+
def temp_data(self) -> TempFileHandler:
|
|
409
|
+
if not self.__is_setup:
|
|
410
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
411
|
+
return self._temp_data
|
|
412
|
+
|
|
413
|
+
@property
|
|
414
|
+
def user(self) -> SapioUser:
|
|
415
|
+
if not self.__is_setup:
|
|
416
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
417
|
+
return self._user
|
|
418
|
+
|
|
419
|
+
@property
|
|
420
|
+
def request(self) -> ProcessStepRequestPbo:
|
|
421
|
+
if not self.__is_setup:
|
|
422
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
423
|
+
return self._request
|
|
424
|
+
|
|
425
|
+
@property
|
|
426
|
+
def context(self) -> ServicerContext:
|
|
427
|
+
if not self.__is_setup:
|
|
428
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
429
|
+
return self._context
|
|
430
|
+
|
|
431
|
+
@property
|
|
432
|
+
def debug_mode(self) -> bool:
|
|
433
|
+
if not self.__is_setup:
|
|
434
|
+
raise Exception("Agent must be set up to respond to a request before accessing this property.")
|
|
435
|
+
return self._debug_mode
|
|
398
436
|
|
|
399
437
|
@classmethod
|
|
400
438
|
@abstractmethod
|
|
@@ -455,12 +493,12 @@ class AgentBase(ABC):
|
|
|
455
493
|
return None
|
|
456
494
|
|
|
457
495
|
def __init__(self):
|
|
496
|
+
self.__is_setup = False
|
|
458
497
|
self.input_configs = []
|
|
459
498
|
self.input_container_types = []
|
|
460
499
|
self.output_configs = []
|
|
461
500
|
self.output_container_types = []
|
|
462
501
|
self.config_fields = []
|
|
463
|
-
self.temp_data = TempFileHandler()
|
|
464
502
|
self.logs = []
|
|
465
503
|
self.logger = logging.getLogger(f"AgentBase.{self.name()}")
|
|
466
504
|
ensure_logger_initialized(self.logger)
|
|
@@ -477,11 +515,13 @@ class AgentBase(ABC):
|
|
|
477
515
|
:param debug_mode: If true, the agent should run in debug mode, providing additional logging and not cleaning
|
|
478
516
|
up temporary files.
|
|
479
517
|
"""
|
|
480
|
-
self.
|
|
481
|
-
self.
|
|
482
|
-
self.
|
|
483
|
-
self.
|
|
484
|
-
self.
|
|
518
|
+
self.__is_setup = True
|
|
519
|
+
self._user = user
|
|
520
|
+
self._request = request
|
|
521
|
+
self._context = context
|
|
522
|
+
self._verbose_logging = request.verbose_logging
|
|
523
|
+
self._debug_mode = debug_mode
|
|
524
|
+
self._temp_data = TempFileHandler()
|
|
485
525
|
|
|
486
526
|
def add_input(self, container_type: ContainerType, content_type: str, display_name: str, description: str,
|
|
487
527
|
structure_example: str | bytes | None = None, validation: str | None = None,
|
|
@@ -939,35 +979,32 @@ class AgentBase(ABC):
|
|
|
939
979
|
"""
|
|
940
980
|
pass
|
|
941
981
|
|
|
942
|
-
def get_credentials(self,
|
|
982
|
+
def get_credentials(self, name: str | None = None, category: str | None = None) -> ExternalCredentials:
|
|
943
983
|
"""
|
|
944
984
|
Get credentials for the given category and host.
|
|
945
985
|
|
|
986
|
+
:param name: The host name of the credentials to retrieve.
|
|
946
987
|
:param category: The category of the credentials to retrieve.
|
|
947
|
-
:param host: The host for which to retrieve the credentials.
|
|
948
988
|
:return: An ExternalCredentials object containing the credentials for the given category and host.
|
|
949
989
|
"""
|
|
990
|
+
if not self.__is_setup:
|
|
991
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
950
992
|
# Remove leading/trailing whitespace
|
|
993
|
+
name = name.strip() if name else None
|
|
951
994
|
category = category.strip() if category else None
|
|
952
|
-
host = host.strip() if host else None
|
|
953
995
|
|
|
954
996
|
matching_creds: list[ExternalCredentialsPbo] = []
|
|
955
997
|
for cred in self.request.external_credential:
|
|
956
998
|
# Do case insensitive comparison
|
|
999
|
+
if name and cred.display_name.lower != name.lower():
|
|
1000
|
+
continue
|
|
957
1001
|
if category and cred.category.lower() != category.lower():
|
|
958
1002
|
continue
|
|
959
|
-
if host:
|
|
960
|
-
# Parse the URL to get the host and compare
|
|
961
|
-
from urllib.parse import urlparse
|
|
962
|
-
parsed_url = urlparse(cred.url)
|
|
963
|
-
if parsed_url.hostname is None or parsed_url.hostname.lower() != host.lower():
|
|
964
|
-
continue
|
|
965
|
-
|
|
966
1003
|
matching_creds.append(cred)
|
|
967
1004
|
if len(matching_creds) == 0:
|
|
968
|
-
raise ValueError(f"No credentials found for
|
|
1005
|
+
raise ValueError(f"No credentials found for name '{name}' and category '{category}'.")
|
|
969
1006
|
if len(matching_creds) > 1:
|
|
970
|
-
raise ValueError(f"Multiple credentials found for
|
|
1007
|
+
raise ValueError(f"Multiple credentials found for name '{name}' and category '{category}'.")
|
|
971
1008
|
|
|
972
1009
|
return ExternalCredentials.from_pbo(matching_creds[0])
|
|
973
1010
|
|
|
@@ -978,6 +1015,8 @@ class AgentBase(ABC):
|
|
|
978
1015
|
:param value: The value of the credentials config field.
|
|
979
1016
|
:return: An ExternalCredentials object containing the credentials.
|
|
980
1017
|
"""
|
|
1018
|
+
if not self.__is_setup:
|
|
1019
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
981
1020
|
# Values should be of the format "Name (Identifier)"
|
|
982
1021
|
match = re.match(r"^(.*) \((.*)\)$", value)
|
|
983
1022
|
if not match:
|
|
@@ -1004,23 +1043,34 @@ class AgentBase(ABC):
|
|
|
1004
1043
|
"""
|
|
1005
1044
|
try:
|
|
1006
1045
|
self.log_info(f"Running subprocess with command: {' '.join(args)}")
|
|
1007
|
-
|
|
1046
|
+
p: CompletedProcess[str] = subprocess.run(args, check=True, capture_output=True, text=True, cwd=cwd,
|
|
1047
|
+
**kwargs)
|
|
1048
|
+
if p.stdout:
|
|
1049
|
+
self.log_info(f"STDOUT: {p.stdout}")
|
|
1050
|
+
if p.stderr:
|
|
1051
|
+
self.log_info(f"STDERR: {p.stderr}")
|
|
1052
|
+
return p
|
|
1008
1053
|
except subprocess.CalledProcessError as e:
|
|
1009
1054
|
self.log_error(f"Error running subprocess. Return code: {e.returncode}")
|
|
1010
|
-
|
|
1011
|
-
|
|
1055
|
+
if e.stdout:
|
|
1056
|
+
self.log_error(f"STDOUT: {e.stdout}")
|
|
1057
|
+
if e.stderr:
|
|
1058
|
+
self.log_error(f"STDERR: {e.stderr}")
|
|
1012
1059
|
raise
|
|
1013
1060
|
|
|
1014
1061
|
def log_info(self, message: str) -> None:
|
|
1015
1062
|
"""
|
|
1016
1063
|
Log an info message for this agent. If verbose logging is enabled, this message will be included in the logs
|
|
1017
1064
|
returned to the caller. Empty/None inputs will not be logged.
|
|
1065
|
+
|
|
1066
|
+
Logging info can be done during initialization, but those logs will not be returned to the caller. Other
|
|
1067
|
+
log calls will be returned to the caller, even if done during initialization.
|
|
1018
1068
|
|
|
1019
1069
|
:param message: The message to log.
|
|
1020
1070
|
"""
|
|
1021
1071
|
if not message:
|
|
1022
1072
|
return
|
|
1023
|
-
if self.verbose_logging:
|
|
1073
|
+
if self.__is_setup and self.verbose_logging:
|
|
1024
1074
|
self.logs.append(f"INFO: {self.name()}: {message}")
|
|
1025
1075
|
self.logger.info(message)
|
|
1026
1076
|
|
|
@@ -1068,6 +1118,8 @@ class AgentBase(ABC):
|
|
|
1068
1118
|
:param index: The index of the input to check. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1069
1119
|
:return: True if the input is marked as partial, False otherwise.
|
|
1070
1120
|
"""
|
|
1121
|
+
if not self.__is_setup:
|
|
1122
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1071
1123
|
return self.request.input[index].is_partial
|
|
1072
1124
|
|
|
1073
1125
|
def get_input_name(self, index: int = 0) -> str | None:
|
|
@@ -1077,6 +1129,8 @@ class AgentBase(ABC):
|
|
|
1077
1129
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1078
1130
|
:return: The name of the input from the request object, or None if no name is set.
|
|
1079
1131
|
"""
|
|
1132
|
+
if not self.__is_setup:
|
|
1133
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1080
1134
|
return self.request.input[index].item_container.container_name
|
|
1081
1135
|
|
|
1082
1136
|
def get_input_content_type(self, index: int = 0) -> ContentTypePbo:
|
|
@@ -1086,6 +1140,8 @@ class AgentBase(ABC):
|
|
|
1086
1140
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1087
1141
|
:return: The content type of the input from the request object.
|
|
1088
1142
|
"""
|
|
1143
|
+
if not self.__is_setup:
|
|
1144
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1089
1145
|
return self.request.input[index].item_container.content_type
|
|
1090
1146
|
|
|
1091
1147
|
def get_input_binary(self, index: int = 0) -> list[bytes]:
|
|
@@ -1095,6 +1151,8 @@ class AgentBase(ABC):
|
|
|
1095
1151
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1096
1152
|
:return: The binary data from the request object.
|
|
1097
1153
|
"""
|
|
1154
|
+
if not self.__is_setup:
|
|
1155
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1098
1156
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1099
1157
|
if not container.HasField("binary_container"):
|
|
1100
1158
|
raise Exception(f"Input {index} does not contain a binary container.")
|
|
@@ -1109,6 +1167,8 @@ class AgentBase(ABC):
|
|
|
1109
1167
|
the column names, and the data rows are a list of dictionaries where each dictionary represents a row in the
|
|
1110
1168
|
CSV with the column names as keys and the corresponding values as strings.
|
|
1111
1169
|
"""
|
|
1170
|
+
if not self.__is_setup:
|
|
1171
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1112
1172
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1113
1173
|
if not container.HasField("csv_container"):
|
|
1114
1174
|
raise Exception(f"Input {index} does not contain a CSV container.")
|
|
@@ -1128,6 +1188,8 @@ class AgentBase(ABC):
|
|
|
1128
1188
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1129
1189
|
:return: A list of parsed JSON objects, which are represented as dictionaries.
|
|
1130
1190
|
"""
|
|
1191
|
+
if not self.__is_setup:
|
|
1192
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1131
1193
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1132
1194
|
if not container.HasField("json_container"):
|
|
1133
1195
|
raise Exception(f"Input {index} does not contain a JSON container.")
|
|
@@ -1148,6 +1210,8 @@ class AgentBase(ABC):
|
|
|
1148
1210
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1149
1211
|
:return: A list of text data as strings.
|
|
1150
1212
|
"""
|
|
1213
|
+
if not self.__is_setup:
|
|
1214
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1151
1215
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1152
1216
|
if not container.HasField("text_container"):
|
|
1153
1217
|
raise Exception(f"Input {index} does not contain a text container.")
|
|
@@ -1175,6 +1239,8 @@ class AgentBase(ABC):
|
|
|
1175
1239
|
(bool for boolean fields, float for double fields, int for short, integer, long, and enum fields, and
|
|
1176
1240
|
string for everything else).
|
|
1177
1241
|
"""
|
|
1242
|
+
if not self.__is_setup:
|
|
1243
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1178
1244
|
config_fields: dict[str, Any] = {}
|
|
1179
1245
|
raw_configs: Mapping[str, FieldValuePbo] = self.request.config_field_values
|
|
1180
1246
|
for field_name, field_def in self.get_config_defs().items():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/__init__.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/server.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/ai/test_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/chem/Molecules.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/chem/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/eln/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/files/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/src/sapiopycommons/rules/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/AF-A0A009IHW8-F1-model_v4.cif
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/_do_not_add_init_py_here
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/chem_test_curation_queue.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/curation_queue_test.sdf
RENAMED
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/file_compression_tests.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a792}/tests/flowcyto/8_color_ICS.wsp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|