Fetch AI assets details

Important

The get_model() function retrieves detailed information about both wml and external models, providing users with versatile model management capabilities.

Model Asset

get_model(self, model_id: str = None, container_type: str = None, container_id: str = None, wml_stored_model_details: dict = None)

Get model asset.

Parameters:
  • model_id (str) – (Optional) Id of the traditional machine learning model asset.

  • container_type (str) – (Optional) Name of the container where model is saved. Currently supported container_type are space or project. For external models it is not needed and defaulted to catalog.

  • container_id (str) – (Optional) Id of the container where model asset is saved. For external models, it refers to catalog id where model stub is saved. if not provided for external models,if available and user have access, default platform asset catalog is used

  • wml_stored_model_details (dict) – (Optional) Watson machine learning model details. Applied to Watson Machine Learning models only.

Return type:

ModelAssetUtilities

The way to use me is:

>>> client.assets.get_model(model_id=<model_id>) # uses container type and id used to initiate client
>>> client.assets.get_model(model_id=<model id>,container_type=<space or project>,container_id=<space or project id>)
>>> client.assets.get_model(wml_stored_model_details=<wml model details>) # uses model id, container type and id part of model details

for external models,

>>> client.assets.get_model(model_id=<model_id>) # uses available platform asset catalog id as container_id
>>> client.assets.get_model(model_id=<model_id>,container_id=<catalog id>)

Prompt Asset

get_prompt(self, prompt_id: str = None, container_type: str = None, container_id: str = None) AIGovAssetUtilities

Get prompt asset.

Parameters:
  • prompt_id (str) – Id of the prompt asset.

  • container_type (str) – Name of the container where prompt is saved. Currently supported container_type are space or project.

  • container_id (str) – Id of the container where prompt asset is saved.

Return type:

AIGovAssetUtilities

The way to use me is:

>>> client.assets.get_prompt(prompt_id=<prompt_id>,container_type=<project>,container_id=<project id>)