package pingchat

// Chatbot API doc: https://pingcap.feishu.cn/wiki/wikcnG5BvzYjwd2ypFL02q2gPsf
type ChatMessage struct {
	// Dialogue content
	Content string `json:"content" binding:"required"`
	// User's input as "user", AI assistant's reply as "assistant", see https://github.com/gin-gonic/gin/issues/3234.
	Role string `json:"role" enums:"user,assistant" binding:"required,oneof=user assistant"`
}

type ChatInfo struct {
	// https://pkg.go.dev/gopkg.in/bluesuncorp/validator.v9#hdr-Dive
	Messages []ChatMessage `json:"messages" binding:"required,dive"`
	Domain   []string      `json:"domain" enums:"tidb,tidbcloud,asktug,blog,community,knowledge-base-cn,kb" binding:"omitempty,dive,oneof=tidb tidbcloud asktug blog community knowledge-base-cn kb"`
}

type ChatParams struct {
	Domain []string `url:"domain,omitempty"`
}

type Link struct {
	Title string `json:"title"`
	Link  string `json:"link"`
}

type ChatResponse struct {
	Content string `json:"content"`
	// Reference Document Links
	Links []Link
}
