def get_model()

in dell_ai/models.py [0:0]


def get_model(client: "DellAIClient", model_id: str) -> Model:
    """
    Get detailed information about a specific model.

    Args:
        client: The Dell AI client
        model_id: The model ID in the format "organization/model_name"

    Returns:
        Detailed model information as a Model object

    Raises:
        ValidationError: If the model_id format is invalid
        ResourceNotFoundError: If the model is not found
        AuthenticationError: If authentication fails
        APIError: If the API returns an error
    """
    # Validate model_id format
    if "/" not in model_id:
        raise ValidationError(
            "Invalid model ID format. Expected format: 'organization/model_name'",
            parameter="model_id",
        )

    try:
        endpoint = f"{constants.MODELS_ENDPOINT}/{model_id}"
        response = client._make_request("GET", endpoint)

        # Process configsDeploy to convert nested dictionaries to ModelConfig objects
        if "configsDeploy" in response and response["configsDeploy"]:
            for platform, configs in response["configsDeploy"].items():
                response["configsDeploy"][platform] = [
                    ModelConfig.model_validate(config) for config in configs
                ]

        # Create a Model object from the response
        return Model.model_validate(response)
    except ResourceNotFoundError:
        # Reraise with more specific information
        raise ResourceNotFoundError("model", model_id)