feat: add kanji command

This commit is contained in:
Yiyang Kang 2023-04-21 15:43:05 +08:00
parent f6f8563aba
commit 2a8605631b
5 changed files with 96 additions and 0 deletions

View file

@ -91,6 +91,8 @@ func matchAssistantConversation(botUsr *tele.User, msg *tele.Message) []*tele.Me
type assistantStreamedResponseCb func(text string, finished bool) error
// TODO interrupt response with context.
func assistantStreamedResponse(request openai.ChatRequest, cb assistantStreamedResponseCb) error {
logger.Debugw("Openai chat request", "req", request)
ai := openai.NewClient(config.OpenAIApiKey)