Documentation ¶
Index ¶
Constants ¶
View Source
const (
DELIMITER = "\x1e"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BingChatHub ¶
func (*BingChatHub) CheckAlive ¶
func (b *BingChatHub) CheckAlive() bool
CheckAlive check whether websocket collection is alive
func (*BingChatHub) Close ¶
func (b *BingChatHub) Close()
Close the websocket collection with new bing chat
func (*BingChatHub) Reset ¶
func (b *BingChatHub) Reset(style ...ConversationStyle)
Reset reset conversation style,the supported style list is: ConversationCreateStyle ConversationBalanceStyle ConversationPreciseStyle
func (*BingChatHub) SendMessage ¶
func (b *BingChatHub) SendMessage(msg string) (*MsgResp, error)
SendMessage send message to bing chat and return a response with message(string) channel which you should receive the element from channel to get truly response message
func (*BingChatHub) Style ¶
func (b *BingChatHub) Style() ConversationStyle
Style return current conversation style
type ConversationSession ¶
type ConversationStyle ¶
type ConversationStyle uint8
const ( ConversationCreateStyle ConversationStyle = iota + 1 ConversationBalanceStyle ConversationPreciseStyle )
func (ConversationStyle) String ¶
func (c ConversationStyle) String() string
func (ConversationStyle) TmpMessage ¶
func (c ConversationStyle) TmpMessage() *SendMessage
type IBingChat ¶
type IBingChat interface { Reset(style ...ConversationStyle) SendMessage(msg string) (*MsgResp, error) Style() ConversationStyle Close() CheckAlive() bool }
func NewBingChat ¶
type MessageResp ¶
type MessageResp struct { Type int `json:"type"` Target string `json:"target"` Item struct { Messages []struct { Text string `json:"text,omitempty"` HiddenText string `json:"hiddenText,omitempty"` Author string `json:"author,omitempty"` MessageType string `json:"messageType,omitempty"` AdaptiveCards []struct { Body []struct { Type string `json:"type"` Text string `json:"text"` Wrap string `json:"wrap"` } } `json:"adaptiveCards,omitempty"` } `json:"messages"` } `json:"item"` Arguments []struct { Cursor struct { J string `json:"j"` P int `json:"p"` } `json:"cursor"` Messages []struct { Text string `json:"text"` Author string `json:"author"` CreatedAt time.Time `json:"createdAt"` Timestamp time.Time `json:"timestamp"` MessageId string `json:"messageId"` Offense string `json:"offense"` MessageType string `json:"messageType"` AdaptiveCards []struct { Type string `json:"type"` Version string `json:"version"` Body []struct { Type string `json:"type"` Text string `json:"text"` Wrap bool `json:"wrap"` Size string `json:"size"` } `json:"body"` } `json:"adaptiveCards"` SourceAttributions []interface{} `json:"sourceAttributions"` Feedback struct { Tag interface{} `json:"tag"` UpdatedOn interface{} `json:"updatedOn"` Type string `json:"type"` } `json:"feedback"` ContentOrigin string `json:"contentOrigin"` Privacy interface{} `json:"privacy"` SuggestedResponses []struct { Text string `json:"text"` Author string `json:"author"` CreatedAt time.Time `json:"createdAt"` Timestamp time.Time `json:"timestamp"` MessageId string `json:"messageId"` MessageType string `json:"messageType"` Offense string `json:"offense"` Feedback struct { Tag interface{} `json:"tag"` UpdatedOn interface{} `json:"updatedOn"` Type string `json:"type"` } `json:"feedback"` ContentOrigin string `json:"contentOrigin"` Privacy interface{} `json:"privacy"` } `json:"suggestedResponses"` } `json:"messages"` RequestId string `json:"requestId"` } `json:"arguments"` }
type SendMessage ¶
type SendMessage struct { Arguments []struct { Source string `json:"source"` OptionsSets []string `json:"optionsSets"` AllowedMessageTypes []string `json:"allowedMessageTypes"` SliceIds []string `json:"sliceIds"` Verbosity string `json:"verbosity"` TraceId string `json:"traceId"` IsStartOfSession bool `json:"isStartOfSession"` Message struct { Locale string `json:"locale"` Market string `json:"market"` Region string `json:"region"` Location string `json:"location"` LocationHints []struct { Country string `json:"country"` Timezoneoffset int `json:"timezoneoffset"` CountryConfidence int `json:"countryConfidence"` Center struct { Latitude float64 `json:"Latitude"` Longitude float64 `json:"Longitude"` } `json:"Center"` RegionType int `json:"RegionType"` SourceType int `json:"SourceType"` } `json:"locationHints"` Timestamp time.Time `json:"timestamp"` Author string `json:"author"` InputMethod string `json:"inputMethod"` Text string `json:"text"` MessageType string `json:"messageType"` } `json:"message"` ConversationSignature string `json:"conversationSignature"` Participant struct { Id string `json:"id"` } `json:"participant"` ConversationId string `json:"conversationId"` } `json:"arguments"` InvocationId string `json:"invocationId"` Target string `json:"target"` Type int `json:"type"` }
Click to show internal directories.
Click to hide internal directories.