refactor: cleanup redundant code
This commit is contained in:
parent
9e7432a1a1
commit
89286b7e73
3 changed files with 28 additions and 71 deletions
|
|
@ -12,7 +12,7 @@ import (
|
|||
tele "gopkg.in/telebot.v3"
|
||||
)
|
||||
|
||||
var assistantWritingSign = "\n...📝"
|
||||
var assistantWritingSign = "\n... 📝"
|
||||
|
||||
func matchAssistantConversation(botUsr *tele.User, msg *tele.Message) []*tele.Message {
|
||||
// A thread must meet the following conditions to be considered a conversation with the assistant (for now):
|
||||
|
|
@ -227,11 +227,7 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error {
|
|||
MaxTokens: 2048,
|
||||
}
|
||||
|
||||
typingNotifyCh := make(chan struct{})
|
||||
go func() {
|
||||
defer close(typingNotifyCh)
|
||||
_ = c.Bot().Notify(lastMsg.Chat, tele.Typing)
|
||||
}()
|
||||
typingNotifyCh := setTyping(c)
|
||||
|
||||
var replyMsg *tele.Message
|
||||
reqErr := assistantStreamedResponse(req, func(text string, finished bool) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue