Chat.go 1022 B

1234567891011121314151617181920212223242526272829
  1. package v1
  2. import "github.com/gogf/gf/v2/frame/g"
  3. type ChatReq struct {
  4. g.Meta `path:"/chat" tags:"聊天请求" method:"post" summary:"AI聊天"`
  5. Role string `json:"role" v:"required"`
  6. Content string `json:"content" v:"required"`
  7. ConversationID string `json:"conversation_id"`
  8. MessageId string `json:"message_id"`
  9. }
  10. type ChatRes struct {
  11. g.Meta `mime:"application/json" example:"json"`
  12. Text string `json:"text"`
  13. ConversationID string `json:"conversation_id"`
  14. MessageId string `json:"message_id"`
  15. }
  16. type ChatStreamReq struct {
  17. g.Meta `path:"/chatStream" tags:"聊天请求流传输" method:"post" summary:"AI聊天流传输"`
  18. Role string `json:"role" v:"required"`
  19. Content string `json:"content" v:"required"`
  20. ConversationID string `json:"conversation_id" doc:"这个一个会话ID唯一值"`
  21. MessageId string `json:"message_id,omitempty" doc:"这个一个消息ID用于保持上下文"`
  22. }
  23. type ChatStreamRes struct {
  24. }