Minio connection
upload_run_artifacts(response_text, generated_plots)
Packages and uploads run artifacts (report text and charts) to the MLflow Tracking Server.
This function ensures governance and reproducibility by permanently storing the output of each agent execution.
Fail-Safe Mechanism: This function is designed to be non-blocking. It catches all internal exceptions to ensure that a storage failure (e.g., S3 down) does not crash the main API response returned to the user.
Steps:
- Check Context: Verifies if there is an active MLflow run.
- Upload Plots: Iterates through
generated_plots, validates their existence on disk, and uploads them to theplots/artifact folder. - Process Report: Converts the Markdown to an "offline" version using
_create_offline_markdown. - Upload Report: Logs the modified text as
report.md.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response_text
|
str
|
The full markdown report text. |
required |
generated_plots
|
list[str]
|
List of filenames for plots generated in this run. |
required |
Source code in api/src/db/minio_connection.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |