Documentation ¶
Index ¶
- Constants
- Variables
- func ParseOpenAIMessageContent(content interface{}) (text, imageUrl string)
- type Argument
- type ArgumentAttachedFilesInfo
- type ArgumentMessage
- type ArgumentPlugin
- type AskStreamOptions
- type BypassCaptchaRequest
- type BypassCaptchaResponse
- type ChatCompletionChoice
- type ChatCompletionChunkChoice
- type ChatMessage
- type ChatStreamRequest
- type ChoiceDelta
- type ChoiceMessage
- type Conn
- type ConvoData
- type CreateConversationRequest
- type CreateConversationResponse
- type CreateConversationResult
- type CreateImageRequest
- type GenerateImageResult
- type GenerateMusicRawResponse
- type GenerateMusicRealResponse
- type GenerateMusicResult
- type GenerativeImage
- type GenerativeMusic
- type InvokedSkillsRequestData
- type KnowledgeRequest
- type LatLng
- type LocationHint
- type Message
- type OpenAIChatCompletion
- type OpenAIChatCompletionChunk
- type OpenAIChatCompletionRequest
- type OpenAIImageGeneration
- type OpenAIImageGenerationRequest
- type OpenAIImageObject
- type OpenAIMessage
- type OpenAIMessagesParseResult
- type Options
- type Participant
- type Plugin
- type PreviousMessage
- type RawMessage
- type SourceAttribute
- type Sydney
- func (o *Sydney) AskStream(options AskStreamOptions) (<-chan Message, error)
- func (o *Sydney) AskStreamRaw(options AskStreamOptions) (CreateConversationResponse, <-chan RawMessage, error)
- func (o *Sydney) BypassCaptcha(stopCtx context.Context, conversationID string, messageID string) error
- func (o *Sydney) GenerateImage(generativeImage GenerativeImage) (GenerateImageResult, error)
- func (o *Sydney) GenerateMusic(generativeMusic GenerativeMusic) (GenerateMusicResult, error)
- func (o *Sydney) GetUser() (string, error)
- func (o *Sydney) ResolveCaptcha(stopCtx context.Context) (err error)
- func (o *Sydney) UpdateModifiedCookies(modifiedCookies map[string]string)
- func (o *Sydney) UploadImage(jpgImgData []byte) (string, error)
- type UploadFileHiddenText
- type UploadFileResponse
- type UploadFileResult
- type UploadImagePayload
- type UploadImageResponse
- type UsageStats
Constants ¶
View Source
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" )
View Source
const ImageGeneratorContext = `` /* 404-byte string literal not displayed */
Variables ¶
View Source
var ( ErrMissingPrompt = errors.New("user prompt is missing (last message is not sent by user)") FinishReasonStop = "stop" FinishReasonLength = "length" MessageRoleUser = "user" MessageRoleAssistant = "assistant" MessageRoleSystem = "system" )
View Source
var ( ErrMessageRevoke = errors.New("message revoke detected") ErrMessageFiltered = errors.New("message triggered the Bing filter") )
View Source
var BingAllowedFileExtensions = []string{
"rtf",
"txt",
"py",
"ipynb",
"js",
"jsx",
"html",
"css",
"java",
"cs",
"php",
"c",
"cpp",
"cxx",
"h",
"hpp",
"rs",
"R",
"Rmd",
"swift",
"go",
"rb",
"kt",
"kts",
"ts",
"tsx",
"m",
"scala",
"rs",
"dart",
"lua",
"pl",
"pm",
"t",
"sh",
"bash",
"zsh",
"csv",
"log",
"ini",
"config",
"json",
"yaml",
"yml",
"toml",
"lua",
"sql",
"md",
"coffee",
"tex",
"latex",
"pdf",
"docx",
"xlsx",
"pptx",
"html",
"wav",
}
View Source
var PluginList = []Plugin{ { Name: "Suno", OptionsSets: []string{"014CB21D"}, ArgumentPlugin: ArgumentPlugin{ Id: "c310c353-b9f0-4d76-ab0d-1dd5e979cf68", Category: 1, }, }, }
Functions ¶
func ParseOpenAIMessageContent ¶
func ParseOpenAIMessageContent(content interface{}) (text, imageUrl string)
Types ¶
type Argument ¶
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 ArgumentMessage ¶
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 ArgumentPlugin ¶
type AskStreamOptions ¶
type BypassCaptchaRequest ¶
type BypassCaptchaResponse ¶
type ChatCompletionChoice ¶
type ChatCompletionChoice struct { Index int `json:"index"` Message ChoiceMessage `json:"message"` FinishReason string `json:"finish_reason"` }
type ChatCompletionChunkChoice ¶
type ChatCompletionChunkChoice struct { Index int `json:"index"` Delta ChoiceDelta `json:"delta"` FinishReason *string `json:"finish_reason"` }
type ChatMessage ¶
type ChatStreamRequest ¶
type ChatStreamRequest struct { Prompt string `json:"prompt"` WebpageContext string `json:"context"` Cookies string `json:"cookies"` ImageURL string `json:"imageUrl"` NoSearch bool `json:"noSearch"` UseGPT4Turbo bool `json:"gpt4turbo"` UseClassic bool `json:"classic"` ConversationStyle string `json:"conversationStyle"` Plugins []string `json:"plugins"` }
type ChoiceDelta ¶
type ChoiceMessage ¶
type CreateConversationRequest ¶
type CreateConversationRequest struct {
Cookies string `json:"cookies"`
}
type CreateConversationResponse ¶
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 CreateImageRequest ¶
type CreateImageRequest struct { Image GenerativeImage `json:"image"` Cookies string `json:"cookies"` }
type GenerateImageResult ¶
type GenerateImageResult struct { GenerativeImage ImageURLs []string `json:"image_urls"` Duration time.Duration `json:"duration"` }
type GenerateMusicRawResponse ¶
type GenerateMusicRawResponse struct {
RawResponse string `json:"RawResponse"`
}
type GenerateMusicRealResponse ¶
type GenerateMusicRealResponse struct { Id string `json:"id"` Status string `json:"status"` ErrorMessage string `json:"errorMessage"` GptPrompt string `json:"gptPrompt"` Lyrics string `json:"lyrics"` AudioKey string `json:"audioKey"` ImageKey string `json:"imageKey"` VideoKey string `json:"videoKey"` Duration float64 `json:"duration"` SunoJsonResponse string `json:"sunoJsonResponse"` MusicalStyle string `json:"musicalStyle"` }
type GenerateMusicResult ¶
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 GenerativeImage ¶
type GenerativeMusic ¶
type InvokedSkillsRequestData ¶
type InvokedSkillsRequestData struct {
EnableFaceBlur bool `json:"enableFaceBlur"`
}
type KnowledgeRequest ¶
type KnowledgeRequest struct { InvokedSkills []string `json:"invokedSkills"` SubscriptionId string `json:"subscriptionId"` InvokedSkillsRequestData InvokedSkillsRequestData `json:"invokedSkillsRequestData"` ConvoData ConvoData `json:"convoData"` }
type LocationHint ¶
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 OpenAIChatCompletion ¶
type OpenAIChatCompletion struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Model string `json:"model"` SystemFingerprint string `json:"system_fingerprint"` Choices []ChatCompletionChoice `json:"choices"` Usage UsageStats `json:"usage"` }
func NewOpenAIChatCompletion ¶
func NewOpenAIChatCompletion(model, content, finishReason string) *OpenAIChatCompletion
type OpenAIChatCompletionChunk ¶
type OpenAIChatCompletionChunk struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Model string `json:"model"` SystemFingerprint string `json:"system_fingerprint"` Choices []ChatCompletionChunkChoice `json:"choices"` }
func NewOpenAIChatCompletionChunk ¶
func NewOpenAIChatCompletionChunk(model, delta string, finishReason *string) *OpenAIChatCompletionChunk
type OpenAIChatCompletionRequest ¶
type OpenAIChatCompletionRequest struct { Model string `json:"model"` Messages []OpenAIMessage `json:"messages"` Stream bool `json:"stream"` ToolChoice *interface{} `json:"tool_choice"` Conversation CreateConversationResponse `json:"conversation"` }
Most fields are omitted due to limitations of the Bing API
type OpenAIImageGeneration ¶
type OpenAIImageGeneration struct { Created int64 `json:"created"` Data []OpenAIImageObject `json:"data"` }
func ToOpenAIImageGeneration ¶
func ToOpenAIImageGeneration(result GenerateImageResult) OpenAIImageGeneration
type OpenAIImageGenerationRequest ¶
type OpenAIImageGenerationRequest struct {
Prompt string `json:"prompt"`
}
type OpenAIImageObject ¶
type OpenAIMessage ¶
type OpenAIMessage struct { Role string `json:"role"` Content interface{} `json:"content"` }
type OpenAIMessagesParseResult ¶
func ParseOpenAIMessages ¶
func ParseOpenAIMessages(messages []OpenAIMessage) (OpenAIMessagesParseResult, error)
type Participant ¶
type Participant struct {
Id string `json:"id"`
}
type Plugin ¶
type Plugin struct { Name string OptionsSets []string ArgumentPlugin }
type PreviousMessage ¶
type RawMessage ¶
type SourceAttribute ¶
type Sydney ¶
type Sydney struct {
// contains filtered or unexported fields
}
func (*Sydney) AskStream ¶
func (o *Sydney) AskStream(options AskStreamOptions) (<-chan Message, error)
func (*Sydney) AskStreamRaw ¶
func (o *Sydney) AskStreamRaw(options AskStreamOptions) (CreateConversationResponse, <-chan RawMessage, error)
func (*Sydney) BypassCaptcha ¶
func (*Sydney) GenerateImage ¶
func (o *Sydney) GenerateImage(generativeImage GenerativeImage) (GenerateImageResult, error)
func (*Sydney) GenerateMusic ¶
func (o *Sydney) GenerateMusic(generativeMusic GenerativeMusic) (GenerateMusicResult, error)
func (*Sydney) ResolveCaptcha ¶
func (*Sydney) UpdateModifiedCookies ¶
type UploadFileHiddenText ¶
type UploadFileResponse ¶
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 ¶
type UploadFileResult struct { Valid bool Response UploadFileResponse FileHiddenText string RealFileType string }
type UploadImagePayload ¶
type UploadImagePayload struct { ImageInfo map[string]any `json:"imageInfo"` KnowledgeRequest KnowledgeRequest `json:"knowledgeRequest"` }
type UploadImageResponse ¶
type UsageStats ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.