Documentation ¶
Index ¶
- Constants
- Variables
- func GetNewUUID() string
- func IsInitialized() bool
- func MakeRequest(method, path string, p url.Values, body []byte) ([]byte, error)
- func MakeRequestAdmin(method, path string, p url.Values, body []byte) ([]byte, error)
- func MakeRequestChat(method, path string, p url.Values, body []byte) ([]byte, error)
- func SetVariables(drbotAPIEndpoint, drbotChatAPIEndpoint, drbotAdminAPIEndpoint string)
- type ChatContext
- type ChatData
- type ChatInput
- type ChatIntent
- type ChatItem
- type ChatOutput
- type ChatReq
- type ChatResp
- type Client
- type SendChatResp
- type UserReq
- type UserRequest
Constants ¶
View Source
const ( ValueChannelAdmin = "admin" ValueIntendId = "" ValueIsStartFalse = 0 ValueIsStartTrue = 1 ValueLangEn = "en" ValueLangJa = "ja" ValueLangKo = "ko" ValueModelMessage = "message" ValueRequestTypeButton = "button" ValueRequestTypeText = "text" ValueTimeZoneAsiaSeoul = "Asia/Seoul" ValueUtteranceStart = "[start]" ValueVisitCountStart = int64(1) )
View Source
const (
PathAPI = "api"
)
Variables ¶
View Source
var ErrInvalidMakeRequestChatResponseData = fmt.Errorf("invalid 'MakeRequestChat()' response data")
View Source
var ErrNeedChatDataExceptStartingTheChat = fmt.Errorf("need 'ChatData' except starting the chat")
View Source
var ErrNotInitialized = fmt.Errorf("not initialized")
Functions ¶
func GetNewUUID ¶
func GetNewUUID() string
func IsInitialized ¶
func IsInitialized() bool
func MakeRequestAdmin ¶
func MakeRequestChat ¶
func SetVariables ¶
func SetVariables(drbotAPIEndpoint, drbotChatAPIEndpoint, drbotAdminAPIEndpoint string)
SetVariables - Mark: You should have to call this function while initializing step or before run main.
Types ¶
type ChatContext ¶
type ChatContext struct { }
type ChatData ¶
type ChatData struct { UserID string `json:"user_id"` VisitCount int64 `json:"visit_count"` SessionId string `json:"session_id"` Message string `json:"message"` Language string `json:"language,omitempty"` }
func NewChatData ¶
func NewChatData() *ChatData
type ChatIntent ¶
type ChatItem ¶
type ChatItem []struct { Title string `json:"title"` Subtitle string `json:"subtitle,omitempty"` Description string `json:"description,omitempty"` Similarity string `json:"similarity,omitempty"` Source string `json:"source,omitempty"` Thumbnail json.RawMessage `json:"thumbnail,omitempty"` // MARK: Guess -> *string Buttons json.RawMessage `json:"buttons,omitempty"` }
type ChatOutput ¶
type ChatReq ¶
type ChatReq struct { UserRequest *UserRequest `json:"userRequest"` VisitCount int64 `json:"visit_count"` Context *ChatContext `json:"context"` }
func NewInitChatReq ¶
func NewInitChatReq() *ChatReq
type ChatResp ¶
type ChatResp struct {
Outputs []ChatOutput `json:"outputs"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func GetDrbotClient ¶
func GetDrbotClient() *Client
func (*Client) GetMaxRetriesCount ¶
func (*Client) GetRetryDelay ¶
func (*Client) SetMaxRetries ¶
type SendChatResp ¶
type SendChatResp struct { UserRequest UserRequest `json:"userRequest"` Animation string `json:"animation"` Input ChatInput `json:"input"` Context ChatContext `json:"context"` Intent ChatIntent `json:"intent"` Response ChatResp `json:"response"` VisitCount int `json:"visit_count"` CreatedAt string `json:"created_at"` ResponseTime int `json:"response_time"` }
func NewSendChatResp ¶
func NewSendChatResp() *SendChatResp
type UserRequest ¶
type UserRequest struct { Model string `json:"model"` IntentId string `json:"intentId"` IsStart int `json:"isStart"` Timezone string `json:"timezone"` Utterance string `json:"utterance"` Lang string `json:"lang"` Channel string `json:"channel"` TopFolderId string `json:"top_folder_id,omitempty"` CbcType string `json:"cbc_type,omitempty"` CbcRound int64 `json:"cbc_round,omitempty"` CbcTerm int64 `json:"cbc_term,omitempty"` RequestType string `json:"requestType"` User *UserReq `json:"user"` }
Click to show internal directories.
Click to hide internal directories.