sapiopycommons 2025.10.20a789__tar.gz → 2025.10.21a791__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.21a791}/PKG-INFO +1 -1
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/pyproject.toml +1 -1
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/agent_service_base.py +91 -20
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/.gitignore +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/LICENSE +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/README.md +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/converter_service_base.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/external_credentials.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/externalcredentials/external_credentials_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/fields_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/fielddefinitions/velox_field_def_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/converter/converter_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/item/item_container_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/script/script_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_output_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/step_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/entry_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/plan/tool/tool_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2.pyi +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protoapi/session/sapio_conn_info_pb2_grpc.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/protobuf_utils.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/request_validation.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/server.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/ai/test_client.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/callbacks/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/callbacks/callback_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/callbacks/field_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/chem/IndigoMolecules.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/chem/Molecules.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/chem/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/customreport/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/customreport/auto_pagers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/customreport/column_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/customreport/custom_report_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/customreport/term_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/datatype/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/datatype/attachment_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/datatype/data_fields.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/datatype/pseudo_data_types.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/experiment_cache.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/experiment_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/experiment_report_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/experiment_step_factory.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/experiment_tags.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/plate_designer.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/eln/step_creation.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/assay_plate_reader.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/complex_data_loader.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_bridge.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_bridge_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_data_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_text_converter.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_validator.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/file_writer.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/files/temp_files.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/flowcyto/flow_cyto.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/flowcyto/flowcyto_data.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/accession_service.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/aliases.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/audit_log.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/custom_report_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/data_structure_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/directive_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/exceptions.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/html_formatter.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/popup_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/sapio_links.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/storage_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/general/time_util.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/multimodal/multimodal.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/multimodal/multimodal_data.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/processtracking/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/processtracking/custom_workflow_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/processtracking/endpoints.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/recordmodel/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/recordmodel/record_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/rules/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/rules/eln_rule_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/rules/on_save_rule_handler.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/samples/aliquot.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/sftpconnect/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/sftpconnect/sftp_builder.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/webhook/__init__.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/webhook/webhook_context.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/webhook/webhook_handlers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/src/sapiopycommons/webhook/webservice_handlers.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/AF-A0A009IHW8-F1-model_v4.cif +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/_do_not_add_init_py_here +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/accession_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/aliquot_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/assay_plate_reader/BMGLabtech96.txt +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/assay_plate_reader/assay_plate_processing_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/bio_reg_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/chem_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/chem_test_curation_queue.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/curation_queue_test.sdf +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/data_type_models.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/file_compression_tests.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/flowcyto/8_color_ICS.wsp +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/flowcyto_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/kappa.chains.fasta +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/mafft_test.py +0 -0
- {sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/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.21a791
|
|
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,
|
|
@@ -947,6 +987,8 @@ class AgentBase(ABC):
|
|
|
947
987
|
: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
|
|
951
993
|
category = category.strip() if category else None
|
|
952
994
|
host = host.strip() if host else None
|
|
@@ -978,6 +1020,8 @@ class AgentBase(ABC):
|
|
|
978
1020
|
:param value: The value of the credentials config field.
|
|
979
1021
|
:return: An ExternalCredentials object containing the credentials.
|
|
980
1022
|
"""
|
|
1023
|
+
if not self.__is_setup:
|
|
1024
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
981
1025
|
# Values should be of the format "Name (Identifier)"
|
|
982
1026
|
match = re.match(r"^(.*) \((.*)\)$", value)
|
|
983
1027
|
if not match:
|
|
@@ -1004,23 +1048,34 @@ class AgentBase(ABC):
|
|
|
1004
1048
|
"""
|
|
1005
1049
|
try:
|
|
1006
1050
|
self.log_info(f"Running subprocess with command: {' '.join(args)}")
|
|
1007
|
-
|
|
1051
|
+
p: CompletedProcess[str] = subprocess.run(args, check=True, capture_output=True, text=True, cwd=cwd,
|
|
1052
|
+
**kwargs)
|
|
1053
|
+
if p.stdout:
|
|
1054
|
+
self.log_info(f"STDOUT: {p.stdout}")
|
|
1055
|
+
if p.stderr:
|
|
1056
|
+
self.log_info(f"STDERR: {p.stderr}")
|
|
1057
|
+
return p
|
|
1008
1058
|
except subprocess.CalledProcessError as e:
|
|
1009
1059
|
self.log_error(f"Error running subprocess. Return code: {e.returncode}")
|
|
1010
|
-
|
|
1011
|
-
|
|
1060
|
+
if e.stdout:
|
|
1061
|
+
self.log_error(f"STDOUT: {e.stdout}")
|
|
1062
|
+
if e.stderr:
|
|
1063
|
+
self.log_error(f"STDERR: {e.stderr}")
|
|
1012
1064
|
raise
|
|
1013
1065
|
|
|
1014
1066
|
def log_info(self, message: str) -> None:
|
|
1015
1067
|
"""
|
|
1016
1068
|
Log an info message for this agent. If verbose logging is enabled, this message will be included in the logs
|
|
1017
1069
|
returned to the caller. Empty/None inputs will not be logged.
|
|
1070
|
+
|
|
1071
|
+
Logging info can be done during initialization, but those logs will not be returned to the caller. Other
|
|
1072
|
+
log calls will be returned to the caller, even if done during initialization.
|
|
1018
1073
|
|
|
1019
1074
|
:param message: The message to log.
|
|
1020
1075
|
"""
|
|
1021
1076
|
if not message:
|
|
1022
1077
|
return
|
|
1023
|
-
if self.verbose_logging:
|
|
1078
|
+
if self.__is_setup and self.verbose_logging:
|
|
1024
1079
|
self.logs.append(f"INFO: {self.name()}: {message}")
|
|
1025
1080
|
self.logger.info(message)
|
|
1026
1081
|
|
|
@@ -1068,6 +1123,8 @@ class AgentBase(ABC):
|
|
|
1068
1123
|
:param index: The index of the input to check. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1069
1124
|
:return: True if the input is marked as partial, False otherwise.
|
|
1070
1125
|
"""
|
|
1126
|
+
if not self.__is_setup:
|
|
1127
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1071
1128
|
return self.request.input[index].is_partial
|
|
1072
1129
|
|
|
1073
1130
|
def get_input_name(self, index: int = 0) -> str | None:
|
|
@@ -1077,6 +1134,8 @@ class AgentBase(ABC):
|
|
|
1077
1134
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1078
1135
|
:return: The name of the input from the request object, or None if no name is set.
|
|
1079
1136
|
"""
|
|
1137
|
+
if not self.__is_setup:
|
|
1138
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1080
1139
|
return self.request.input[index].item_container.container_name
|
|
1081
1140
|
|
|
1082
1141
|
def get_input_content_type(self, index: int = 0) -> ContentTypePbo:
|
|
@@ -1086,6 +1145,8 @@ class AgentBase(ABC):
|
|
|
1086
1145
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1087
1146
|
:return: The content type of the input from the request object.
|
|
1088
1147
|
"""
|
|
1148
|
+
if not self.__is_setup:
|
|
1149
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1089
1150
|
return self.request.input[index].item_container.content_type
|
|
1090
1151
|
|
|
1091
1152
|
def get_input_binary(self, index: int = 0) -> list[bytes]:
|
|
@@ -1095,6 +1156,8 @@ class AgentBase(ABC):
|
|
|
1095
1156
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1096
1157
|
:return: The binary data from the request object.
|
|
1097
1158
|
"""
|
|
1159
|
+
if not self.__is_setup:
|
|
1160
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1098
1161
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1099
1162
|
if not container.HasField("binary_container"):
|
|
1100
1163
|
raise Exception(f"Input {index} does not contain a binary container.")
|
|
@@ -1109,6 +1172,8 @@ class AgentBase(ABC):
|
|
|
1109
1172
|
the column names, and the data rows are a list of dictionaries where each dictionary represents a row in the
|
|
1110
1173
|
CSV with the column names as keys and the corresponding values as strings.
|
|
1111
1174
|
"""
|
|
1175
|
+
if not self.__is_setup:
|
|
1176
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1112
1177
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1113
1178
|
if not container.HasField("csv_container"):
|
|
1114
1179
|
raise Exception(f"Input {index} does not contain a CSV container.")
|
|
@@ -1128,6 +1193,8 @@ class AgentBase(ABC):
|
|
|
1128
1193
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1129
1194
|
:return: A list of parsed JSON objects, which are represented as dictionaries.
|
|
1130
1195
|
"""
|
|
1196
|
+
if not self.__is_setup:
|
|
1197
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1131
1198
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1132
1199
|
if not container.HasField("json_container"):
|
|
1133
1200
|
raise Exception(f"Input {index} does not contain a JSON container.")
|
|
@@ -1148,6 +1215,8 @@ class AgentBase(ABC):
|
|
|
1148
1215
|
:param index: The index of the input to parse. Defaults to 0. Used for agents that accept multiple inputs.
|
|
1149
1216
|
:return: A list of text data as strings.
|
|
1150
1217
|
"""
|
|
1218
|
+
if not self.__is_setup:
|
|
1219
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1151
1220
|
container: StepItemContainerPbo = self.request.input[index].item_container
|
|
1152
1221
|
if not container.HasField("text_container"):
|
|
1153
1222
|
raise Exception(f"Input {index} does not contain a text container.")
|
|
@@ -1175,6 +1244,8 @@ class AgentBase(ABC):
|
|
|
1175
1244
|
(bool for boolean fields, float for double fields, int for short, integer, long, and enum fields, and
|
|
1176
1245
|
string for everything else).
|
|
1177
1246
|
"""
|
|
1247
|
+
if not self.__is_setup:
|
|
1248
|
+
raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
|
|
1178
1249
|
config_fields: dict[str, Any] = {}
|
|
1179
1250
|
raw_configs: Mapping[str, FieldValuePbo] = self.request.config_field_values
|
|
1180
1251
|
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.21a791}/src/sapiopycommons/__init__.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/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.21a791}/src/sapiopycommons/ai/server.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/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.21a791}/src/sapiopycommons/chem/Molecules.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/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.21a791}/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.21a791}/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.21a791}/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.21a791}/tests/AF-A0A009IHW8-F1-model_v4.cif
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/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.21a791}/tests/chem_test_curation_queue.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/curation_queue_test.sdf
RENAMED
|
File without changes
|
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/file_compression_tests.py
RENAMED
|
File without changes
|
{sapiopycommons-2025.10.20a789 → sapiopycommons-2025.10.21a791}/tests/flowcyto/8_color_ICS.wsp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|