else None,
                "token": values["token"].get_secret_value()
                if values["token"]
                else None,
                "password": values["password"].get_secret_value()
                if values["password"]
                else None,
                "username": values["username"].get_secret_value()
                if values["username"]
                else None,
                "instance_id": values["instance_id"].get_secret_value()
                if values["instance_id"]
                else None,
                "version": values["version"].get_secret_value()
                if values["version"]
                else None,
            }
            credentials_without_none_value = {
                key: value for key, value in credentials.items() if value is not None
            }
            watsonx_model = Model(
                model_id=values["model_id"],
                credentials=credentials_without_none_value,
                params=values["params"],
                project_id=values["project_id"],
                space_id=values["space_id"],
                verify=values["verify"],
            )
            values["watsonx_model"] = watsonx_model
        except ImportError:
            raise ImportError(
                "Could not import ibm_watson_machine_learning python package. "
                "Please install it with `pip install ibm_watson_machine_learning`."
            )
        return values
    @property
    def _identifying_params(self) -> Mapping[str, Any]:
        """Get the identifying parameters."""
        return {
            "model_id": self.model_id,
            "params": self.params,
            "project_id": self.project_id,
            "space_id": self.space_id,
        }
    @property
    def _llm_type(self) -> str:
        """Return type of llm."""