You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: outlier.go
    path of file: ./repos/grafana/pkg/expr/ml
    
    the code of the file until where you have to start completion: package ml

import (
	"fmt"
	"net/http"
	"time"

	"github.com/grafana/grafana-plugin-sdk-go/backend"

	"github.com/grafana/grafana/pkg/api/response"
)

// OutlierCommand implements Command that sends a request to outlier proxy API and converts response to backend.QueryDataResponse
type OutlierCommand struct {
	config   OutlierCommandConfiguration
	appURL   string
	interval time.Duration
}

    
func unmarshalOutlierCommand(expr CommandConfiguration, appURL string) (*OutlierCommand, error) {
	var cfg OutlierCommandConfiguration
	err := json.Unmarshal(expr.Config, &cfg)
	if err != nil {
		return nil, fmt.Errorf("failed to unmarshal outlier command: %w", err)
	}
	if len(cfg.DatasourceUID) == 0 {
		return nil, fmt.Errorf("required field `config.datasource_uid` is not specified")
	}

	if len(cfg.Query) == 0 && len(cfg.QueryParams) == 0 {
		return nil, fmt.Errorf("neither of required fields `config.query_params` or `config.query` are specified")
	}

	if len(cfg.ResponseType) == 0 {
		return nil, fmt.Errorf("required field `config.response_type` is not specified")
	}

	if len(cfg.Algorithm) == 0 {
		return nil, fmt.Errorf("required field `config.algorithm` is not specified")
	}

	interval := defaultInterval
	if expr.IntervalMs != nil {
		i := time.Duration(*expr.IntervalMs) * time.Millisecond
		if i > 0 {
			interval = i
		}
	}

	return &OutlierCommand{
		config:   cfg,
		interval: interval,
		appURL:   appURL,
	}, nil
}