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: chat_messages.go
    path of file: ./repos/langchaingo/schema
    
    the code of the file until where you have to start completion: package schema

import (
	"encoding/json"
	"errors"
	"fmt"
	"strings"
)

// ChatMessageType is the type of chat message.
t
    
func getMessageRole(m ChatMessage, humanPrefix, aiPrefix string) (string, error) {
	var role string
	switch m.GetType() {
	case ChatMessageTypeHuman:
		role = humanPrefix
	case ChatMessageTypeAI:
		role = aiPrefix
	case ChatMessageTypeSystem:
		role = "System"
	case ChatMessageTypeGeneric:
		cgm, ok := m.(GenericChatMessage)
		if !ok {
			return "", fmt.Errorf("%w -%+v", ErrUnexpectedChatMessageType, m)
		}
		role = cgm.Role
	case ChatMessageTypeFunction:
		role = "Function"
	default:
		return "", ErrUnexpectedChatMessageType
	}
	return role, nil
}