ibm_aigov_facts_client.factsheet.asset_utils_me_prompt module

class AIUsecaseUtilities(assets_client: Assets, model_id: str = None, ai_usecase_name: str = None, model_usecase_id: str = None, container_type: str = None, container_id: str = None, facts_type: str = None)

Bases: ModelUsecaseUtilities

AI use case utilities. Running client.assets.get_ai_usecase() makes all methods in AIUsecaseUtilities object available to use.

classmethod from_dict(_dict: Dict) AIUsecaseUtilities

Initialize a AIUsecaseUtilities object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

get_info(verbose=False) Dict

Get AI usecase details

Parameters:

verbose (bool, optional) – If True, returns additional model details. Defaults to False

Return type:

dict

The way to use me is:

>>> get_ai_usecase.get_info()
>>> get_ai_usecase.get_info(verbose=True)
create_approach(name: str = None, description: str = None, icon: str = None, color: str = None) ApproachUtilities

Returns WKC Model usecase approach. Supported for CPD version >=4.7.0

Parameters:
  • name (str) – Name of approach

  • description (str) – (Optional) Description of approach

  • icon (str) – (Optional) Approach’s icon Available options are in Icon

  • color (str) – (Optional) Approach’s color,Available options are in Color

Return type:

ApproachUtilities

Returns:

WKC Model usecase approach

Example,:

ai_usecase.create_approach(name=<approach name>,description=<approach description>,icon=<approach icon>,color=<approach color>)
ai_usecase.create_approach(name=<approach name>)
list_all_associated_workspaces() None

Lists all Associated Workspaces for a given AI usecase in tabular format. The method will display the Associated Workspaces for all the phases.

Returns:

None

Example,::

client.assets.model_usecase.get_associated_workspaces(model_usecase_id=<model usecase id>,catalog_id=<model inventory id>))

list_associated_workspaces_by_phase(phase_name: Phases = None) list

Lists all Associated Workspaces for a given AI usecase in tabular format. The method will display the filtered Associated Workspaces , filtered by the phase name passed

:param phase_name : phase name. Available options are in Phases

Returns:

list

Example,::

client.assets.model_usecase.get_associated_workspaces(model_usecase_id=<model usecase id>,catalog_id=<model inventory id>, phase_name=<valid phase name>))

add_workspaces_associations(ai_usecase_id: str = None, catalog_id: str = None, workspace_id: str = None, workspace_type: str = None, phase_name: str = None)

Associate a workspace to a particular AI usecase under a specified phase

:param workspace_id:project id or space id which needs to associated to the selected usecase :param workspace_type: should be “project” when passing “project id” as workspace_id , if space id is passed for workspace_id,the workspace_type will be “space” :param phase_name:phase name, should be one of ‘develop’,’validate’ and ‘operate’. Available options are in Phases

:return:None

Example,:

# client.assets.model_usecase.add_workspaces_associations(model_usecase_id=<model usecase id>,catalog_id=<model inventory id>, phase_name=<valid phase name>, workspace_id=<project or space id>, workspace_type=<"project" or "space">)
remove_workspace_associations(workspace_ids: list = None) None

Removes association of one or more workspaces at once from a particular AI usecase, irrespective of the phase they are in. The disassocation works only if there are no tracked assets in the workspace(s) to be removed. User should have edit access to the usecase.

Parameters:

workspace_ids – list of workspace ids to be disassociated. eg: workspace_ids=[project_id_1, space_id_1]

:return:None

Example,:

client.assets.model_usecase.remove_workspace_associations(model_usecase_id=<model usecase id>,catalog_id=<model inventory id>, workspace_ids=<list of project or space id>)