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: ai.go
    path of file: ./repos/slashbase/internal/common/controllers
    
    the code of the file until where you have to start completion: package controllers

import (
	"errors"

	"github.com/slashbaseide/slashbase/internal/common/dao"
	"github.com/slashbaseide/slashbase/pkg/ai"
	"github.com/slashbaseide/slashbase/pkg/queryengines"
	qemodels "github.com/slashbaseide/slashbase/pkg/queryengines/models"
)

type AIController struct{}

func (AIController) GenerateSQL(dbConnectionID, text string) (string, error) {

	dbConn, err := dao.DBConnection.GetDBConnectionByID(dbConnectionID)
	if err 
    
func (AIController) GenerateSQL(dbConnectionID, text string) (string, error) {

	dbConn, err := dao.DBConnection.GetDBConnectionByID(dbConnectionID)
	if err != nil {
		return "", errors.New("there was some problem")
	}

	datamodels, err := queryengines.GetDataModels(dbConn.ToQEConnection(), qemodels.NewQueryConfig(false, nil))
	if err != nil {
		return "", errors.New("there was some problem fetching data models")
	}

	for i, dm := range datamodels {
		dm, err := queryengines.GetSingleDataModel(dbConn.ToQEConnection(), dm.SchemaName, dm.Name, qemodels.NewQueryConfig(false, nil))
		if err == nil {
			datamodels[i] = dm
		}
	}

	return ai.GenerateSQL(dbConn.Type, text, datamodels)
}