truefoundry 0.5.10rc1__py3-none-any.whl → 0.5.11rc1__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 truefoundry might be problematic. Click here for more details.
- truefoundry/__init__.py +19 -0
- truefoundry/_client.py +36 -0
- truefoundry/cli/display_util.py +1 -1
- truefoundry/common/utils.py +9 -0
- truefoundry/deploy/__init__.py +2 -2
- truefoundry/deploy/_autogen/models.py +1591 -0
- truefoundry/deploy/builder/__init__.py +1 -1
- truefoundry/deploy/builder/builders/dockerfile.py +1 -1
- truefoundry/deploy/builder/builders/tfy_notebook_buildpack/__init__.py +1 -1
- truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py +1 -1
- truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py +1 -1
- truefoundry/deploy/io/output_callback.py +13 -6
- truefoundry/deploy/io/rich_output_callback.py +8 -4
- truefoundry/deploy/lib/clients/servicefoundry_client.py +117 -138
- truefoundry/deploy/lib/dao/apply.py +2 -2
- truefoundry/deploy/lib/dao/delete.py +2 -2
- truefoundry/deploy/lib/model/entity.py +37 -24
- truefoundry/deploy/v2/lib/deploy.py +7 -7
- truefoundry/deploy/v2/lib/deploy_workflow.py +9 -9
- truefoundry/deploy/v2/lib/deployable_patched_models.py +1 -1
- truefoundry/deploy/v2/lib/patched_models.py +7 -7
- truefoundry/deploy/v2/lib/source.py +1 -1
- truefoundry/ml/__init__.py +2 -2
- truefoundry/ml/_autogen/client/__init__.py +457 -0
- truefoundry/ml/_autogen/client/api/__init__.py +16 -0
- truefoundry/ml/{autogen → _autogen}/client/api/auth_api.py +6 -6
- truefoundry/ml/{autogen → _autogen}/client/api/deprecated_api.py +12 -345
- truefoundry/ml/{autogen → _autogen}/client/api/experiments_api.py +89 -44
- truefoundry/ml/{autogen → _autogen}/client/api/generate_code_snippet_api.py +10 -10
- truefoundry/ml/{autogen → _autogen}/client/api/health_api.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/api/metrics_api.py +10 -10
- truefoundry/ml/{autogen → _autogen}/client/api/mlfoundry_artifacts_api.py +589 -197
- truefoundry/ml/{autogen → _autogen}/client/api/run_artifacts_api.py +14 -9
- truefoundry/ml/{autogen → _autogen}/client/api/runs_api.py +41 -41
- truefoundry/ml/{autogen → _autogen}/client/api_client.py +8 -8
- truefoundry/ml/{autogen → _autogen}/client/configuration.py +30 -58
- truefoundry/ml/{autogen → _autogen}/client/exceptions.py +2 -2
- truefoundry/ml/_autogen/client/models/__init__.py +428 -0
- truefoundry/ml/{autogen → _autogen}/client/models/agent_app.py +14 -7
- truefoundry/ml/{autogen/client/models/agent.py → _autogen/client/models/agent_manifest.py} +37 -35
- truefoundry/ml/{autogen/client/models/agent_open_api_tool.py → _autogen/client/models/agent_open_api_tool_manifest.py} +50 -37
- truefoundry/ml/{autogen → _autogen}/client/models/agent_open_api_tool_with_fqn.py +45 -32
- truefoundry/ml/{autogen → _autogen}/client/models/agent_with_fqn.py +32 -30
- truefoundry/ml/_autogen/client/models/apply_request_dto.py +75 -0
- truefoundry/ml/_autogen/client/models/apply_response_dto.py +79 -0
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_dto.py +7 -5
- truefoundry/ml/{autogen/client/models/artifact_version_manifest.py → _autogen/client/models/artifact_manifest.py} +39 -31
- truefoundry/ml/_autogen/client/models/artifact_path.py +70 -0
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_type.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_dto.py +10 -18
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_response_dto.py +5 -3
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_serialization_format.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/artifact_version_status.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/assistant_message.py +6 -6
- truefoundry/ml/{autogen → _autogen}/client/models/authorize_user_for_model_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/authorize_user_for_model_version_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/blob_storage_reference.py +6 -9
- truefoundry/ml/{autogen → _autogen}/client/models/body_get_search_runs_get.py +2 -2
- truefoundry/ml/{autogen/client/models/chat_prompt.py → _autogen/client/models/chat_prompt_manifest.py} +39 -37
- truefoundry/ml/{autogen/client/models/chat_prompt_messages_inner.py → _autogen/client/models/chat_prompt_manifest_messages_inner.py} +15 -15
- truefoundry/ml/{autogen → _autogen}/client/models/columns_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/command.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/content.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/content1.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/content2.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/models/content2_any_of_inner.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_version_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_artifact_version_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_dataset_request_dto.py +21 -5
- truefoundry/ml/{autogen → _autogen}/client/models/create_experiment_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_experiment_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_model_version_request_dto.py +4 -12
- truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_for_dataset_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_for_dataset_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_multi_part_upload_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_python_deployment_config_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_python_deployment_config_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/create_run_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_run_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/create_workflow_task_config_request_dto.py +2 -2
- truefoundry/ml/_autogen/client/models/data_directory_manifest.py +124 -0
- truefoundry/ml/{autogen → _autogen}/client/models/dataset_dto.py +15 -4
- truefoundry/ml/{autogen → _autogen}/client/models/dataset_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/delete_artifact_versions_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/delete_dataset_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/delete_files_for_dataset_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/delete_model_version_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/delete_run_request.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/delete_tag_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/experiment_dto.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/models/experiment_id_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/experiment_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/experiment_tag_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/export_deployment_files_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/external_blob_storage_source.py +17 -9
- truefoundry/ml/{autogen → _autogen}/client/models/fast_ai_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/file_info_dto.py +6 -3
- truefoundry/ml/{autogen → _autogen}/client/models/finalize_artifact_version_request_dto.py +7 -15
- truefoundry/ml/{autogen → _autogen}/client/models/framework.py +17 -17
- truefoundry/ml/{autogen → _autogen}/client/models/get_artifact_version_aliases_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/get_experiment_response_dto.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/get_latest_run_log_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_metric_history_response.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_url_for_dataset_write_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_read_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_read_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_signed_urls_for_dataset_write_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/get_tenant_id_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/gluon_framework.py +4 -6
- truefoundry/ml/{autogen → _autogen}/client/models/h2_o_framework.py +4 -6
- truefoundry/ml/{autogen → _autogen}/client/models/http_validation_error.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/image_content_part.py +6 -7
- truefoundry/ml/{autogen → _autogen}/client/models/image_url.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/infer_method_name.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/keras_framework.py +4 -6
- truefoundry/ml/{autogen → _autogen}/client/models/latest_run_log_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/library_name.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/light_gbm_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/list_artifact_versions_request_dto.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/list_artifact_versions_response_dto.py +5 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_artifacts_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_artifacts_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_colums_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_datasets_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/list_datasets_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_experiments_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_artifact_version_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_artifact_versions_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_dataset_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/list_files_for_dataset_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_latest_run_logs_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_metric_history_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/list_metric_history_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_model_version_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_model_versions_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_models_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/list_models_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_run_artifacts_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/list_run_logs_response_dto.py +3 -3
- truefoundry/ml/_autogen/client/models/local_artifact_source.py +91 -0
- truefoundry/ml/_autogen/client/models/local_model_source.py +77 -0
- truefoundry/ml/{autogen → _autogen}/client/models/log_batch_request_dto.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/models/log_metric_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/log_param_request_dto.py +2 -2
- truefoundry/ml/_autogen/client/models/manifest.py +229 -0
- truefoundry/ml/_autogen/client/models/manifest1.py +217 -0
- truefoundry/ml/{autogen/client/models/internal_metadata.py → _autogen/client/models/manifest2.py} +68 -50
- truefoundry/ml/{autogen → _autogen}/client/models/method.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/metric_collection_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/metric_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/mime_type.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/model_configuration.py +8 -9
- truefoundry/ml/{autogen → _autogen}/client/models/model_dto.py +6 -6
- truefoundry/ml/{autogen/client/models/model_version_manifest.py → _autogen/client/models/model_manifest.py} +43 -35
- truefoundry/ml/{autogen → _autogen}/client/models/model_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/model_server.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/model_version_dto.py +9 -11
- truefoundry/ml/{autogen → _autogen}/client/models/model_version_environment.py +5 -7
- truefoundry/ml/{autogen → _autogen}/client/models/model_version_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_dto.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/multi_part_upload_storage_provider.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/notify_artifact_version_failure_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/onnx_framework.py +4 -6
- truefoundry/ml/{autogen → _autogen}/client/models/openapi_spec.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/paddle_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/param_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/parameters.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/py_torch_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/resolve_agent_app_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/restore_run_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/run_data_dto.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/models/run_dto.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/run_info_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/run_log_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/run_log_input_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/run_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/run_tag_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/search_runs_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/search_runs_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/set_experiment_tag_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/set_tag_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/signed_url_dto.py +3 -4
- truefoundry/ml/{autogen → _autogen}/client/models/sklearn_framework.py +9 -10
- truefoundry/ml/{autogen → _autogen}/client/models/sklearn_model_schema.py +7 -8
- truefoundry/ml/{autogen → _autogen}/client/models/sklearn_serialization_format.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/source.py +34 -9
- truefoundry/ml/{autogen → _autogen}/client/models/source1.py +5 -5
- truefoundry/ml/_autogen/client/models/source2.py +177 -0
- truefoundry/ml/{autogen → _autogen}/client/models/spa_cy_framework.py +4 -6
- truefoundry/ml/{autogen → _autogen}/client/models/stats_models_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/stop.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/store_run_logs_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/subject.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/subject_type.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/system_message.py +6 -8
- truefoundry/ml/{autogen → _autogen}/client/models/tensor_flow_framework.py +4 -7
- truefoundry/ml/{autogen → _autogen}/client/models/text.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/text_content_part.py +5 -5
- truefoundry/ml/{autogen → _autogen}/client/models/transformers_framework.py +8 -12
- truefoundry/ml/{autogen → _autogen}/client/models/trigger_job_run_config_request_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/trigger_job_run_config_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/true_foundry_managed_source.py +18 -12
- truefoundry/ml/{autogen → _autogen}/client/models/update_artifact_version_request_dto.py +5 -7
- truefoundry/ml/{autogen → _autogen}/client/models/update_dataset_request_dto.py +13 -3
- truefoundry/ml/{autogen → _autogen}/client/models/update_experiment_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/update_model_version_request_dto.py +5 -7
- truefoundry/ml/{autogen → _autogen}/client/models/update_run_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/update_run_response_dto.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/url.py +4 -4
- truefoundry/ml/{autogen → _autogen}/client/models/user_message.py +6 -6
- truefoundry/ml/{autogen → _autogen}/client/models/validate_external_storage_root_request_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/validate_external_storage_root_response_dto.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/validation_error.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/models/validation_error_loc_inner.py +2 -2
- truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_framework.py +7 -10
- truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_model_schema.py +6 -7
- truefoundry/ml/{autogen → _autogen}/client/models/xg_boost_serialization_format.py +3 -3
- truefoundry/ml/{autogen → _autogen}/client/rest.py +3 -3
- truefoundry/ml/_autogen/client_README.md +359 -0
- truefoundry/ml/_autogen/entities/artifacts.py +558 -0
- truefoundry/ml/artifact/truefoundry_artifact_repo.py +1 -1
- truefoundry/ml/cli/commands/model_init.py +1 -1
- truefoundry/ml/clients/servicefoundry_client.py +7 -2
- truefoundry/ml/entities.py +1 -1
- truefoundry/ml/log_types/artifacts/artifact.py +22 -85
- truefoundry/ml/log_types/artifacts/dataset.py +5 -5
- truefoundry/ml/log_types/artifacts/general_artifact.py +1 -1
- truefoundry/ml/log_types/artifacts/model.py +12 -13
- truefoundry/ml/log_types/artifacts/utils.py +18 -2
- truefoundry/ml/log_types/image/image.py +1 -1
- truefoundry/ml/log_types/plot.py +1 -1
- truefoundry/ml/mlfoundry_api.py +2 -42
- truefoundry/ml/mlfoundry_run.py +1 -1
- truefoundry/ml/model_framework.py +3 -3
- truefoundry/ml/session.py +7 -4
- truefoundry/ml/validation_utils.py +1 -1
- truefoundry/workflow/map_task.py +5 -2
- {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/METADATA +2 -1
- truefoundry-0.5.11rc1.dist-info/RECORD +377 -0
- truefoundry/deploy/auto_gen/models.py +0 -1915
- truefoundry/ml/autogen/client/__init__.py +0 -445
- truefoundry/ml/autogen/client/api/__init__.py +0 -16
- truefoundry/ml/autogen/client/models/__init__.py +0 -416
- truefoundry/ml/autogen/client/models/add_custom_metrics_to_model_version_request_dto.py +0 -69
- truefoundry/ml/autogen/client/models/add_features_to_model_version_request_dto.py +0 -69
- truefoundry/ml/autogen/client/models/manifest.py +0 -154
- truefoundry/ml/autogen/client_README.md +0 -361
- truefoundry/ml/autogen/entities/artifacts.py +0 -670
- truefoundry-0.5.10rc1.dist-info/RECORD +0 -370
- /truefoundry/ml/{autogen → _autogen}/__init__.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/client/api_response.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/models/__init__.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/models/exceptions.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/models/schema.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/models/signature.py +0 -0
- /truefoundry/ml/{autogen → _autogen}/models/utils.py +0 -0
- {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/WHEEL +0 -0
- {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.11rc1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
TrueFoundry ML API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
|
|
20
|
+
from truefoundry.pydantic_v1 import BaseModel, Field, StrictStr, validator
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class LocalModelSource(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
LocalModelSource
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: StrictStr = Field(default=..., description="Type of the source")
|
|
29
|
+
file_or_folder: StrictStr = Field(
|
|
30
|
+
default=..., description="Path to the model file or folder"
|
|
31
|
+
)
|
|
32
|
+
__properties = ["type", "file_or_folder"]
|
|
33
|
+
|
|
34
|
+
@validator("type")
|
|
35
|
+
def type_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in ("local",):
|
|
38
|
+
raise ValueError("must be one of enum values ('local')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
"""Pydantic configuration"""
|
|
43
|
+
|
|
44
|
+
allow_population_by_field_name = True
|
|
45
|
+
validate_assignment = True
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.dict(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> LocalModelSource:
|
|
57
|
+
"""Create an instance of LocalModelSource from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self):
|
|
61
|
+
"""Returns the dictionary representation of the model using alias"""
|
|
62
|
+
_dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
|
|
63
|
+
return _dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls, obj: dict) -> LocalModelSource:
|
|
67
|
+
"""Create an instance of LocalModelSource from a dict"""
|
|
68
|
+
if obj is None:
|
|
69
|
+
return None
|
|
70
|
+
|
|
71
|
+
if not isinstance(obj, dict):
|
|
72
|
+
return LocalModelSource.parse_obj(obj)
|
|
73
|
+
|
|
74
|
+
_obj = LocalModelSource.parse_obj(
|
|
75
|
+
{"type": obj.get("type"), "file_or_folder": obj.get("file_or_folder")}
|
|
76
|
+
)
|
|
77
|
+
return _obj
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
TrueFoundry ML API
|
|
5
5
|
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -18,9 +18,9 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
from typing import Optional
|
|
20
20
|
|
|
21
|
-
from truefoundry.ml.
|
|
22
|
-
from truefoundry.ml.
|
|
23
|
-
from truefoundry.ml.
|
|
21
|
+
from truefoundry.ml._autogen.client.models.metric_dto import MetricDto
|
|
22
|
+
from truefoundry.ml._autogen.client.models.param_dto import ParamDto
|
|
23
|
+
from truefoundry.ml._autogen.client.models.run_tag_dto import RunTagDto
|
|
24
24
|
from truefoundry.pydantic_v1 import BaseModel, StrictStr, conlist
|
|
25
25
|
|
|
26
26
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
TrueFoundry ML API
|
|
5
5
|
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
TrueFoundry ML API
|
|
5
5
|
|
|
6
6
|
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
TrueFoundry ML API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml._autogen.client.models.agent_manifest import AgentManifest
|
|
22
|
+
from truefoundry.ml._autogen.client.models.agent_open_api_tool_manifest import (
|
|
23
|
+
AgentOpenAPIToolManifest,
|
|
24
|
+
)
|
|
25
|
+
from truefoundry.ml._autogen.client.models.artifact_manifest import ArtifactManifest
|
|
26
|
+
from truefoundry.ml._autogen.client.models.chat_prompt_manifest import (
|
|
27
|
+
ChatPromptManifest,
|
|
28
|
+
)
|
|
29
|
+
from truefoundry.ml._autogen.client.models.model_manifest import ModelManifest
|
|
30
|
+
from truefoundry.pydantic_v1 import (
|
|
31
|
+
BaseModel,
|
|
32
|
+
Field,
|
|
33
|
+
ValidationError,
|
|
34
|
+
validator,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
MANIFEST_ONE_OF_SCHEMAS = [
|
|
38
|
+
"AgentManifest",
|
|
39
|
+
"AgentOpenAPIToolManifest",
|
|
40
|
+
"ArtifactManifest",
|
|
41
|
+
"ChatPromptManifest",
|
|
42
|
+
"ModelManifest",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class Manifest(BaseModel):
|
|
47
|
+
"""
|
|
48
|
+
Manifest
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
# data type: ModelManifest
|
|
52
|
+
oneof_schema_1_validator: Optional[ModelManifest] = None
|
|
53
|
+
# data type: ChatPromptManifest
|
|
54
|
+
oneof_schema_2_validator: Optional[ChatPromptManifest] = None
|
|
55
|
+
# data type: AgentOpenAPIToolManifest
|
|
56
|
+
oneof_schema_3_validator: Optional[AgentOpenAPIToolManifest] = None
|
|
57
|
+
# data type: AgentManifest
|
|
58
|
+
oneof_schema_4_validator: Optional[AgentManifest] = None
|
|
59
|
+
# data type: ArtifactManifest
|
|
60
|
+
oneof_schema_5_validator: Optional[ArtifactManifest] = None
|
|
61
|
+
if TYPE_CHECKING:
|
|
62
|
+
actual_instance: Union[
|
|
63
|
+
AgentManifest,
|
|
64
|
+
AgentOpenAPIToolManifest,
|
|
65
|
+
ArtifactManifest,
|
|
66
|
+
ChatPromptManifest,
|
|
67
|
+
ModelManifest,
|
|
68
|
+
]
|
|
69
|
+
else:
|
|
70
|
+
actual_instance: Any
|
|
71
|
+
one_of_schemas: List[str] = Field(MANIFEST_ONE_OF_SCHEMAS, const=True)
|
|
72
|
+
|
|
73
|
+
class Config:
|
|
74
|
+
validate_assignment = True
|
|
75
|
+
|
|
76
|
+
discriminator_value_class_map = {}
|
|
77
|
+
|
|
78
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
79
|
+
if args:
|
|
80
|
+
if len(args) > 1:
|
|
81
|
+
raise ValueError(
|
|
82
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
83
|
+
)
|
|
84
|
+
if kwargs:
|
|
85
|
+
raise ValueError(
|
|
86
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
87
|
+
)
|
|
88
|
+
super().__init__(actual_instance=args[0])
|
|
89
|
+
else:
|
|
90
|
+
super().__init__(**kwargs)
|
|
91
|
+
|
|
92
|
+
@validator("actual_instance")
|
|
93
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
94
|
+
instance = Manifest.construct()
|
|
95
|
+
error_messages = []
|
|
96
|
+
match = 0
|
|
97
|
+
# validate data type: ModelManifest
|
|
98
|
+
if not isinstance(v, ModelManifest):
|
|
99
|
+
error_messages.append(
|
|
100
|
+
f"Error! Input type `{type(v)}` is not `ModelManifest`"
|
|
101
|
+
)
|
|
102
|
+
else:
|
|
103
|
+
match += 1
|
|
104
|
+
# validate data type: ChatPromptManifest
|
|
105
|
+
if not isinstance(v, ChatPromptManifest):
|
|
106
|
+
error_messages.append(
|
|
107
|
+
f"Error! Input type `{type(v)}` is not `ChatPromptManifest`"
|
|
108
|
+
)
|
|
109
|
+
else:
|
|
110
|
+
match += 1
|
|
111
|
+
# validate data type: AgentOpenAPIToolManifest
|
|
112
|
+
if not isinstance(v, AgentOpenAPIToolManifest):
|
|
113
|
+
error_messages.append(
|
|
114
|
+
f"Error! Input type `{type(v)}` is not `AgentOpenAPIToolManifest`"
|
|
115
|
+
)
|
|
116
|
+
else:
|
|
117
|
+
match += 1
|
|
118
|
+
# validate data type: AgentManifest
|
|
119
|
+
if not isinstance(v, AgentManifest):
|
|
120
|
+
error_messages.append(
|
|
121
|
+
f"Error! Input type `{type(v)}` is not `AgentManifest`"
|
|
122
|
+
)
|
|
123
|
+
else:
|
|
124
|
+
match += 1
|
|
125
|
+
# validate data type: ArtifactManifest
|
|
126
|
+
if not isinstance(v, ArtifactManifest):
|
|
127
|
+
error_messages.append(
|
|
128
|
+
f"Error! Input type `{type(v)}` is not `ArtifactManifest`"
|
|
129
|
+
)
|
|
130
|
+
else:
|
|
131
|
+
match += 1
|
|
132
|
+
if match > 1:
|
|
133
|
+
# more than 1 match
|
|
134
|
+
raise ValueError(
|
|
135
|
+
"Multiple matches found when setting `actual_instance` in Manifest with oneOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
136
|
+
+ ", ".join(error_messages)
|
|
137
|
+
)
|
|
138
|
+
elif match == 0:
|
|
139
|
+
# no match
|
|
140
|
+
raise ValueError(
|
|
141
|
+
"No match found when setting `actual_instance` in Manifest with oneOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
142
|
+
+ ", ".join(error_messages)
|
|
143
|
+
)
|
|
144
|
+
else:
|
|
145
|
+
return v
|
|
146
|
+
|
|
147
|
+
@classmethod
|
|
148
|
+
def from_dict(cls, obj: dict) -> Manifest:
|
|
149
|
+
return cls.from_json(json.dumps(obj))
|
|
150
|
+
|
|
151
|
+
@classmethod
|
|
152
|
+
def from_json(cls, json_str: str) -> Manifest:
|
|
153
|
+
"""Returns the object represented by the json string"""
|
|
154
|
+
instance = Manifest.construct()
|
|
155
|
+
error_messages = []
|
|
156
|
+
match = 0
|
|
157
|
+
|
|
158
|
+
# deserialize data into ModelManifest
|
|
159
|
+
try:
|
|
160
|
+
instance.actual_instance = ModelManifest.from_json(json_str)
|
|
161
|
+
match += 1
|
|
162
|
+
except (ValidationError, ValueError) as e:
|
|
163
|
+
error_messages.append(str(e))
|
|
164
|
+
# deserialize data into ChatPromptManifest
|
|
165
|
+
try:
|
|
166
|
+
instance.actual_instance = ChatPromptManifest.from_json(json_str)
|
|
167
|
+
match += 1
|
|
168
|
+
except (ValidationError, ValueError) as e:
|
|
169
|
+
error_messages.append(str(e))
|
|
170
|
+
# deserialize data into AgentOpenAPIToolManifest
|
|
171
|
+
try:
|
|
172
|
+
instance.actual_instance = AgentOpenAPIToolManifest.from_json(json_str)
|
|
173
|
+
match += 1
|
|
174
|
+
except (ValidationError, ValueError) as e:
|
|
175
|
+
error_messages.append(str(e))
|
|
176
|
+
# deserialize data into AgentManifest
|
|
177
|
+
try:
|
|
178
|
+
instance.actual_instance = AgentManifest.from_json(json_str)
|
|
179
|
+
match += 1
|
|
180
|
+
except (ValidationError, ValueError) as e:
|
|
181
|
+
error_messages.append(str(e))
|
|
182
|
+
# deserialize data into ArtifactManifest
|
|
183
|
+
try:
|
|
184
|
+
instance.actual_instance = ArtifactManifest.from_json(json_str)
|
|
185
|
+
match += 1
|
|
186
|
+
except (ValidationError, ValueError) as e:
|
|
187
|
+
error_messages.append(str(e))
|
|
188
|
+
|
|
189
|
+
if match > 1:
|
|
190
|
+
# more than 1 match
|
|
191
|
+
raise ValueError(
|
|
192
|
+
"Multiple matches found when deserializing the JSON string into Manifest with oneOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
193
|
+
+ ", ".join(error_messages)
|
|
194
|
+
)
|
|
195
|
+
elif match == 0:
|
|
196
|
+
# no match
|
|
197
|
+
raise ValueError(
|
|
198
|
+
"No match found when deserializing the JSON string into Manifest with oneOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
199
|
+
+ ", ".join(error_messages)
|
|
200
|
+
)
|
|
201
|
+
else:
|
|
202
|
+
return instance
|
|
203
|
+
|
|
204
|
+
def to_json(self) -> str:
|
|
205
|
+
"""Returns the JSON representation of the actual instance"""
|
|
206
|
+
if self.actual_instance is None:
|
|
207
|
+
return "null"
|
|
208
|
+
|
|
209
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
210
|
+
if callable(to_json):
|
|
211
|
+
return self.actual_instance.to_json()
|
|
212
|
+
else:
|
|
213
|
+
return json.dumps(self.actual_instance)
|
|
214
|
+
|
|
215
|
+
def to_dict(self) -> dict:
|
|
216
|
+
"""Returns the dict representation of the actual instance"""
|
|
217
|
+
if self.actual_instance is None:
|
|
218
|
+
return None
|
|
219
|
+
|
|
220
|
+
to_dict = getattr(self.actual_instance, "to_dict", None)
|
|
221
|
+
if callable(to_dict):
|
|
222
|
+
return self.actual_instance.to_dict()
|
|
223
|
+
else:
|
|
224
|
+
# primitive type
|
|
225
|
+
return self.actual_instance
|
|
226
|
+
|
|
227
|
+
def to_str(self) -> str:
|
|
228
|
+
"""Returns the string representation of the actual instance"""
|
|
229
|
+
return pprint.pformat(self.dict())
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
TrueFoundry ML API
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import TYPE_CHECKING, Any, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from truefoundry.ml._autogen.client.models.agent_manifest import AgentManifest
|
|
22
|
+
from truefoundry.ml._autogen.client.models.agent_open_api_tool_manifest import (
|
|
23
|
+
AgentOpenAPIToolManifest,
|
|
24
|
+
)
|
|
25
|
+
from truefoundry.ml._autogen.client.models.artifact_manifest import ArtifactManifest
|
|
26
|
+
from truefoundry.ml._autogen.client.models.chat_prompt_manifest import (
|
|
27
|
+
ChatPromptManifest,
|
|
28
|
+
)
|
|
29
|
+
from truefoundry.ml._autogen.client.models.model_manifest import ModelManifest
|
|
30
|
+
from truefoundry.pydantic_v1 import (
|
|
31
|
+
BaseModel,
|
|
32
|
+
Field,
|
|
33
|
+
ValidationError,
|
|
34
|
+
validator,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
MANIFEST1_ANY_OF_SCHEMAS = [
|
|
38
|
+
"AgentManifest",
|
|
39
|
+
"AgentOpenAPIToolManifest",
|
|
40
|
+
"ArtifactManifest",
|
|
41
|
+
"ChatPromptManifest",
|
|
42
|
+
"ModelManifest",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class Manifest1(BaseModel):
|
|
47
|
+
"""
|
|
48
|
+
Manifest1
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
# data type: ModelManifest
|
|
52
|
+
anyof_schema_1_validator: Optional[ModelManifest] = None
|
|
53
|
+
# data type: ChatPromptManifest
|
|
54
|
+
anyof_schema_2_validator: Optional[ChatPromptManifest] = None
|
|
55
|
+
# data type: AgentOpenAPIToolManifest
|
|
56
|
+
anyof_schema_3_validator: Optional[AgentOpenAPIToolManifest] = None
|
|
57
|
+
# data type: AgentManifest
|
|
58
|
+
anyof_schema_4_validator: Optional[AgentManifest] = None
|
|
59
|
+
# data type: ArtifactManifest
|
|
60
|
+
anyof_schema_5_validator: Optional[ArtifactManifest] = None
|
|
61
|
+
if TYPE_CHECKING:
|
|
62
|
+
actual_instance: Union[
|
|
63
|
+
AgentManifest,
|
|
64
|
+
AgentOpenAPIToolManifest,
|
|
65
|
+
ArtifactManifest,
|
|
66
|
+
ChatPromptManifest,
|
|
67
|
+
ModelManifest,
|
|
68
|
+
]
|
|
69
|
+
else:
|
|
70
|
+
actual_instance: Any
|
|
71
|
+
any_of_schemas: List[str] = Field(MANIFEST1_ANY_OF_SCHEMAS, const=True)
|
|
72
|
+
|
|
73
|
+
class Config:
|
|
74
|
+
validate_assignment = True
|
|
75
|
+
|
|
76
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
77
|
+
if args:
|
|
78
|
+
if len(args) > 1:
|
|
79
|
+
raise ValueError(
|
|
80
|
+
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
|
81
|
+
)
|
|
82
|
+
if kwargs:
|
|
83
|
+
raise ValueError(
|
|
84
|
+
"If a position argument is used, keyword arguments cannot be used."
|
|
85
|
+
)
|
|
86
|
+
super().__init__(actual_instance=args[0])
|
|
87
|
+
else:
|
|
88
|
+
super().__init__(**kwargs)
|
|
89
|
+
|
|
90
|
+
@validator("actual_instance")
|
|
91
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
92
|
+
instance = Manifest1.construct()
|
|
93
|
+
error_messages = []
|
|
94
|
+
# validate data type: ModelManifest
|
|
95
|
+
if not isinstance(v, ModelManifest):
|
|
96
|
+
error_messages.append(
|
|
97
|
+
f"Error! Input type `{type(v)}` is not `ModelManifest`"
|
|
98
|
+
)
|
|
99
|
+
else:
|
|
100
|
+
return v
|
|
101
|
+
|
|
102
|
+
# validate data type: ChatPromptManifest
|
|
103
|
+
if not isinstance(v, ChatPromptManifest):
|
|
104
|
+
error_messages.append(
|
|
105
|
+
f"Error! Input type `{type(v)}` is not `ChatPromptManifest`"
|
|
106
|
+
)
|
|
107
|
+
else:
|
|
108
|
+
return v
|
|
109
|
+
|
|
110
|
+
# validate data type: AgentOpenAPIToolManifest
|
|
111
|
+
if not isinstance(v, AgentOpenAPIToolManifest):
|
|
112
|
+
error_messages.append(
|
|
113
|
+
f"Error! Input type `{type(v)}` is not `AgentOpenAPIToolManifest`"
|
|
114
|
+
)
|
|
115
|
+
else:
|
|
116
|
+
return v
|
|
117
|
+
|
|
118
|
+
# validate data type: AgentManifest
|
|
119
|
+
if not isinstance(v, AgentManifest):
|
|
120
|
+
error_messages.append(
|
|
121
|
+
f"Error! Input type `{type(v)}` is not `AgentManifest`"
|
|
122
|
+
)
|
|
123
|
+
else:
|
|
124
|
+
return v
|
|
125
|
+
|
|
126
|
+
# validate data type: ArtifactManifest
|
|
127
|
+
if not isinstance(v, ArtifactManifest):
|
|
128
|
+
error_messages.append(
|
|
129
|
+
f"Error! Input type `{type(v)}` is not `ArtifactManifest`"
|
|
130
|
+
)
|
|
131
|
+
else:
|
|
132
|
+
return v
|
|
133
|
+
|
|
134
|
+
if error_messages:
|
|
135
|
+
# no match
|
|
136
|
+
raise ValueError(
|
|
137
|
+
"No match found when setting the actual_instance in Manifest1 with anyOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
138
|
+
+ ", ".join(error_messages)
|
|
139
|
+
)
|
|
140
|
+
else:
|
|
141
|
+
return v
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def from_dict(cls, obj: dict) -> Manifest1:
|
|
145
|
+
return cls.from_json(json.dumps(obj))
|
|
146
|
+
|
|
147
|
+
@classmethod
|
|
148
|
+
def from_json(cls, json_str: str) -> Manifest1:
|
|
149
|
+
"""Returns the object represented by the json string"""
|
|
150
|
+
instance = Manifest1.construct()
|
|
151
|
+
error_messages = []
|
|
152
|
+
# anyof_schema_1_validator: Optional[ModelManifest] = None
|
|
153
|
+
try:
|
|
154
|
+
instance.actual_instance = ModelManifest.from_json(json_str)
|
|
155
|
+
return instance
|
|
156
|
+
except (ValidationError, ValueError) as e:
|
|
157
|
+
error_messages.append(str(e))
|
|
158
|
+
# anyof_schema_2_validator: Optional[ChatPromptManifest] = None
|
|
159
|
+
try:
|
|
160
|
+
instance.actual_instance = ChatPromptManifest.from_json(json_str)
|
|
161
|
+
return instance
|
|
162
|
+
except (ValidationError, ValueError) as e:
|
|
163
|
+
error_messages.append(str(e))
|
|
164
|
+
# anyof_schema_3_validator: Optional[AgentOpenAPIToolManifest] = None
|
|
165
|
+
try:
|
|
166
|
+
instance.actual_instance = AgentOpenAPIToolManifest.from_json(json_str)
|
|
167
|
+
return instance
|
|
168
|
+
except (ValidationError, ValueError) as e:
|
|
169
|
+
error_messages.append(str(e))
|
|
170
|
+
# anyof_schema_4_validator: Optional[AgentManifest] = None
|
|
171
|
+
try:
|
|
172
|
+
instance.actual_instance = AgentManifest.from_json(json_str)
|
|
173
|
+
return instance
|
|
174
|
+
except (ValidationError, ValueError) as e:
|
|
175
|
+
error_messages.append(str(e))
|
|
176
|
+
# anyof_schema_5_validator: Optional[ArtifactManifest] = None
|
|
177
|
+
try:
|
|
178
|
+
instance.actual_instance = ArtifactManifest.from_json(json_str)
|
|
179
|
+
return instance
|
|
180
|
+
except (ValidationError, ValueError) as e:
|
|
181
|
+
error_messages.append(str(e))
|
|
182
|
+
|
|
183
|
+
if error_messages:
|
|
184
|
+
# no match
|
|
185
|
+
raise ValueError(
|
|
186
|
+
"No match found when deserializing the JSON string into Manifest1 with anyOf schemas: AgentManifest, AgentOpenAPIToolManifest, ArtifactManifest, ChatPromptManifest, ModelManifest. Details: "
|
|
187
|
+
+ ", ".join(error_messages)
|
|
188
|
+
)
|
|
189
|
+
else:
|
|
190
|
+
return instance
|
|
191
|
+
|
|
192
|
+
def to_json(self) -> str:
|
|
193
|
+
"""Returns the JSON representation of the actual instance"""
|
|
194
|
+
if self.actual_instance is None:
|
|
195
|
+
return "null"
|
|
196
|
+
|
|
197
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
198
|
+
if callable(to_json):
|
|
199
|
+
return self.actual_instance.to_json()
|
|
200
|
+
else:
|
|
201
|
+
return json.dumps(self.actual_instance)
|
|
202
|
+
|
|
203
|
+
def to_dict(self) -> dict:
|
|
204
|
+
"""Returns the dict representation of the actual instance"""
|
|
205
|
+
if self.actual_instance is None:
|
|
206
|
+
return "null"
|
|
207
|
+
|
|
208
|
+
to_json = getattr(self.actual_instance, "to_json", None)
|
|
209
|
+
if callable(to_json):
|
|
210
|
+
return self.actual_instance.to_dict()
|
|
211
|
+
else:
|
|
212
|
+
# primitive type
|
|
213
|
+
return self.actual_instance
|
|
214
|
+
|
|
215
|
+
def to_str(self) -> str:
|
|
216
|
+
"""Returns the string representation of the actual instance"""
|
|
217
|
+
return pprint.pformat(self.dict())
|