ibm_aigov_facts_client.supporting_classes.factsheet_utils module

class ExternalModelSchemas(input: List[Dict], output: List[Dict] = None)

Bases: object

External model schema

Variables:
  • input (List[Dict]) – Model input data schema

  • output (List[Dict]) – (optional) Model output data schema

classmethod from_dict(_dict: Dict) ExternalModelSchemas

Initialize a DeploymentDetails object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class TrainingDataReference(type: str = None, id: str = None, connection: Dict = None, location: Dict = None, schema: Dict = None)

Bases: object

Training data schema definition

Variables:
  • type (str) – Type of training data reference. It has values as fs, url, data_asset or connection_asset.

  • id (str) – ID of training data reference.

  • connection (Dict) – (Optional) Connection details

  • location (Dict) – (Optional) Location details

  • schema (Dict) – Model training data schema

If type is fs, the parameters that user needs to input are - location.path If type is url, the parameters that user needs to provide are - training_data_references[].id and connection.url If type is data_asset, then - location.href If type is connection_asset, then location.file_name or location.table_name, connection.href

classmethod from_dict(_dict: Dict) TrainingDataReference

Initialize a TrainingDataReference object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class DeploymentDetails(identifier: str, name: str, deployment_type: str, scoring_endpoint: str = None, description: str = None)

Bases: object

External model deployment details

Variables:
  • identifier (str) – Deployment identifier specific to providers.

  • name (str) – Name of the deployment

  • deployment_type (str) – Deployment type (i.e., online)

  • scoring_endpoint (str) – Deployment scoring endpoint url.

  • description (str) – (Optional) Description of the deployment

classmethod from_dict(_dict: Dict) DeploymentDetails

Initialize a DeploymentDetails object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class ModelEntryProps(model_entry_catalog_id: str, asset_id: str = None, model_catalog_id: str = None, model_entry_id: str = None, model_entry_name: str = None, model_entry_desc: str = None, project_id: str = None, space_id: str = None, grc_model_id: str = None)

Bases: object

Model usecase Properties

Variables:
  • model_entry_catalog_id (str) – Catalog ID where model usecase exist.

  • asset_id (str) – Published model/asset ID. It is optional for external models ONLY.

  • model_catalog_id (str) – (Optional) Catalog Id where model exist.

  • model_entry_id (str) – (Optional) Existing Model usecase to link with.

  • model_entry_name (str) – (Optional) New model usecase name. Used only when creating new model usecase.

  • model_entry_description (str) – (Optional) New model usecase description. Used only when creating new model usecase.

  • project_id (str) – (Optional) Project ID where the model exist.Not applicable for external models.

  • space_id (str) – (Optional) Space ID where model exist Not applicable for external models.

  • grc_model_id (str) – (Optional) Openpages model id. Only applicable for CPD environments.

classmethod from_dict(_dict: Dict) ModelEntryProps

Initialize a ModelEntryProps object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class ModelDetails(model_type: str = None, input_type: str = None, algorithm: str = None, label_type: str = None, label_column: str = None, prediction_type: str = None, software_spec: str = None, software_spec_id: str = None, provider: str = None)

Bases: object

External model model details

Variables:
  • model_type (str) – Value for model type

  • input_type (str) – Value for inout type

  • algorithm (str) – Value for algorithm

  • label_type (str) – Value for label type

  • label_column (str) – Value for label column

  • prediction_type (str) – Value for prediction type

  • software_spec (str) – Value for software_spec

  • software_spec_id (str) – Value for software_spec_id

  • provider (str) – Value for provider,Available options are in Provider

classmethod from_dict(_dict: Dict) ModelDetails

Initialize a ModelDetails object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class PromptTemplate(model_version: dict = None, prompt_variables: dict = None, prompt_instruction: str = None, input_prefix: str = None, output_prefix: str = None, structured_examples: dict = None, input: str = None, model_parameters: dict = None)

Bases: object

Details of a PromptTemplate

Variables:
  • model_version (dict) – (Optional) Model version information and their respective values.

  • prompt_variables (dict) – (Optional) Values for prompt variables in the format {prompt_variable: value}.

  • prompt_instruction (str) – (Optional) Instruction for using the prompt.

  • input_prefix (str) – (Optional) Prefix for input data.

  • output_prefix (str) – (Optional)Prefix for output data.

  • structured_examples (dict) – (Optional) Values of examples in the format {example_input: example_output}.

  • input_prompt (str) – (Optional)Prompt input value.

  • model_parameters (dict) – (Optional)Model parameters and their respective values.

classmethod from_dict(_dict: Dict) PromptTemplate

Initialize a ModelDetails object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.

class DetachedPromptTemplate(prompt_id: str, model_id: str, model_provider: str, model_name: str = None, model_url: str = None, prompt_url: str = None, prompt_additional_info: list = None)

Bases: object

Details of a detached prompt template.

Variables:
  • prompt_id (str) – ID of the external prompt.

  • model_id (str) – ID of the external model associated with the prompt.

  • model_provider (str) – Provider of the external model.

  • model_name (str) – (Optional) Name of the external model (optional).

  • model_url (str) – URL of the external model (optional).

  • prompt_url (str) – URL of the external prompt (optional).

  • prompt_additional_info (dict) – Additional information related to the external prompt (optional).

classmethod from_dict(_dict: Dict) DetachedPromptTemplate

Initialize a ModelDetails object from a json dictionary.

to_dict() Dict

Return a json dictionary representing this model.