Documentation
¶
Index ¶
- Constants
- Variables
- func CalcProofToken(require *ChatRequirements) string
- func ClearConversations(c *gin.Context)
- func CreateConversation(c *gin.Context)
- func FeedbackMessage(c *gin.Context)
- func GenerateTitle(c *gin.Context)
- func GetAccountCheck(c *gin.Context)
- func GetArkoseTokenForModel(model string, dx string) (string, error)
- func GetConversation(c *gin.Context)
- func GetConversations(c *gin.Context)
- func GetDpl()
- func GetGizmos(c *gin.Context)
- func GetMe(c *gin.Context)
- func GetModels(c *gin.Context)
- func GetPromptLibrary(c *gin.Context)
- func GetSynthesize(c *gin.Context)
- func GetUserSetting(c *gin.Context)
- func Login(c *gin.Context)
- func LoginWithUsernameAndPassword(username string, password string) (string, string, int, string)
- func Ping(c *gin.Context)
- func ProcessTurnstile(dx, p string) string
- func UpdateConversation(c *gin.Context)
- func UpdateUserSetting(c *gin.Context)
- type Author
- type ChatRequirements
- type ClientContextualInfo
- type Content
- type ConvMode
- type ConversationMode
- type Cookie
- type CreateConversationRequest
- type CreateConversationResponse
- type CreateConversationWSSResponse
- type DallEContent
- type FeedbackMessageRequest
- type FileInfo
- type FloatMap
- type FuncType
- type GenerateTitleRequest
- type GetModelsResponse
- type Message
- type MessageMetadata
- type OrderedMap
- type PatchConversationRequest
- type ProofWork
- type StringMap
- type UrlAttr
- type UserLogin
- type WSSConversationResponse
- type WSSConversationResponseData
- type WSSSequenceAckMessage
- type WebSocketMessageResponse
- type WebSocketMessageResponseData
- type WebSocketResponse
Constants ¶
View Source
const ( PublicApiPrefix = "https://chatgpt.com/public-api" ApiPrefix = "https://chatgpt.com/backend-api" AnonPrefix = "https://chatgpt.com/backend-anon" WebSocketProtocols = "json.reliable.webpubsub.azure.v1" )
Variables ¶
View Source
var ( PowRetryTimes = 0 PowMaxDifficulty = "000032" )
Functions ¶
func CalcProofToken ¶
func CalcProofToken(require *ChatRequirements) string
func ClearConversations ¶
func CreateConversation ¶
func FeedbackMessage ¶
func GenerateTitle ¶
func GetAccountCheck ¶
func GetConversation ¶
func GetConversations ¶
func GetPromptLibrary ¶
func GetSynthesize ¶
func GetUserSetting ¶
func ProcessTurnstile ¶
func UpdateConversation ¶
func UpdateUserSetting ¶
Types ¶
type ChatRequirements ¶
type ChatRequirements struct { Token string `json:"token"` Proof ProofWork `json:"proofofwork,omitempty"` Arkose struct { Required bool `json:"required"` Dx string `json:"dx,omitempty"` } `json:"arkose"` Turnstile struct { Required bool `json:"required"` DX string `json:"dx,omitempty"` } `json:"turnstile"` }
func GetChatRequirementsByAccessToken ¶
func GetChatRequirementsByAccessToken(accessToken string, uid string) (*ChatRequirements, string, error)
type ClientContextualInfo ¶
type ClientContextualInfo struct { IsDarkMode bool `json:"is_dark_mode"` PageHeight int `json:"page_height"` PageWidth int `json:"page_width"` PixelRation int `json:"pixel_ration"` ScreenHeight int `json:"screen_height"` ScreenWidth int `json:"screen_width"` TimeSinceLoaded int `json:"time_since_loaded"` }
type Content ¶
type Content struct { ContentType string `json:"content_type"` Parts []interface{} `json:"parts"` }
type ConversationMode ¶
type CreateConversationRequest ¶
type CreateConversationRequest struct { Action string `json:"action"` ClientContextualInfo ClientContextualInfo `json:"client_contextual_info"` ConversationMode ConvMode `json:"conversation_mode"` ConversationID string `json:"conversation_id,omitempty"` ConversationOrigin string `json:"conversation_origin,omitempty"` ForceNulligen bool `json:"force_nulligen"` ForceParagen bool `json:"force_paragen"` ForceParagenModelSlug string `json:"force_paragen_model_slug"` ForceRateLimit bool `json:"force_rate_limit"` ForceUseSse bool `json:"force_use_sse"` HistoryAndTrainingDisabled bool `json:"history_and_training_disabled"` Messages []Message `json:"messages"` ParagenCotSummaryDisplayOverride string `json:"paragen_cot_summary_display_override"` ParagenStreamTypeOverride string `json:"paragen_stream_type_override,omitempty"` Model string `json:"model"` ParentMessageID string `json:"parent_message_id"` ResetRateLimits bool `json:"reset_rate_limits"` Suggestions []string `json:"suggestions"` SupportedEncodings []string `json:"supported_encodings"` SupportBuffering string `json:"supports_buffering"` SystemHints []string `json:"system_hints"` Timezone string `json:"timezone"` TimezoneOffsetMin int `json:"timezone_offset_min"` VariantPurpose string `json:"variant_purpose"` WebSocketRequestId string `json:"websocket_request_id"` }
func (*CreateConversationRequest) AddMessage ¶
func (c *CreateConversationRequest) AddMessage(role string, content string, metadata interface{})
type CreateConversationResponse ¶
type CreateConversationResponse struct { Message struct { ID string `json:"id"` Author struct { Role string `json:"role"` Name interface{} `json:"name"` Metadata struct { } `json:"metadata"` } `json:"author"` CreateTime float64 `json:"create_time"` UpdateTime interface{} `json:"update_time"` Content struct { ContentType string `json:"content_type"` Parts []string `json:"parts"` } `json:"content"` Status string `json:"status"` EndTurn bool `json:"end_turn"` Weight float64 `json:"weight"` Metadata struct { MessageType string `json:"message_type"` ModelSlug string `json:"model_slug"` FinishDetails struct { Type string `json:"type"` } `json:"finish_details"` } `json:"metadata"` Recipient string `json:"recipient"` } `json:"message"` ConversationID string `json:"conversation_id"` Error interface{} `json:"error"` }
type DallEContent ¶
type FeedbackMessageRequest ¶
type GenerateTitleRequest ¶
type GenerateTitleRequest struct {
MessageID string `json:"message_id"`
}
type GetModelsResponse ¶
type GetModelsResponse struct { Models []struct { Slug string `json:"slug"` MaxTokens int `json:"max_tokens"` Title string `json:"title"` Description string `json:"description"` Tags []string `json:"tags"` Capabilities struct { } `json:"capabilities"` EnabledTools []string `json:"enabled_tools,omitempty"` } `json:"models"` Categories []struct { Category string `json:"category"` HumanCategoryName string `json:"human_category_name"` SubscriptionLevel string `json:"subscription_level"` DefaultModel string `json:"default_model"` CodeInterpreterModel string `json:"code_interpreter_model"` PluginsModel string `json:"plugins_model"` } `json:"categories"` }
type MessageMetadata ¶
type OrderedMap ¶
func NewOrderedMap ¶
func NewOrderedMap() *OrderedMap
func (*OrderedMap) Add ¶
func (o *OrderedMap) Add(key string, value interface{})
func (*OrderedMap) MarshalJSON ¶
func (o *OrderedMap) MarshalJSON() ([]byte, error)
type WSSConversationResponse ¶
type WSSConversationResponse struct { SequenceId int `json:"sequenceId"` Type string `json:"type"` From string `json:"from"` DataType string `json:"dataType"` Data WSSConversationResponseData `json:"data"` }
type WSSSequenceAckMessage ¶
type WebSocketMessageResponse ¶
type WebSocketMessageResponse struct { SequenceId int `json:"sequenceId"` Type string `json:"type"` From string `json:"from"` DataType string `json:"dataType"` Data WebSocketMessageResponseData `json:"data"` }
type WebSocketResponse ¶
Click to show internal directories.
Click to hide internal directories.