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: relay.go
    path of file: ./repos/chainlink/core/services/relay
    
    the code of the file until where you have to start completion: package relay

import (
	"context"
	"fmt"
	"regexp"

	"github.com/smartcontractkit/chainlink-common/pkg/loop"
	"github.com/smartcontractkit/chainlink-common/pkg/types"
)

type Network = string
type ChainID = string

const (
	EVM      = "evm"
	Cosmos   = "cosmos"
	Solana   = "solana"

    
func (r *ServerAdapter) NewPluginProvider(ctx context.Context, rargs types.RelayArgs, pargs types.PluginArgs) (types.PluginProvider, error) {
	switch types.OCR2PluginType(rargs.ProviderType) {
	case types.Median:
		return r.NewMedianProvider(ctx, rargs, pargs)
	case types.Functions:
		return r.NewFunctionsProvider(ctx, rargs, pargs)
	case types.Mercury:
		return r.NewMercuryProvider(ctx, rargs, pargs)
	case types.OCR2Keeper:
		return r.NewAutomationProvider(ctx, rargs, pargs)
	case types.DKG, types.OCR2VRF, types.GenericPlugin:
		return r.RelayerAdapter.NewPluginProvider(ctx, rargs, pargs)
	case types.LLO, types.CCIPCommit, types.CCIPExecution:
		return nil, fmt.Errorf("provider type not supported: %s", rargs.ProviderType)
	}
	return nil, fmt.Errorf("provider type not recognized: %s", rargs.ProviderType)
}