refactoring: Tiny refactoring (#47)

* tiny refactoring name convention, and file name.

* added command line arguments files

* fix typo comment
This commit is contained in:
Mario Candela
2023-06-01 00:15:21 +02:00
committed by GitHub
parent 7d46c9544c
commit a7c69c8849
8 changed files with 38 additions and 27 deletions

View File

@ -4,8 +4,11 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/go-resty/resty/v2"
"strings"
log "github.com/sirupsen/logrus"
"github.com/go-resty/resty/v2"
)
const ChatGPTPluginName = "OpenAIGPTLinuxTerminal"
@ -104,7 +107,7 @@ func (openAIGPTVirtualTerminal *OpenAIGPTVirtualTerminal) GetCompletions(command
if err != nil {
return "", err
}
log.Debug(response)
if len(response.Result().(*gptResponse).Choices) == 0 {
return "", errors.New("no choices")
}