-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathtypes.go
248 lines (241 loc) · 8.55 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
package sydney
import (
"context"
"errors"
"time"
)
const delimiter = '\x1e'
type LocationHint struct {
SourceType int `json:"SourceType"`
RegionType int `json:"RegionType"`
Center LatLng `json:"Center"`
Radius int `json:"Radius"`
Name string `json:"Name"`
Accuracy int `json:"Accuracy"`
FDConfidence float64 `json:"FDConfidence"`
CountryName string `json:"CountryName"`
CountryConfidence int `json:"CountryConfidence"`
Admin1Name string `json:"Admin1Name"`
PopulatedPlaceName string `json:"PopulatedPlaceName"`
PopulatedPlaceConfidence int `json:"PopulatedPlaceConfidence"`
PostCodeName string `json:"PostCodeName"`
UtcOffset int `json:"UtcOffset"`
Dma int `json:"Dma"`
}
type LatLng struct {
Latitude float64 `json:"Latitude"`
Longitude float64 `json:"Longitude"`
}
type CreateConversationResult struct {
Value string `json:"value"`
Message string `json:"message"`
}
type CreateConversationResponse struct {
ConversationId string `json:"conversationId"`
ClientId string `json:"clientId"`
Result CreateConversationResult `json:"result"`
SecAccessToken string `json:"secAccessToken"`
ConversationSignature string `json:"conversationSignature"`
BearerToken string `json:"bearerToken"`
}
type RawMessage struct {
Data string
Error error
}
const (
MessageTypeSearchQuery = "search_query"
MessageTypeSearchResult = "search_result"
MessageTypeLoading = "loading"
MessageTypeGenerativeImage = "generative_image"
MessageTypeGenerativeMusic = "generative_music"
MessageTypeExecutingTask = "executing_task"
MessageTypeOpenAPICall = "openapi_call"
MessageTypeGeneratedCode = "generated_code"
MessageTypeResolvingCaptcha = "resolving_captcha"
MessageTypeMessageText = "message"
MessageTypeSuggestedResponses = "suggested_responses"
MessageTypeError = "error"
)
var (
ErrMessageRevoke = errors.New("message revoke detected")
ErrMessageFiltered = errors.New("message triggered the Bing filter")
)
type Message struct {
Type string
Text string
Error error
}
type ChatMessage struct {
Arguments []Argument `json:"arguments"`
InvocationId string `json:"invocationId"`
Target string `json:"target"`
Type int `json:"type"`
}
type Argument struct {
OptionsSets []string `json:"optionsSets"`
Source string `json:"source"`
AllowedMessageTypes []string `json:"allowedMessageTypes"`
SliceIds []string `json:"sliceIds"`
Verbosity string `json:"verbosity"`
Scenario string `json:"scenario"`
Plugins []ArgumentPlugin `json:"plugins"`
TraceId string `json:"traceId"`
RequestId string `json:"requestId"`
IsStartOfSession bool `json:"isStartOfSession"`
Message ArgumentMessage `json:"message"`
Tone string `json:"tone"`
ConversationSignature any `json:"conversationSignature"`
Participant Participant `json:"participant"`
SpokenTextMode string `json:"spokenTextMode"`
ConversationId string `json:"conversationId"`
PreviousMessages []PreviousMessage `json:"previousMessages"`
GptId string `json:"gptId"`
}
type ArgumentPlugin struct {
Id string `json:"id"`
Category int `json:"category"`
}
type ArgumentMessage struct {
Locale string `json:"locale"`
Market string `json:"market"`
Region string `json:"region"`
Location string `json:"location"`
LocationHints []LocationHint `json:"locationHints"`
AttachedFilesInfos []ArgumentAttachedFilesInfo `json:"attachedFilesInfos"`
Author string `json:"author"`
InputMethod string `json:"inputMethod"`
Text string `json:"text"`
MessageType string `json:"messageType"`
RequestId string `json:"requestId"`
MessageId string `json:"messageId"`
ImageUrl any `json:"imageUrl"`
}
type ArgumentAttachedFilesInfo struct {
FileName string `json:"fileName"`
FileType string `json:"fileType"`
}
type Participant struct {
Id string `json:"id"`
}
type PreviousMessage struct {
Author string `json:"author"`
Description string `json:"description"`
ContextType string `json:"contextType"`
MessageType string `json:"messageType"`
HiddenText string `json:"hiddenText"`
}
type Options struct {
Debug bool
Cookies map[string]string
Proxy string
ConversationStyle string
Locale string
WssDomain string
CreateConversationURL string
NoSearch bool
UseClassic bool
GPT4Turbo bool
BypassServer string
Plugins []string
}
type AskStreamOptions struct {
StopCtx context.Context
Prompt string
WebpageContext string
ImageURL string
UploadFilePath string
messageID string // A random uuid. Optional.
disableCaptchaBypass bool
}
type UploadImagePayload struct {
ImageInfo map[string]any `json:"imageInfo"`
KnowledgeRequest KnowledgeRequest `json:"knowledgeRequest"`
}
type InvokedSkillsRequestData struct {
EnableFaceBlur bool `json:"enableFaceBlur"`
}
type ConvoData struct {
Convoid string `json:"convoid"`
Convotone string `json:"convotone"`
}
type KnowledgeRequest struct {
InvokedSkills []string `json:"invokedSkills"`
SubscriptionId string `json:"subscriptionId"`
InvokedSkillsRequestData InvokedSkillsRequestData `json:"invokedSkillsRequestData"`
ConvoData ConvoData `json:"convoData"`
}
type UploadImageResponse struct {
BlobId string `json:"blobId"`
ProcessedBlobId string `json:"processedBlobId"`
}
type GenerativeImage struct {
Text string `json:"text"`
URL string `json:"url"`
}
type GenerativeMusic struct {
IFrameID string `json:"iframeid"`
RequestID string `json:"requestid"`
Text string `json:"text"`
}
type GenerateImageResult struct {
GenerativeImage
ImageURLs []string `json:"image_urls"`
Duration time.Duration `json:"duration"`
}
type GenerateMusicResult struct {
GenerativeMusic
CoverImgURL string `json:"cover_img_url"`
AudioURL string `json:"music_url"`
VideoURL string `json:"video_url"`
MusicDuration time.Duration `json:"duration"`
MusicalStyle string `json:"musical_style"`
Title string `json:"title"`
Lyrics string `json:"lyrics"`
TimeElapsed time.Duration `json:"time_elapsed"`
}
type SourceAttribute struct {
Index int `json:"index"`
Link string `json:"link"`
Title string `json:"title"`
}
type BypassCaptchaRequest struct {
IG string `json:"IG"`
Cookies string `json:"cookies"`
IFrameID string `json:"iframeid"`
ConvID string `json:"convId"`
RID string `json:"rid"`
}
type BypassCaptchaResponse struct {
Result struct {
Cookies string `json:"cookies"`
ScreenShot string `json:"screenshot"`
} `json:"result"`
Error string `json:"error"`
}
type UploadFileHiddenText struct {
FileName string `json:"fileName"`
FileType string `json:"fileType"`
DocId string `json:"docId"`
IsLongContext bool `json:"isLongContext"`
UserId string `json:"userId"`
IsBCE bool `json:"isBCE"`
}
type UploadFileResponse struct {
FileName string `json:"fileName"`
FileSize int `json:"fileSize"`
FileType string `json:"fileType"`
IsLongContext bool `json:"isLongContext"`
DocId string `json:"docId"`
UserId string `json:"userId"`
Result struct {
Value string `json:"value"`
Message string `json:"message"`
ServiceVersion string `json:"serviceVersion"`
} `json:"result"`
}
type UploadFileResult struct {
Valid bool
Response UploadFileResponse
FileHiddenText string
RealFileType string
}