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

import (
	"encoding/json"
	"fmt"
	"os"
	"strings"

	http "github.com/bogdanfinn/fhttp"

	"github.com/aandrew-me/tgpt/v2/client"
	"github.com/aandrew-me/tgpt/v2/structs"
)

type Response struct {
	ID      string `json:"id"`
	Choices []struct {
		Delta struct {
			Content string `json:"content"`
		} `json:"delta"`
	} `json:"choices"`
}

func NewRequest(input string, params structs.Params, prevMessages string) (*http.Response, error) {
	client, err := client.NewClient()
	if err != nil {
		fmt.Println(err)
		os.Exit(0)
	}

	model := "Phind Model"
	if params.ApiModel != "" {
		model = params.ApiModel
	}

	// preprompt := "You are a helpful assistant"

	// if params.Preprompt != "" {
	// 	preprompt = params.Preprompt
	// }

	// finalPreprompt := fmt.Sprintf(`
	// {
	// 	"content": "%v",
	// 	"role": "system"
	// },
	// `, preprompt)

	safeInput, _ := json.Marshal(input)

	var data = strings.NewReader(fmt.Sprintf(`{
		"additional_extension_context": "",
		"allow_magic_buttons": true,
		"is_vscode_extension": true,
		"message_history": [
			%v
			{
			
    
func NewRequest(input string, params structs.Params, prevMessages string) (*http.Response, error) {
	client, err := client.NewClient()
	if err != nil {
		fmt.Println(err)
		os.Exit(0)
	}

	model := "Phind Model"
	if params.ApiModel != "" {
		model = params.ApiModel
	}

	// preprompt := "You are a helpful assistant"

	// if params.Preprompt != "" {
	// 	preprompt = params.Preprompt
	// }

	// finalPreprompt := fmt.Sprintf(`
	// {
	// 	"content": "%v",
	// 	"role": "system"
	// },
	// `, preprompt)

	safeInput, _ := json.Marshal(input)

	var data = strings.NewReader(fmt.Sprintf(`{
		"additional_extension_context": "",
		"allow_magic_buttons": true,
		"is_vscode_extension": true,
		"message_history": [
			%v
			{
				"content": %v,
				"role": "user"
			}
		],
		"requested_model": "%v",
		"user_input": %v
	}
	`, prevMessages, string(safeInput), model, string(safeInput)))

	req, err := http.NewRequest("POST", "https://https.extension.phind.com/agent/", data)
	if err != nil {
		fmt.Println("\nSome error has occurred.")
		fmt.Println("Error:", err)
		os.Exit(0)
	}
	// Setting all the required headers
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("User-Agent", "")
	req.Header.Set("Accept", "*/*")
	req.Header.Set("Accept-Encoding", "Identity")


	// Return response
	return (client.Do(req))
}