mirror of
https://github.com/verdverm/chatgpt
synced 2024-11-12 07:10:49 +00:00
gofmt
This commit is contained in:
parent
0be020b264
commit
6d2e901a70
15
main.go
15
main.go
@ -82,7 +82,7 @@ func main() {
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "chatgpt [file]",
|
||||
Short: "Chat with ChatGPT in console.",
|
||||
Long: LongHelp,
|
||||
Long: LongHelp,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
var err error
|
||||
var filename string
|
||||
@ -136,11 +136,11 @@ func main() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
var buf bytes.Buffer
|
||||
for {
|
||||
b, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
buf.WriteByte(b)
|
||||
b, err := reader.ReadByte()
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
buf.WriteByte(b)
|
||||
}
|
||||
PromptText += buf.String()
|
||||
} else if len(args) == 1 {
|
||||
@ -172,7 +172,6 @@ func main() {
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
rootCmd.Flags().StringVarP(&Question, "question", "q", "", "ask a single question and print the response back")
|
||||
rootCmd.Flags().StringVarP(&Pretext, "pretext", "p", "", "pretext to add to ChatGPT input, use 'list' or 'view:<name>' to inspect predefined, '<name>' to use a pretext, or otherwise supply any custom text")
|
||||
rootCmd.Flags().BoolVarP(&PromptMode, "interactive", "i", false, "start an interactive session with ChatGPT")
|
||||
@ -209,7 +208,7 @@ func RunPrompt(client *gpt3.Client) error {
|
||||
fmt.Println(r + "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user