Skip to content

Commit 6be4c03

Browse files
committed
添加\c取消输入
1 parent 5d8d616 commit 6be4c03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chat.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"fmt"
77
"os"
8+
"strings"
89

910
"github.com/charmbracelet/glamour"
1011
"github.com/common-nighthawk/go-figure"
@@ -64,6 +65,10 @@ func main() {
6465
continue
6566
}
6667

68+
if strings.HasSuffix(userInput, "\\c\n") {
69+
continue
70+
}
71+
6772
messages = append(
6873
messages, gpt3.ChatCompletionMessage{
6974
Role: "user",

0 commit comments

Comments
 (0)