truefoundry 0.5.10rc1__py3-none-any.whl → 0.5.10rc2__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.

Files changed (221) hide show
  1. truefoundry/cli/display_util.py +1 -1
  2. truefoundry/deploy/auto_gen/models.py +1 -1
  3. truefoundry/deploy/io/output_callback.py +13 -6
  4. truefoundry/deploy/io/rich_output_callback.py +8 -4
  5. truefoundry/deploy/lib/clients/servicefoundry_client.py +78 -105
  6. truefoundry/deploy/lib/dao/apply.py +2 -2
  7. truefoundry/deploy/lib/dao/delete.py +2 -2
  8. truefoundry/deploy/lib/model/entity.py +37 -24
  9. truefoundry/ml/autogen/client/__init__.py +22 -14
  10. truefoundry/ml/autogen/client/api/auth_api.py +2 -2
  11. truefoundry/ml/autogen/client/api/deprecated_api.py +5 -338
  12. truefoundry/ml/autogen/client/api/experiments_api.py +77 -32
  13. truefoundry/ml/autogen/client/api/generate_code_snippet_api.py +2 -2
  14. truefoundry/ml/autogen/client/api/health_api.py +2 -2
  15. truefoundry/ml/autogen/client/api/metrics_api.py +4 -4
  16. truefoundry/ml/autogen/client/api/mlfoundry_artifacts_api.py +530 -140
  17. truefoundry/ml/autogen/client/api/run_artifacts_api.py +10 -5
  18. truefoundry/ml/autogen/client/api/runs_api.py +20 -20
  19. truefoundry/ml/autogen/client/api_client.py +2 -2
  20. truefoundry/ml/autogen/client/configuration.py +29 -57
  21. truefoundry/ml/autogen/client/exceptions.py +2 -2
  22. truefoundry/ml/autogen/client/models/__init__.py +22 -14
  23. truefoundry/ml/autogen/client/models/agent_app.py +13 -5
  24. truefoundry/ml/autogen/client/models/{agent.py → agent_manifest.py} +39 -30
  25. truefoundry/ml/autogen/client/models/{agent_open_api_tool.py → agent_open_api_tool_manifest.py} +50 -31
  26. truefoundry/ml/autogen/client/models/agent_open_api_tool_with_fqn.py +47 -26
  27. truefoundry/ml/autogen/client/models/agent_with_fqn.py +36 -25
  28. truefoundry/ml/autogen/client/models/{add_custom_metrics_to_model_version_request_dto.py → apply_request_dto.py} +23 -17
  29. truefoundry/ml/autogen/client/models/apply_response_dto.py +79 -0
  30. truefoundry/ml/autogen/client/models/artifact_dto.py +2 -2
  31. truefoundry/ml/autogen/client/models/{add_features_to_model_version_request_dto.py → artifact_path.py} +20 -17
  32. truefoundry/ml/autogen/client/models/artifact_response_dto.py +2 -2
  33. truefoundry/ml/autogen/client/models/artifact_type.py +3 -3
  34. truefoundry/ml/autogen/client/models/artifact_version_dto.py +7 -15
  35. truefoundry/ml/autogen/client/models/artifact_version_manifest.py +32 -19
  36. truefoundry/ml/autogen/client/models/artifact_version_response_dto.py +2 -2
  37. truefoundry/ml/autogen/client/models/artifact_version_serialization_format.py +2 -2
  38. truefoundry/ml/autogen/client/models/artifact_version_status.py +2 -2
  39. truefoundry/ml/autogen/client/models/assistant_message.py +9 -5
  40. truefoundry/ml/autogen/client/models/authorize_user_for_model_request_dto.py +2 -2
  41. truefoundry/ml/autogen/client/models/authorize_user_for_model_version_request_dto.py +2 -2
  42. truefoundry/ml/autogen/client/models/blob_storage_reference.py +4 -4
  43. truefoundry/ml/autogen/client/models/body_get_search_runs_get.py +2 -2
  44. truefoundry/ml/autogen/client/models/{chat_prompt.py → chat_prompt_manifest.py} +39 -32
  45. truefoundry/ml/autogen/client/models/{chat_prompt_messages_inner.py → chat_prompt_manifest_messages_inner.py} +12 -12
  46. truefoundry/ml/autogen/client/models/columns_dto.py +2 -2
  47. truefoundry/ml/autogen/client/models/command.py +2 -2
  48. truefoundry/ml/autogen/client/models/content.py +3 -3
  49. truefoundry/ml/autogen/client/models/content1.py +3 -3
  50. truefoundry/ml/autogen/client/models/content2.py +3 -3
  51. truefoundry/ml/autogen/client/models/content2_any_of_inner.py +2 -2
  52. truefoundry/ml/autogen/client/models/create_artifact_request_dto.py +2 -2
  53. truefoundry/ml/autogen/client/models/create_artifact_response_dto.py +2 -2
  54. truefoundry/ml/autogen/client/models/create_artifact_version_request_dto.py +2 -2
  55. truefoundry/ml/autogen/client/models/create_artifact_version_response_dto.py +2 -2
  56. truefoundry/ml/autogen/client/models/create_dataset_request_dto.py +21 -5
  57. truefoundry/ml/autogen/client/models/create_experiment_request_dto.py +2 -2
  58. truefoundry/ml/autogen/client/models/create_experiment_response_dto.py +2 -2
  59. truefoundry/ml/autogen/client/models/create_model_version_request_dto.py +4 -12
  60. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_request_dto.py +2 -2
  61. truefoundry/ml/autogen/client/models/create_multi_part_upload_for_dataset_response_dto.py +2 -2
  62. truefoundry/ml/autogen/client/models/create_multi_part_upload_request_dto.py +2 -2
  63. truefoundry/ml/autogen/client/models/create_python_deployment_config_request_dto.py +2 -2
  64. truefoundry/ml/autogen/client/models/create_python_deployment_config_response_dto.py +2 -2
  65. truefoundry/ml/autogen/client/models/create_run_request_dto.py +2 -2
  66. truefoundry/ml/autogen/client/models/create_run_response_dto.py +2 -2
  67. truefoundry/ml/autogen/client/models/create_workflow_task_config_request_dto.py +2 -2
  68. truefoundry/ml/autogen/client/models/data_directory_manifest.py +126 -0
  69. truefoundry/ml/autogen/client/models/dataset_dto.py +13 -2
  70. truefoundry/ml/autogen/client/models/dataset_response_dto.py +2 -2
  71. truefoundry/ml/autogen/client/models/delete_artifact_versions_request_dto.py +2 -2
  72. truefoundry/ml/autogen/client/models/delete_dataset_request_dto.py +2 -2
  73. truefoundry/ml/autogen/client/models/delete_files_for_dataset_request_dto.py +2 -2
  74. truefoundry/ml/autogen/client/models/delete_model_version_request_dto.py +2 -2
  75. truefoundry/ml/autogen/client/models/delete_run_request.py +2 -2
  76. truefoundry/ml/autogen/client/models/delete_tag_request_dto.py +2 -2
  77. truefoundry/ml/autogen/client/models/experiment_dto.py +3 -3
  78. truefoundry/ml/autogen/client/models/experiment_id_request_dto.py +2 -2
  79. truefoundry/ml/autogen/client/models/experiment_response_dto.py +2 -2
  80. truefoundry/ml/autogen/client/models/experiment_tag_dto.py +2 -2
  81. truefoundry/ml/autogen/client/models/export_deployment_files_request_dto.py +2 -2
  82. truefoundry/ml/autogen/client/models/external_blob_storage_source.py +5 -4
  83. truefoundry/ml/autogen/client/models/fast_ai_framework.py +3 -3
  84. truefoundry/ml/autogen/client/models/file_info_dto.py +2 -2
  85. truefoundry/ml/autogen/client/models/finalize_artifact_version_request_dto.py +7 -15
  86. truefoundry/ml/autogen/client/models/framework.py +3 -3
  87. truefoundry/ml/autogen/client/models/get_artifact_version_aliases_response_dto.py +2 -2
  88. truefoundry/ml/autogen/client/models/get_experiment_response_dto.py +2 -2
  89. truefoundry/ml/autogen/client/models/get_latest_run_log_response_dto.py +2 -2
  90. truefoundry/ml/autogen/client/models/get_metric_history_response.py +2 -2
  91. truefoundry/ml/autogen/client/models/get_signed_url_for_dataset_write_request_dto.py +2 -2
  92. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_request_dto.py +2 -2
  93. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_read_response_dto.py +2 -2
  94. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_request_dto.py +2 -2
  95. truefoundry/ml/autogen/client/models/get_signed_urls_for_artifact_version_write_response_dto.py +2 -2
  96. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_request_dto.py +2 -2
  97. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_read_response_dto.py +2 -2
  98. truefoundry/ml/autogen/client/models/get_signed_urls_for_dataset_write_response_dto.py +2 -2
  99. truefoundry/ml/autogen/client/models/get_tenant_id_response_dto.py +2 -2
  100. truefoundry/ml/autogen/client/models/gluon_framework.py +3 -3
  101. truefoundry/ml/autogen/client/models/h2_o_framework.py +3 -3
  102. truefoundry/ml/autogen/client/models/http_validation_error.py +2 -2
  103. truefoundry/ml/autogen/client/models/image_content_part.py +7 -5
  104. truefoundry/ml/autogen/client/models/image_url.py +3 -3
  105. truefoundry/ml/autogen/client/models/infer_method_name.py +2 -2
  106. truefoundry/ml/autogen/client/models/keras_framework.py +3 -3
  107. truefoundry/ml/autogen/client/models/latest_run_log_dto.py +2 -2
  108. truefoundry/ml/autogen/client/models/library_name.py +2 -2
  109. truefoundry/ml/autogen/client/models/light_gbm_framework.py +3 -3
  110. truefoundry/ml/autogen/client/models/list_artifact_versions_request_dto.py +2 -2
  111. truefoundry/ml/autogen/client/models/list_artifact_versions_response_dto.py +2 -2
  112. truefoundry/ml/autogen/client/models/list_artifacts_request_dto.py +2 -2
  113. truefoundry/ml/autogen/client/models/list_artifacts_response_dto.py +2 -2
  114. truefoundry/ml/autogen/client/models/list_colums_response_dto.py +2 -2
  115. truefoundry/ml/autogen/client/models/list_datasets_request_dto.py +2 -2
  116. truefoundry/ml/autogen/client/models/list_datasets_response_dto.py +2 -2
  117. truefoundry/ml/autogen/client/models/list_experiments_response_dto.py +2 -2
  118. truefoundry/ml/autogen/client/models/list_files_for_artifact_version_request_dto.py +2 -2
  119. truefoundry/ml/autogen/client/models/list_files_for_artifact_versions_response_dto.py +2 -2
  120. truefoundry/ml/autogen/client/models/list_files_for_dataset_request_dto.py +2 -2
  121. truefoundry/ml/autogen/client/models/list_files_for_dataset_response_dto.py +2 -2
  122. truefoundry/ml/autogen/client/models/list_latest_run_logs_response_dto.py +2 -2
  123. truefoundry/ml/autogen/client/models/list_metric_history_request_dto.py +2 -2
  124. truefoundry/ml/autogen/client/models/list_metric_history_response_dto.py +2 -2
  125. truefoundry/ml/autogen/client/models/list_model_version_response_dto.py +2 -2
  126. truefoundry/ml/autogen/client/models/list_model_versions_request_dto.py +2 -2
  127. truefoundry/ml/autogen/client/models/list_models_request_dto.py +2 -2
  128. truefoundry/ml/autogen/client/models/list_models_response_dto.py +2 -2
  129. truefoundry/ml/autogen/client/models/list_run_artifacts_response_dto.py +2 -2
  130. truefoundry/ml/autogen/client/models/list_run_logs_response_dto.py +2 -2
  131. truefoundry/ml/autogen/client/models/local_artifact_source.py +93 -0
  132. truefoundry/ml/autogen/client/models/local_model_source.py +80 -0
  133. truefoundry/ml/autogen/client/models/log_batch_request_dto.py +2 -2
  134. truefoundry/ml/autogen/client/models/log_metric_request_dto.py +2 -2
  135. truefoundry/ml/autogen/client/models/log_param_request_dto.py +2 -2
  136. truefoundry/ml/autogen/client/models/manifest.py +100 -23
  137. truefoundry/ml/autogen/client/models/manifest1.py +219 -0
  138. truefoundry/ml/autogen/client/models/manifest2.py +198 -0
  139. truefoundry/ml/autogen/client/models/method.py +3 -3
  140. truefoundry/ml/autogen/client/models/metric_collection_dto.py +2 -2
  141. truefoundry/ml/autogen/client/models/metric_dto.py +2 -2
  142. truefoundry/ml/autogen/client/models/mime_type.py +2 -2
  143. truefoundry/ml/autogen/client/models/model_configuration.py +7 -7
  144. truefoundry/ml/autogen/client/models/model_dto.py +2 -2
  145. truefoundry/ml/autogen/client/models/model_response_dto.py +2 -2
  146. truefoundry/ml/autogen/client/models/model_server.py +2 -2
  147. truefoundry/ml/autogen/client/models/model_version_dto.py +2 -2
  148. truefoundry/ml/autogen/client/models/model_version_environment.py +5 -5
  149. truefoundry/ml/autogen/client/models/model_version_manifest.py +35 -22
  150. truefoundry/ml/autogen/client/models/model_version_response_dto.py +2 -2
  151. truefoundry/ml/autogen/client/models/multi_part_upload_dto.py +2 -2
  152. truefoundry/ml/autogen/client/models/multi_part_upload_response_dto.py +2 -2
  153. truefoundry/ml/autogen/client/models/multi_part_upload_storage_provider.py +2 -2
  154. truefoundry/ml/autogen/client/models/notify_artifact_version_failure_dto.py +2 -2
  155. truefoundry/ml/autogen/client/models/onnx_framework.py +3 -3
  156. truefoundry/ml/autogen/client/models/openapi_spec.py +3 -3
  157. truefoundry/ml/autogen/client/models/paddle_framework.py +3 -3
  158. truefoundry/ml/autogen/client/models/param_dto.py +2 -2
  159. truefoundry/ml/autogen/client/models/parameters.py +3 -3
  160. truefoundry/ml/autogen/client/models/py_torch_framework.py +3 -3
  161. truefoundry/ml/autogen/client/models/resolve_agent_app_response_dto.py +2 -2
  162. truefoundry/ml/autogen/client/models/restore_run_request_dto.py +2 -2
  163. truefoundry/ml/autogen/client/models/run_data_dto.py +2 -2
  164. truefoundry/ml/autogen/client/models/run_dto.py +2 -2
  165. truefoundry/ml/autogen/client/models/run_info_dto.py +2 -2
  166. truefoundry/ml/autogen/client/models/run_log_dto.py +2 -2
  167. truefoundry/ml/autogen/client/models/run_log_input_dto.py +2 -2
  168. truefoundry/ml/autogen/client/models/run_response_dto.py +2 -2
  169. truefoundry/ml/autogen/client/models/run_tag_dto.py +2 -2
  170. truefoundry/ml/autogen/client/models/search_runs_request_dto.py +2 -2
  171. truefoundry/ml/autogen/client/models/search_runs_response_dto.py +2 -2
  172. truefoundry/ml/autogen/client/models/set_experiment_tag_request_dto.py +2 -2
  173. truefoundry/ml/autogen/client/models/set_tag_request_dto.py +2 -2
  174. truefoundry/ml/autogen/client/models/signed_url_dto.py +2 -2
  175. truefoundry/ml/autogen/client/models/sklearn_framework.py +4 -4
  176. truefoundry/ml/autogen/client/models/sklearn_model_schema.py +7 -5
  177. truefoundry/ml/autogen/client/models/sklearn_serialization_format.py +3 -3
  178. truefoundry/ml/autogen/client/models/source.py +32 -7
  179. truefoundry/ml/autogen/client/models/source1.py +3 -3
  180. truefoundry/ml/autogen/client/models/{internal_metadata.py → source2.py} +52 -55
  181. truefoundry/ml/autogen/client/models/spa_cy_framework.py +3 -3
  182. truefoundry/ml/autogen/client/models/stats_models_framework.py +3 -3
  183. truefoundry/ml/autogen/client/models/stop.py +2 -2
  184. truefoundry/ml/autogen/client/models/store_run_logs_request_dto.py +2 -2
  185. truefoundry/ml/autogen/client/models/subject.py +2 -2
  186. truefoundry/ml/autogen/client/models/subject_type.py +2 -2
  187. truefoundry/ml/autogen/client/models/system_message.py +7 -4
  188. truefoundry/ml/autogen/client/models/tensor_flow_framework.py +3 -3
  189. truefoundry/ml/autogen/client/models/text.py +3 -3
  190. truefoundry/ml/autogen/client/models/text_content_part.py +6 -4
  191. truefoundry/ml/autogen/client/models/transformers_framework.py +5 -5
  192. truefoundry/ml/autogen/client/models/trigger_job_run_config_request_dto.py +2 -2
  193. truefoundry/ml/autogen/client/models/trigger_job_run_config_response_dto.py +2 -2
  194. truefoundry/ml/autogen/client/models/true_foundry_managed_source.py +3 -3
  195. truefoundry/ml/autogen/client/models/update_artifact_version_request_dto.py +5 -7
  196. truefoundry/ml/autogen/client/models/update_dataset_request_dto.py +13 -3
  197. truefoundry/ml/autogen/client/models/update_experiment_request_dto.py +2 -2
  198. truefoundry/ml/autogen/client/models/update_model_version_request_dto.py +2 -2
  199. truefoundry/ml/autogen/client/models/update_run_request_dto.py +2 -2
  200. truefoundry/ml/autogen/client/models/update_run_response_dto.py +2 -2
  201. truefoundry/ml/autogen/client/models/url.py +3 -3
  202. truefoundry/ml/autogen/client/models/user_message.py +8 -5
  203. truefoundry/ml/autogen/client/models/validate_external_storage_root_request_dto.py +2 -2
  204. truefoundry/ml/autogen/client/models/validate_external_storage_root_response_dto.py +2 -2
  205. truefoundry/ml/autogen/client/models/validation_error.py +2 -2
  206. truefoundry/ml/autogen/client/models/validation_error_loc_inner.py +2 -2
  207. truefoundry/ml/autogen/client/models/xg_boost_framework.py +4 -4
  208. truefoundry/ml/autogen/client/models/xg_boost_model_schema.py +7 -5
  209. truefoundry/ml/autogen/client/models/xg_boost_serialization_format.py +3 -3
  210. truefoundry/ml/autogen/client/rest.py +2 -2
  211. truefoundry/ml/autogen/client_README.md +17 -19
  212. truefoundry/ml/autogen/entities/artifacts.py +264 -139
  213. truefoundry/ml/clients/servicefoundry_client.py +3 -2
  214. truefoundry/ml/log_types/artifacts/artifact.py +15 -78
  215. truefoundry/ml/log_types/artifacts/model.py +4 -5
  216. truefoundry/ml/log_types/artifacts/utils.py +18 -2
  217. truefoundry/ml/mlfoundry_api.py +0 -40
  218. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.10rc2.dist-info}/METADATA +1 -1
  219. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.10rc2.dist-info}/RECORD +221 -215
  220. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.10rc2.dist-info}/WHEEL +0 -0
  221. {truefoundry-0.5.10rc1.dist-info → truefoundry-0.5.10rc2.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
2
  # filename: artifacts.json
3
- # timestamp: 2025-01-28T10:54:09+00:00
3
+ # timestamp: 2025-02-26T17:30:50+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -14,6 +14,8 @@ class Method(str, Enum):
14
14
  """
15
15
  +sort=50
16
16
  +uiType=Hidden
17
+ +label=API HTTP Method
18
+ +usage=HTTP Method for the tool call HTTP request
17
19
  """
18
20
 
19
21
  get = "get"
@@ -23,30 +25,44 @@ class Method(str, Enum):
23
25
  patch = "patch"
24
26
 
25
27
 
28
+ class ArtifactPath(BaseModel):
29
+ src: str = Field(
30
+ ..., description="+label=Source path\n+usage=Local file or folder path"
31
+ )
32
+ dest: Optional[str] = Field(
33
+ None,
34
+ description="+label=Destination path\n+usage=Relative path where the file or folder will be uploaded to in the artifact",
35
+ )
36
+
37
+
26
38
  class BaseArtifactVersion(BaseModel):
39
+ name: Optional[constr(regex=r"^[A-Za-z0-9_\-]+$", max_length=256)] = Field(
40
+ None,
41
+ description="+sort=1\n+label=Name\n+message=The name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between\n+usage=Name of the entity",
42
+ )
27
43
  description: Optional[constr(max_length=512)] = Field(
28
44
  None, description="+sort=2\n+label=Description"
29
45
  )
30
46
  metadata: Dict[str, Any] = Field(
31
47
  ...,
32
- description="+label=Metadata\n+docs=Key value pairs to store additional metadata\n+usage=Key value pairs to store additional metadata\n+uiType=JsonInput",
48
+ description='+label=Metadata\n+usage=Key value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`\n+uiType=JsonInput\n+uiProps={"descriptionInline":true}',
33
49
  )
34
50
  version_alias: Optional[
35
51
  constr(regex=r"^v[a-zA-Z0-9.-]*([a-zA-Z0-9]+)$", max_length=128)
36
52
  ] = Field(
37
53
  None,
38
- description="+label=Version Alias\n+usage=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc)\n+docs=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc)\n+message=The version alias should start with 'v' followed by alphanumeric and it can include '.' and '-' in between (e.g. v1.0.0, v1-prod, v3-dev, etc)",
39
- )
40
- name: Optional[constr(regex=r"^[A-Za-z0-9_\-]+$", max_length=256)] = Field(
41
- None,
42
- description="+sort=1\n+label=Name\n+message=The name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between",
54
+ description='+label=Version Alias\n+usage=Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with `v` followed by alphanumeric and it can include `.` and `-` in between (e.g. `v1.0.0`, `v1-prod`, `v3-dev`, etc)\n+message=The version alias should start with `v` followed by alphanumeric and can include `.` and `-` in between (e.g. `v1.0.0`, `v1-prod`, `v3-dev`, etc)\n+uiProps={"descriptionInline":true}\n+placeholder=v1.0.0',
43
55
  )
44
56
  ml_repo: Optional[constr(regex=r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$")] = (
45
57
  Field(
46
58
  None,
47
- description="+label=ML Repo\n+usage=name of the ML Repo\n+docs=name of the ML Repo\n+uiType=Hidden",
59
+ description="+label=ML Repo\n+usage=Name of the ML Repo\n+uiType=Hidden",
48
60
  )
49
61
  )
62
+ version: Optional[conint(ge=1)] = Field(
63
+ None,
64
+ description="+label=Version of the entity\n+usage=Version of the entity\n+uiType=Hidden",
65
+ )
50
66
 
51
67
 
52
68
  class MimeType(str, Enum):
@@ -64,12 +80,12 @@ class MimeType(str, Enum):
64
80
 
65
81
  class BlobStorageReference(BaseModel):
66
82
  """
67
- +usage=Blob Storage Location
68
- +label=Blob Storage Location
83
+ +label=Blob Storage Reference
84
+ +usage=A reference to content offloaded to blob storage
69
85
  +docs=Defines the structure for blob storage content references, including type, path, and mime_type
70
86
  """
71
87
 
72
- type: Literal["blob-storage"]
88
+ type: Literal["blob-storage"] = Field(..., description="+value=blob-storage")
73
89
  path: constr(regex=r"^.{1,}$") = Field(
74
90
  ..., description="+label=Path\n+usage=Path to the content in blob storage"
75
91
  )
@@ -78,23 +94,34 @@ class BlobStorageReference(BaseModel):
78
94
  )
79
95
 
80
96
 
97
+ class Collaborator(BaseModel):
98
+ subject: str = Field(
99
+ ...,
100
+ description="+label=Subject FQN\n+usage=Fully Qualified Name of the subject. eg: user:email or team:teamname",
101
+ )
102
+ role_id: str = Field(
103
+ ..., description="+label=Role ID\n+usage=Role ID for the resource"
104
+ )
105
+
106
+
81
107
  class ExternalBlobStorageSource(BaseModel):
82
108
  """
83
- +label=External Blob Storage
109
+ +label=External Blob Storage Source
84
110
  """
85
111
 
86
112
  type: Literal["external"] = Field(
87
113
  ..., description="+label=Type\n+usage=Type of the source\n+value=external"
88
114
  )
89
115
  uri: str = Field(
90
- ..., description="+label=URI\n+usage=URI of the Blob Storage source"
116
+ ...,
117
+ description="+label=URI\n+usage=URI referencing a path in the blob storage bucket linked to the MLRepo",
91
118
  )
92
119
 
93
120
 
94
121
  class FastAIFramework(BaseModel):
95
122
  """
96
- +docs=FastAI framework for the model version
97
123
  +label=FastAI
124
+ +icon=fastai
98
125
  """
99
126
 
100
127
  type: Literal["fastai"] = Field(
@@ -104,8 +131,8 @@ class FastAIFramework(BaseModel):
104
131
 
105
132
  class GluonFramework(BaseModel):
106
133
  """
107
- +docs=Gluon framework for the model version
108
134
  +label=Gluon
135
+ +icon=gluon
109
136
  """
110
137
 
111
138
  type: Literal["gluon"] = Field(
@@ -115,8 +142,8 @@ class GluonFramework(BaseModel):
115
142
 
116
143
  class H2OFramework(BaseModel):
117
144
  """
118
- +docs=H2O framework for the model version
119
145
  +label=H2O
146
+ +icon=h2o
120
147
  """
121
148
 
122
149
  type: Literal["h2o"] = Field(
@@ -126,8 +153,8 @@ class H2OFramework(BaseModel):
126
153
 
127
154
  class ImageUrl(BaseModel):
128
155
  """
129
- +label=URL for the image
130
- +usage=The URL for the image, must be a non-empty valid HTTPS URL or a data URL
156
+ +label=Image URL
157
+ +usage=Image URL linking to the image
131
158
  """
132
159
 
133
160
  url: Union[
@@ -135,29 +162,27 @@ class ImageUrl(BaseModel):
135
162
  regex=r"^\b((https?://)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?:[-a-zA-Z0-9()@:%_\+.~#?&/=]*)|data:image/[a-zA-Z]+;base64,[a-zA-Z0-9+/=\s]+)$"
136
163
  ),
137
164
  BlobStorageReference,
138
- ] = Field(
139
- ...,
140
- description="+label=URL for the image\n+usage=The URL for the image, must be a non-empty valid HTTPS URL or a data URL",
141
- )
165
+ ] = Field(..., description="+label=URL\n+usage=Image URL linking to the image")
142
166
 
143
167
 
144
168
  class ImageContentPart(BaseModel):
145
169
  """
146
- +usage=Image URL
147
- +label=Image URL
170
+ +label=Image Content
171
+ +usage=Image content for the message
148
172
  """
149
173
 
150
- type: Literal["image_url"]
174
+ type: Literal["image_url"] = Field(
175
+ ..., description="+value=image_url\n+usage=Type of the content part"
176
+ )
151
177
  image_url: ImageUrl = Field(
152
- ...,
153
- description="+label=URL for the image\n+usage=The URL for the image, must be a non-empty valid HTTPS URL or a data URL",
178
+ ..., description="+label=Image URL\n+usage=Image URL linking to the image"
154
179
  )
155
180
 
156
181
 
157
182
  class KerasFramework(BaseModel):
158
183
  """
159
- +docs=Keras framework for the model version
160
184
  +label=Keras
185
+ +icon=keras
161
186
  """
162
187
 
163
188
  type: Literal["keras"] = Field(
@@ -167,8 +192,8 @@ class KerasFramework(BaseModel):
167
192
 
168
193
  class LightGBMFramework(BaseModel):
169
194
  """
170
- +docs=LightGBM framework for the model version
171
195
  +label=LightGBM
196
+ +icon=lightbgm
172
197
  """
173
198
 
174
199
  type: Literal["lightgbm"] = Field(
@@ -176,11 +201,55 @@ class LightGBMFramework(BaseModel):
176
201
  )
177
202
 
178
203
 
204
+ class LocalArtifactSource(BaseModel):
205
+ type: Literal["local"] = Field(
206
+ ..., description="+label=Type\n+usage=Type of the source\n+value=local"
207
+ )
208
+ paths: List[ArtifactPath] = Field(
209
+ ...,
210
+ description="+label=Paths\n+usage=Array of ArtifactPath objects representing the source and destination paths",
211
+ )
212
+
213
+
214
+ class LocalModelSource(BaseModel):
215
+ type: Literal["local"] = Field(
216
+ ..., description="+label=Type\n+usage=Type of the source\n+value=local"
217
+ )
218
+ file_or_folder: str = Field(
219
+ ...,
220
+ description="+label=Path to the model file or folder\n+usage=Path to the model file or folder",
221
+ )
222
+
223
+
224
+ class MLRepo(BaseModel):
225
+ """
226
+ +label=MLRepo
227
+ +usage=MLRepo is a repository ML training runs that log params, metrics, plots, images and versioned entities like artifacts, models, prompts, tools, agents
228
+ """
229
+
230
+ type: Literal["ml-repo"] = Field(..., description="+value=ml-repo")
231
+ name: constr(regex=r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$") = Field(
232
+ ...,
233
+ description="+label=Name\n+icon=fa-desktop:#black\n+usage=Name of the ML Repo.\n+message=Alphanumeric word, may contain '-' with a maximum length of 100 characters\n+sort=1",
234
+ )
235
+ description: Optional[constr(regex=r"^.{0,500}$")] = Field(
236
+ None,
237
+ description='+label=Description\n+icon=fa-desktop:#black\n+usage=Description for the ML Repo.\n+message=Description can be maximum 500 characters\n+sort=2\n+placeholder=MLRepo to track text-classification experiments and models\n+uiProps={"descriptionInline":true}',
238
+ )
239
+ storage_integration_fqn: str = Field(
240
+ ...,
241
+ description="+label=Storage Integration\n+icon=hard-drive\n+usage=Storage Integration to store artifacts and models. A storage integration represents a connected blob storage like AWS S3 / Azure Blob Storage / Google Cloud Storage.\n+message=Select the storage-integration where you want to save your artifacts and models\n[View Docs](https://docs.truefoundry.com/docs/integrations)\n+sort=4",
242
+ )
243
+ collaborators: List[Collaborator] = Field(
244
+ ...,
245
+ description="+label=Collaborators\n+sort=5\n+usage=Users and Teams that have access to MLRepo\n+uiType=Collaborators",
246
+ )
247
+
248
+
179
249
  class Parameters(BaseModel):
180
250
  """
181
- +usage=Parameters for the provider
182
251
  +label=Parameters
183
- +docs=Key-value pairs to store additional parameters for the provider
252
+ +usage=Parameters to pass to the model when generating
184
253
  """
185
254
 
186
255
  max_tokens: Optional[int] = None
@@ -194,49 +263,50 @@ class ModelConfiguration(BaseModel):
194
263
  """
195
264
  +label=Model Configuration
196
265
  +icon=fa-cogs:#326ce5
197
- +message=Configuration details for the provider and corresponding config
198
- +usage=Define the provider and its configuration
199
- +docs=Configuration settings specific to the provider, including model settings and other parameters.
266
+ +usage=Add a model from Gateway along with parameters to be used for chat completion
200
267
  """
201
268
 
202
269
  provider: str = Field(
203
270
  ...,
204
- description='+label=Provider Name\n+usage=Name of the provider, must be non-empty, e.g., "openai", "google_gemini"',
271
+ description='+sort=1000\n+uiType=SelectModelAndProvider\n+uiProps={"isModel": false,"providerJsonKey": "model_configuration.provider","searchable": true}\n+label=Provider Name\n+usage=Name of the provider, must be one of the integration providers configured for the Gateway',
205
272
  )
206
273
  model: constr(regex=r"^[a-zA-Z][a-zA-Z0-9\-]{1,30}[a-zA-Z0-9]$") = Field(
207
- ..., description="+label=Model name\n+usage=Model name, must be non-empty"
274
+ ...,
275
+ description='+sort=1001\n+uiType=SelectModelAndProvider\n+uiProps={"isModel": true,"providerJsonKey": "model_configuration.provider","searchable": true}\n+label=Model Name\n+usage=Name of the model to be used for generations. This model should be available in the provider',
208
276
  )
209
277
  parameters: Optional[Parameters] = Field(
210
278
  None,
211
- description="+usage=Parameters for the provider\n+label=Parameters\n+docs=Key-value pairs to store additional parameters for the provider",
279
+ description="+label=Parameters\n+usage=Parameters to pass to the model when generating",
212
280
  )
213
281
  extra_parameters: Optional[Dict[str, Any]] = Field(
214
282
  None,
215
- description="+usage=Extra parameters for the provider\n+label=Extra Parameters\n+docs=Additional parameters for the provider",
283
+ description="+label=Extra Parameters\n+usage=Arbitrary extra parameters to pass to the model when generating",
216
284
  )
217
285
 
218
286
 
219
287
  class ModelVersionEnvironment(BaseModel):
220
288
  """
221
289
  +label=Environment
290
+ +usage=Runtime environment describing python version and dependencies for running the model
291
+ +uiProps={"descriptionInline":true}
222
292
  """
223
293
 
224
294
  python_version: Optional[constr(regex=r"^\d+(\.\d+){1,2}([\-\.a-z0-9]+)?$")] = (
225
295
  Field(
226
296
  None,
227
- description="+label=Python Version\n+usage=Python version for the model version",
297
+ description="+label=Python Version\n+usage=Python version to use when running the model",
228
298
  )
229
299
  )
230
300
  pip_packages: Optional[List[str]] = Field(
231
301
  None,
232
- description="+label=PIP Packages\n+usage=PIP packages for the model version",
302
+ description="+label=PIP Packages\n+usage=pip dependencies needed for running the model",
233
303
  )
234
304
 
235
305
 
236
306
  class ONNXFramework(BaseModel):
237
307
  """
238
- +docs=ONNX framework for the model version
239
308
  +label=ONNX
309
+ +icon=onnx
240
310
  """
241
311
 
242
312
  type: Literal["onnx"] = Field(
@@ -246,8 +316,8 @@ class ONNXFramework(BaseModel):
246
316
 
247
317
  class PaddleFramework(BaseModel):
248
318
  """
249
- +docs=PaddlePaddle framework for the model version
250
319
  +label=Paddle
320
+ +icon=paddle
251
321
  """
252
322
 
253
323
  type: Literal["paddle"] = Field(
@@ -257,8 +327,8 @@ class PaddleFramework(BaseModel):
257
327
 
258
328
  class PyTorchFramework(BaseModel):
259
329
  """
260
- +docs=PyTorch framework for the model version
261
330
  +label=PyTorch
331
+ +icon=pytorch
262
332
  """
263
333
 
264
334
  type: Literal["pytorch"] = Field(
@@ -278,7 +348,7 @@ class InferMethodName(str, Enum):
278
348
 
279
349
  class SklearnModelSchema(BaseModel):
280
350
  """
281
- +label=Sklearn Model Schema
351
+ +label=Scikit Learn Model Schema
282
352
  """
283
353
 
284
354
  infer_method_name: InferMethodName = Field(
@@ -286,17 +356,19 @@ class SklearnModelSchema(BaseModel):
286
356
  description="+label=Inference Method Name\n+usage=Name of the method used for inference",
287
357
  )
288
358
  inputs: List[Dict[str, Any]] = Field(
289
- ..., description="+label= Input Schema\n+usage=Schema of the input"
359
+ ...,
360
+ description='+label= Input Schema\n+usage=Schema of the input\n+uiProps={"descriptionInline":true}',
290
361
  )
291
362
  outputs: List[Dict[str, Any]] = Field(
292
- ..., description="+label= Output Schema\n+usage=Schema of the output"
363
+ ...,
364
+ description='+label= Output Schema\n+usage=Schema of the output\n+uiProps={"descriptionInline":true}',
293
365
  )
294
366
 
295
367
 
296
368
  class SklearnSerializationFormat(str, Enum):
297
369
  """
298
- +label=Serialization format
299
- +usage=Serialization format used for sklearn models
370
+ +label=Scikit Learn Serialization Format
371
+ +usage=Serialization format used to save the sklearn model
300
372
  """
301
373
 
302
374
  cloudpickle = "cloudpickle"
@@ -306,8 +378,8 @@ class SklearnSerializationFormat(str, Enum):
306
378
 
307
379
  class SpaCyFramework(BaseModel):
308
380
  """
309
- +docs=spaCy framework for the model version
310
381
  +label=SpaCy
382
+ +icon=spacy
311
383
  """
312
384
 
313
385
  type: Literal["spacy"] = Field(
@@ -317,8 +389,8 @@ class SpaCyFramework(BaseModel):
317
389
 
318
390
  class StatsModelsFramework(BaseModel):
319
391
  """
320
- +docs=StatsModels framework for the model version
321
392
  +label=StatsModels
393
+ +icon=statsmodel
322
394
  """
323
395
 
324
396
  type: Literal["statsmodels"] = Field(
@@ -328,14 +400,17 @@ class StatsModelsFramework(BaseModel):
328
400
 
329
401
  class SystemMessage(BaseModel):
330
402
  """
331
- +usage=System message
332
- +docs=Defines the structure of a system message, including role and content
333
403
  +label=System Message
404
+ +usage=System message for the chat
334
405
  """
335
406
 
336
- role: Literal["system"]
407
+ role: Literal["system"] = Field(
408
+ ...,
409
+ description="+value=system\n+label=Role\n+usage=Role of the message\n+uiType=Ignore",
410
+ )
337
411
  content: Union[constr(regex=r"^.[\s\S]*$"), BlobStorageReference] = Field(
338
- ..., description="+label=Content\n+usage=Text content for the system message"
412
+ ...,
413
+ description="+label=Content\n+usage=Text content for the system message\n+uiType=TextArea",
339
414
  )
340
415
  name: Optional[str] = Field(
341
416
  None, description="+label=Name\n+usage=Name of the system"
@@ -344,8 +419,8 @@ class SystemMessage(BaseModel):
344
419
 
345
420
  class TensorFlowFramework(BaseModel):
346
421
  """
347
- +docs=TensorFlow framework for the model version
348
- +label=TensorFlow
422
+ +label=Tensorflow
423
+ +icon=tensorflow
349
424
  """
350
425
 
351
426
  type: Literal["tensorflow"] = Field(
@@ -355,12 +430,16 @@ class TensorFlowFramework(BaseModel):
355
430
 
356
431
  class TextContentPart(BaseModel):
357
432
  """
358
- +usage=Text content
359
- +label=Text content
433
+ +label=Text Content
434
+ +usage=Text content for the message
360
435
  """
361
436
 
362
- type: Literal["text"]
363
- text: Union[constr(regex=r"^.[\s\S]*$"), BlobStorageReference]
437
+ type: Literal["text"] = Field(
438
+ ..., description="+value=text\n+usage=Type of the content part"
439
+ )
440
+ text: Union[constr(regex=r"^.[\s\S]*$"), BlobStorageReference] = Field(
441
+ ..., description="+label=Text\n+usage=Text content for the message"
442
+ )
364
443
 
365
444
 
366
445
  class LibraryName(str, Enum):
@@ -376,9 +455,8 @@ class LibraryName(str, Enum):
376
455
 
377
456
  class TransformersFramework(BaseModel):
378
457
  """
379
- +docs=Transformers framework for the model version
380
458
  +label=Transformers
381
- +value=transformers
459
+ +icon=transformers
382
460
  """
383
461
 
384
462
  type: Literal["transformers"] = Field(
@@ -391,18 +469,17 @@ class TransformersFramework(BaseModel):
391
469
  )
392
470
  pipeline_tag: Optional[str] = Field(
393
471
  None,
394
- description="+label=Pipeline Tag\n+usage=The `pipeline()` task this model can be used with e.g. `text-generation`. See [huggingface docs](https://huggingface.co/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline.task) for all possible values\n+docs=Pipeline tag for the framework",
472
+ description='+label=Pipeline Tag\n+usage=The `pipeline()` task this model can be used with e.g. `text-generation`. See [huggingface docs](https://huggingface.co/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline.task) for all possible values\n+uiProps={"descriptionInline":true}',
395
473
  )
396
474
  base_model: Optional[str] = Field(
397
475
  None,
398
- description="+label=Base Model\n+usage=Base model Id. If this is a finetuned model, this points to the base model used for finetuning\n+docs=Base model Id. If this is a finetuned model, this points to the base model used for finetuning",
476
+ description='+label=Base Model\n+usage=Base model Id from HuggingFace Hub. If this is a finetuned model, this points to the base model id used for finetuning.\n+uiProps={"descriptionInline":true}',
399
477
  )
400
478
 
401
479
 
402
480
  class TrueFoundryManagedSource(BaseModel):
403
481
  """
404
- +usage=Source for the entity
405
- +label=Upload
482
+ +label=TrueFoundry Managed Source
406
483
  """
407
484
 
408
485
  type: Literal["truefoundry"] = Field(
@@ -416,27 +493,30 @@ class TrueFoundryManagedSource(BaseModel):
416
493
 
417
494
  class UserMessage(BaseModel):
418
495
  """
419
- +usage=User message
420
- +docs=Defines the structure of a user message, including role and content
421
496
  +label=User Message
497
+ +usage=User message turn
422
498
  """
423
499
 
424
- role: Literal["user"]
500
+ role: Literal["user"] = Field(
501
+ ..., description="+value=user\n+usage=Role of the message\n+uiType=Ignore"
502
+ )
425
503
  content: Union[
426
504
  constr(regex=r"^.[\s\S]*$"),
427
505
  BlobStorageReference,
428
506
  List[Union[TextContentPart, ImageContentPart]],
429
507
  ] = Field(
430
- ..., description="+label=Content\n+usage=Text content for the user message"
508
+ ...,
509
+ description="+label=Content\n+usage=Content of the user message. can be a mix of text and images\n+uiType=TextArea",
431
510
  )
432
511
  name: Optional[str] = Field(
433
- None, description="+label=Name\n+usage=Name of the user message"
512
+ None, description="+label=Name\n+usage=Name of the user this message is from"
434
513
  )
435
514
 
436
515
 
437
516
  class XGBoostModelSchema(BaseModel):
438
517
  """
439
518
  +label=XGBoost Model Schema
519
+ +usage=Schema of the XGBoost model
440
520
  """
441
521
 
442
522
  infer_method_name: Literal["predict"] = Field(
@@ -444,17 +524,19 @@ class XGBoostModelSchema(BaseModel):
444
524
  description="+label=Inference Method Name\n+usage=Name of the method used for inference",
445
525
  )
446
526
  inputs: List[Dict[str, Any]] = Field(
447
- ..., description="+label= Input Schema\n+usage=Schema of the input"
527
+ ...,
528
+ description='+label= Input Schema\n+usage=Schema of the input\n+uiProps={"descriptionInline":true}',
448
529
  )
449
530
  outputs: List[Dict[str, Any]] = Field(
450
- ..., description="+label= Output Schema\n+usage=Schema of the output"
531
+ ...,
532
+ description='+label= Output Schema\n+usage=Schema of the output\n+uiProps={"descriptionInline":true}',
451
533
  )
452
534
 
453
535
 
454
536
  class XGBoostSerializationFormat(str, Enum):
455
537
  """
456
538
  +label=Serialization format
457
- +usage=Serialization format used for XGBoost models
539
+ +usage=Serialization format used to save the xgboost model
458
540
  """
459
541
 
460
542
  cloudpickle = "cloudpickle"
@@ -464,92 +546,124 @@ class XGBoostSerializationFormat(str, Enum):
464
546
 
465
547
 
466
548
  class Agent(BaseArtifactVersion):
467
- type: Literal["agent"] = Field(..., description="+value=agent")
549
+ type: Literal["agent"] = Field(
550
+ ..., description="+value=agent\n+usage=Type of the entity"
551
+ )
468
552
  available_tools: List[constr(min_length=1)] = Field(
469
- ..., description="+sort=30\n+uiType=Hidden"
553
+ ...,
554
+ description='+sort=30\n+uiType=Hidden\n+label=Tools\n+usage=Tools available to the agent\n+uiProps={"descriptionInline":true}',
470
555
  )
471
556
  goal: constr(min_length=1, max_length=128) = Field(
472
- ..., description="+sort=10\n+uiType=TextArea"
557
+ ...,
558
+ description='+sort=10\n+uiType=TextArea\n+label=Goal\n+usage=Short form description. Will be used as `description` when this agent is used as a tool.\n+uiProps={"descriptionInline":true}',
473
559
  )
474
560
  instruction: constr(min_length=1, max_length=2620) = Field(
475
561
  ...,
476
- description='`instruction` is the system prompt for now. (2.5 * 1024)\n+sort=20\n+uiType=AgentInstructions\n+uiProps={"helpText":"Use the syntax ${Tool FQN} to reference a tool, and ${AGENT FQN} to reference another agent"}',
562
+ description='`instruction` is the system prompt for now. (2.5 * 1024)\n+sort=20\n+uiType=AgentInstructions\n+uiProps={"helpText":"Use the syntax ${Tool FQN} to reference a tool, and ${AGENT FQN} to reference another agent"}\n+label=Instructions\n+usage=Instructions for the agent to follow to achieve the goal\n+uiProps={"descriptionInline":true}',
477
563
  )
478
564
  model_id: constr(min_length=1) = Field(
479
565
  ...,
480
- description='+sort=40\n+uiType=EnabledModelSelector\n+uiProps={"searchable":true,"modelType":"chat","providerType":"openai"}',
566
+ description='+sort=40\n+uiType=EnabledModelSelector\n+uiProps={"searchable":true,"modelType":"chat","providerType":"openai"}\n+label=Model\n+usage=Model to use when running the agent',
481
567
  )
482
568
 
483
569
 
484
570
  class AgentOpenAPITool(BaseArtifactVersion):
485
- type: Literal["openapi-tool"] = Field(..., description="+value=openapi-tool")
571
+ type: Literal["openapi-tool"] = Field(
572
+ ..., description="+value=openapi-tool\n+usage=Type of the agent"
573
+ )
486
574
  openapi_spec: Union[BlobStorageReference, Dict[str, Any]] = Field(
487
- ..., description="+sort=20\n+uiType=OpenapiSchema"
575
+ ...,
576
+ description='+sort=20\n+uiType=OpenapiSchema\n+label=OpenAPI Spec\n+usage=OpenAPI Spec for the tool describing the API, endpoints and parameters. [Sample OpenAPI Spec Link](https://assets.production.truefoundry.com/sample-openapi.json)\n+uiProps={"descriptionInline":true}\n+placeholder={"openapi":"3.0.0","info":{"title":"LLM Agent Tools API","version":"1.0.0"},"servers":[{"url":"https://api.example.com/v1"}],"paths":{"/weather":{"get":{"summary":"Get current weather","description":"Fetches the current weather for a given location.","parameters":[{"name":"location","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"location":{"type":"string"},"temperature":{"type":"number"},"condition":{"type":"string"}}}}}}}}}}}',
488
577
  )
489
578
  base_url: constr(
490
579
  regex=r"^(https?://)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(?:[-a-zA-Z0-9()@:%_\+.~#?&/=]*)$"
491
- ) = Field(..., description="+sort=30")
580
+ ) = Field(
581
+ ...,
582
+ description='+sort=30\n+label=Base URL\n+usage=HTTP endpoint where the API is hosted for the tools. E.g. `https://api.example.com/v1`\n+uiProps={"descriptionInline":true}\n+placeholder=https://api.example.com/v1',
583
+ )
492
584
  path: constr(min_length=1) = Field(
493
585
  ...,
494
- description="+sort=40\n+uiType=MethodPathSelector\n+label=Method + Path\n+usage=Select one Method and Path for this tool",
586
+ description='+sort=40\n+uiType=MethodPathSelector\n+label=API Route Path\n+usage=API Route Path for the tool call HTTP request. E.g. `GET /weather`\n+uiProps={"descriptionInline":true}',
587
+ )
588
+ method: Method = Field(
589
+ ...,
590
+ description="+sort=50\n+uiType=Hidden\n+label=API HTTP Method\n+usage=HTTP Method for the tool call HTTP request",
495
591
  )
496
- method: Method = Field(..., description="+sort=50\n+uiType=Hidden")
497
592
  headers: Optional[Dict[str, str]] = Field(
498
593
  None,
499
- description='+sort=60\n+uiType=KV\n+uiProps={"allowSecrets":true,"secretConfig":{"enableNew":true,"hideOptions":true}}',
594
+ description='+sort=60\n+uiType=KV\n+uiProps={"allowSecrets":true,"secretConfig":{"enableNew":true,"hideOptions":true}}\n+label=Headers\n+usage=HTTP Headers for the tool call HTTP request. E.g. `Authorization: Bearer <token>`\n+uiProps={"descriptionInline":true}',
500
595
  )
501
596
 
502
597
 
503
598
  class AgentOpenAPIToolWithFQN(AgentOpenAPITool):
504
- id: str
505
- fqn: str
599
+ id: str = Field(..., description="+usage=ID of the agent tool")
600
+ fqn: str = Field(..., description="+usage=FQN of the agent tool")
506
601
 
507
602
 
508
603
  class AgentWithFQN(Agent):
509
- id: str
510
- fqn: str
604
+ id: str = Field(..., description="+usage=ID of the agent")
605
+ fqn: str = Field(..., description="+usage=FQN of the agent")
511
606
 
512
607
 
513
608
  class ArtifactVersion(BaseArtifactVersion):
609
+ """
610
+ +label=Artifact Version
611
+ +usage=Log a new Artifact Version containing files and folders with metadata
612
+ """
613
+
514
614
  type: Literal["artifact-version"] = Field(
515
- ...,
516
- description='+label=Type\n+usage=Artifact Version\n+value="artifact-version"',
615
+ ..., description="+label=Type\n+usage=Artifact Version\n+value=artifact-version"
517
616
  )
518
- source: Union[TrueFoundryManagedSource, ExternalBlobStorageSource] = Field(
519
- ...,
520
- description="+label=Artifact Source\n+usage=Source for the Artifact version\n+uiType=Group",
617
+ source: Union[
618
+ TrueFoundryManagedSource, ExternalBlobStorageSource, LocalArtifactSource
619
+ ] = Field(..., description="+label=Artifact Source\n+uiType=Group")
620
+ step: conint(ge=0) = Field(
621
+ 0,
622
+ description='+label=Step\n+usage=Step/Epoch number in an iterative training loop the artifact version was created. Generally useful when logging a model version from a MLRepo Run\n+uiProps={"descriptionInline":true}',
623
+ )
624
+ run_id: Optional[str] = Field(
625
+ None,
626
+ description="+label=Run ID\n+usage=ID of the MLRepo Run that generated the artifact version\n+uiType=Hidden",
521
627
  )
522
- step: conint(ge=0) = Field(0, description="+label=Step")
523
628
 
524
629
 
525
630
  class AssistantMessage(BaseModel):
526
631
  """
527
- +usage=Assistant message
528
- +docs=Defines the structure of an assistant message, including role and content
529
632
  +label=Assistant Message
633
+ +usage=Assistant message turn
530
634
  """
531
635
 
532
- role: Literal["assistant"]
636
+ role: Literal["assistant"] = Field(
637
+ ...,
638
+ description="+value=assistant\n+label=Role\n+usage=Role of the message\n+uiType=Ignore",
639
+ )
533
640
  content: Union[constr(regex=r"^.[\s\S]*$"), BlobStorageReference] = Field(
534
- ..., description="+label=Content\n+usage=Text content for the assistant message"
641
+ ...,
642
+ description="+label=Content\n+usage=Text content for the assistant message\n+uiType=TextArea",
535
643
  )
536
644
  name: Optional[str] = Field(
537
- None, description="+label=Name\n+usage=Name of the assistant message"
645
+ None,
646
+ description="+label=Name\n+usage=Name of the assistant this message is from",
538
647
  )
539
648
 
540
649
 
541
650
  class ChatPrompt(BaseArtifactVersion):
651
+ """
652
+ +label=Chat Prompt
653
+ +usage=Fill in the information for opening a new chat prompt
654
+ """
655
+
542
656
  type: Literal["chat_prompt"] = Field(
543
657
  ...,
544
- description='+label=Type\n+icon=fa-desktop:#326ce5\n+message=Type of the prompt\n+sort=3000\n+usage=Type of the prompt\n+docs=Type of the prompt, set to "chat_prompt"\n+default="chat_prompt"',
658
+ description="+label=Type\n+icon=fa-desktop:#326ce5\n+sort=3000\n+usage=Type of the prompt\n+value=chat_prompt",
545
659
  )
546
660
  messages: List[Union[SystemMessage, AssistantMessage, UserMessage]] = Field(
547
661
  ...,
548
- description="+sort=4000\n+usage=Chat completion messages\n+label=Messages in the chat conversation\n+message=Chat completion messages\n+usage=List of messages in the chat conversation, must be non-empty\n+docs=Messages that define the chat conversation, including system, assistant, and user messages.",
662
+ description="+sort=4000\n+label=Messages in the chat conversation\n+usage=List of messages in the chat conversation, must be non-empty",
549
663
  )
550
664
  variables: Optional[Dict[str, Optional[str]]] = Field(
551
665
  None,
552
- description="+label=Variables\n+usage=Variables for the chat completion messages to be used in the prompt messages\n+sort=5000",
666
+ description="+label=Variables\n+usage=Variables referenced in messages and that can be replaced when running generation\n+sort=5000",
553
667
  )
554
668
  model_configuration: ModelConfiguration
555
669
 
@@ -559,36 +673,32 @@ class DataDirectory(BaseModel):
559
673
  +label=Data Directory
560
674
  """
561
675
 
562
- type: Literal["data-dir"] = Field(
676
+ type: Literal["data-dir"] = Field(..., description="+label=Type\n+value=data-dir")
677
+ name: constr(regex=r"^[A-Za-z0-9_\-]+$", max_length=256) = Field(
563
678
  ...,
564
- description='+label=Type\n+usage=Data Directory\n+docs=Data Directory\n+value="data-dir"',
679
+ description="+sort=1\n+label=Name\n+usage=Name of the data directory\n+message=The data directory name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between",
680
+ )
681
+ ml_repo: constr(regex=r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$") = Field(
682
+ ...,
683
+ description="+label=MLRepo\n+usage=Name of the ML Repo to create the data directory under\n+uiType=Hidden",
565
684
  )
566
685
  description: Optional[constr(max_length=512)] = Field(
567
686
  None,
568
- description="+label=Description\n+usage=Description of the data directory\n+docs=Description of the data directory",
687
+ description="+sort=2\n+label=Description\n+usage=Description for the data directory",
569
688
  )
570
689
  metadata: Dict[str, Any] = Field(
571
690
  ...,
572
- description="+label=Metadata\n+docs=Metadata for the data directory\n+usage=Metadata for the data directory\n+uiType=JsonInput",
573
- )
574
- name: constr(regex=r"^[A-Za-z0-9_\-]+$", max_length=256) = Field(
575
- ...,
576
- description="+sort=1\n+label=Name\n+usage=Name of the data directory\n+docs=Name of the data directory\n+message=The data directory name should start with lowercase alphabets and can contain alphanumeric and can include '-' in between",
577
- )
578
- ml_repo: constr(regex=r"^[a-zA-Z][a-zA-Z0-9\-]{1,98}[a-zA-Z0-9]$") = Field(
579
- ...,
580
- description="+label=ML Repo\n+usage=name of the ML Repo of the data directory\n+docs=name of the ML Repo of the data directory\n+uiType=Hidden",
691
+ description='+label=Metadata\n+usage=Key Value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}`\n+uiType=JsonInput',
581
692
  )
582
693
  source: Union[TrueFoundryManagedSource, ExternalBlobStorageSource] = Field(
583
- ...,
584
- description="+label=Data Directory Source\n+usage=Source for the Data Directory\n+docs=Source for the Data Directory\n+uiType=Group",
694
+ ..., description="+label=Data Directory Source\n+uiType=Group"
585
695
  )
586
696
 
587
697
 
588
698
  class SklearnFramework(BaseModel):
589
699
  """
590
- +docs=Scikit-learn framework for the model version
591
700
  +label=Sklearn
701
+ +icon=sklearn
592
702
  """
593
703
 
594
704
  type: Literal["sklearn"] = Field(
@@ -596,7 +706,7 @@ class SklearnFramework(BaseModel):
596
706
  )
597
707
  model_filepath: Optional[str] = Field(
598
708
  None,
599
- description="+label=Model file path\n+usage=Relative path to the model file",
709
+ description='+label=Model file path\n+usage=Relative path to the model file in the model version contents\n+uiProps={"descriptionInline":true}',
600
710
  )
601
711
  serialization_format: Optional[SklearnSerializationFormat] = None
602
712
  model_schema: Optional[SklearnModelSchema] = None
@@ -604,8 +714,8 @@ class SklearnFramework(BaseModel):
604
714
 
605
715
  class XGBoostFramework(BaseModel):
606
716
  """
607
- +docs=XGBoost framework for the model version
608
717
  +label=XGBoost
718
+ +icon=xgboost
609
719
  """
610
720
 
611
721
  type: Literal["xgboost"] = Field(
@@ -614,26 +724,39 @@ class XGBoostFramework(BaseModel):
614
724
  serialization_format: Optional[XGBoostSerializationFormat] = None
615
725
  model_filepath: Optional[str] = Field(
616
726
  None,
617
- description="+label=Model file path\n+usage=Relative path to the model file",
727
+ description="+label=Model file path\n+usage=Relative path to the model file in the model version contents",
618
728
  )
619
729
  model_schema: Optional[XGBoostModelSchema] = None
620
730
 
621
731
 
622
732
  class AgentApp(BaseModel):
623
- type: Literal["agent-app"] = Field(..., description="+value=agent-app")
624
- tools: List[AgentOpenAPIToolWithFQN]
625
- agents: List[AgentWithFQN]
626
- root_agent: constr(min_length=1)
733
+ type: Literal["agent-app"] = Field(
734
+ ..., description="+value=agent-app\n+usage=Type of the app"
735
+ )
736
+ tools: List[AgentOpenAPIToolWithFQN] = Field(
737
+ ..., description="+label=Tools\n+usage=Tools available to the Agent app"
738
+ )
739
+ agents: List[AgentWithFQN] = Field(
740
+ ..., description="+label=Agents\n+usage=Agents available to the Agent app"
741
+ )
742
+ root_agent: constr(min_length=1) = Field(
743
+ ...,
744
+ description="+label=Root Agent\n+usage=Root Agent for the app. This will be the first agent invoked",
745
+ )
627
746
 
628
747
 
629
748
  class ModelVersion(BaseArtifactVersion):
749
+ """
750
+ +label=Artifact Version
751
+ +usage=Log a new Model Version containing model files and folders with metadata
752
+ """
753
+
630
754
  type: Literal["model-version"] = Field(
631
- ..., description='+label=Type\n+usage=Model Version\n+value="model-version"'
632
- )
633
- source: Union[TrueFoundryManagedSource, ExternalBlobStorageSource] = Field(
634
- ...,
635
- description="+label=Model Source\n+usage=Source for the model version\n+uiType=Group",
755
+ ..., description="+label=Type\n+usage=Model Version\n+value=model-version"
636
756
  )
757
+ source: Union[
758
+ TrueFoundryManagedSource, ExternalBlobStorageSource, LocalModelSource
759
+ ] = Field(..., description="+label=Model Source\n+uiType=Group")
637
760
  framework: Optional[
638
761
  Union[
639
762
  TransformersFramework,
@@ -652,19 +775,21 @@ class ModelVersion(BaseArtifactVersion):
652
775
  PaddleFramework,
653
776
  ]
654
777
  ] = Field(
655
- None, description="+label=Framework\n+usage=Framework for the model version"
778
+ None,
779
+ description='+label=Framework\n+usage=Framework for the model version like Transformers, PyTorch, Sklearn, Xgboost etc with framework specific metadata. This will be used to infer model deployment configuration\n+uiProps={"descriptionInline":true}',
656
780
  )
657
781
  environment: Optional[ModelVersionEnvironment] = None
658
- step: conint(ge=0) = Field(0, description="+label=Step")
782
+ step: conint(ge=0) = Field(
783
+ 0,
784
+ description='+label=Step\n+usage=Step/Epoch number in an iterative training loop the model version was created. Generally useful when logging a model version from a MLRepo Run\n+uiProps={"descriptionInline":true}',
785
+ )
786
+ run_id: Optional[str] = Field(
787
+ None,
788
+ description="+label=Run ID\n+usage=ID of the MLRepo Run that generated the model version\n+uiType=Hidden",
789
+ )
659
790
 
660
791
 
661
792
  class VersionedArtifactType(BaseModel):
662
793
  __root__: Union[
663
- ChatPrompt,
664
- AgentOpenAPITool,
665
- Agent,
666
- AgentApp,
667
- ModelVersion,
668
- ArtifactVersion,
669
- DataDirectory,
794
+ ArtifactVersion, ModelVersion, ChatPrompt, AgentOpenAPITool, Agent, AgentApp
670
795
  ]