Documentation ¶
Index ¶
- Variables
- func GetRandomHex(n int, allowedChars ...[]rune) string
- func GetRandomIp() string
- func GetUuidV4() string
- type Answer
- func (answer *Answer) IsDone() bool
- func (answer *Answer) MaxNumUserMessages() int64
- func (answer *Answer) NumUserMessages() int64
- func (answer *Answer) Raw() string
- func (answer *Answer) SetDone()
- func (answer *Answer) SuggestedRes() []SuggestedResponses
- func (answer *Answer) Text() string
- func (answer *Answer) Type() int64
- type ChatBot
- type ChatHub
- type ChatHubRequest
- type Conversation
- type ConversationStyle
- type SuggestedResponses
Constants ¶
This section is empty.
Variables ¶
View Source
var DELIMITER = "\x1e"
View Source
var HEADERS = map[string]string{ "accept": "application/json", "accept-language": "en-US,en;q=0.9", "content-type": "application/json", "sec-ch-ua": `"Not_A Brand";v="99", "Microsoft Edge";v="110", "Chromium";v="110"`, "sec-ch-ua-arch": `"x86"`, "sec-ch-ua-bitness": `"64"`, "sec-ch-ua-full-version": `"109.0.1518.78"`, "sec-ch-ua-full-version-list": `"Chromium";v="110.0.5481.192", "Not A(Brand";v="24.0.0.0", "Microsoft Edge";v="110.0.1587.69"`, "sec-ch-ua-mobile": "?0", "sec-ch-ua-model": "", "sec-ch-ua-platform": `"Windows"`, "sec-ch-ua-platform-version": `"15.0.0"`, "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-ms-client-request-id": GetUuidV4(), "x-ms-useragent": "azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.0 OS/Win32", "Referer": "https://www.bing.com/search?q=Bing+AI&showconv=1&FORM=hpcodx", "Referrer-Policy": "origin-when-cross-origin", "x-forwarded-for": GetRandomIp(), }
HEADERS http.Header{}
View Source
var HEADERS_INIT_CONVER = map[string]string{
"authority": "edgeservices.bing.com",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9",
"cache-control": "max-age=0",
"sec-ch-ua": `"Chromium";v="110", "Not A(Brand";v="24", "Microsoft Edge";v="110"`,
"sec-ch-ua-arch": `"x86"`,
"sec-ch-ua-bitness": `"64"`,
"sec-ch-ua-full-version": `"110.0.1587.69"`,
"sec-ch-ua-full-version-list": `"Chromium";v="110.0.5481.192", "Not A(Brand";v="24.0.0.0", "Microsoft Edge";v="110.0.1587.69"`,
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-model": `""`,
"sec-ch-ua-platform": `"Windows"`,
"sec-ch-ua-platform-version": `"15.0.0"`,
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.69",
"x-edge-shopping-flag": "1",
"x-forwarded-for": "1.1.1.1",
}
Functions ¶
func GetRandomHex ¶
GetRandomHex Returns random hex string
func GetRandomIp ¶
func GetRandomIp() string
GetRandomIp Generate random IP between range 13.104.0.0/14
Types ¶
type Answer ¶
type Answer struct {
// contains filtered or unexported fields
}
func (*Answer) MaxNumUserMessages ¶
func (*Answer) NumUserMessages ¶
func (*Answer) SuggestedRes ¶
func (answer *Answer) SuggestedRes() []SuggestedResponses
type ChatBot ¶
type ChatBot struct {
// contains filtered or unexported fields
}
ChatBot Combines everything to make it seamless
func NewChatBot ¶
type ChatHub ¶
type ChatHub struct {
// contains filtered or unexported fields
}
ChatHub Chat API
func NewChatHub ¶
func NewChatHub(addr, path string, conversation *Conversation) *ChatHub
type ChatHubRequest ¶
type ChatHubRequest struct { Struct map[string]interface{} ConversationSignature string ClientId string ConversationId string InvocationId int }
ChatHubRequest Request object for ChatHub
func NewChatHubRequest ¶
func NewChatHubRequest(conversationSignature, clientId, conversationId string, invocationId int) *ChatHubRequest
func (*ChatHubRequest) Update ¶
func (req *ChatHubRequest) Update(prompt string, conversation_style ConversationStyle, options ...string)
Update Updates request object
type Conversation ¶
type Conversation struct { Struct map[string]interface{} Session *resty.Request // contains filtered or unexported fields }
Conversation API
func NewConversation ¶
func NewConversation(cookiePath string, cookies []map[string]interface{}, proxy string) *Conversation
func (*Conversation) Init ¶
func (con *Conversation) Init() error
type ConversationStyle ¶
type ConversationStyle string
const ( Creative ConversationStyle = "h3relaxedimg" Balanced ConversationStyle = "galileo" Precise ConversationStyle = "h3precise" )
type SuggestedResponses ¶
type 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"` }
Click to show internal directories.
Click to hide internal directories.