Documentation
¶
Index ¶
- Variables
- func CalcProofToken(require *ChatRequire) string
- func CreateConversation(c *gin.Context)
- func GetArkoseTokenForModel(model string, dx string) (string, error)
- func GetDpl()
- func Login(c *gin.Context)
- func NewRequest(method string, url string, body io.Reader, token string, deviceId string) (*http.Request, error)
- func ProcessTurnstile(dx, p string) string
- type Author
- type ChatGPTWSSResponse
- type ChatRequire
- type Content
- type ConvMode
- type CreateConversationRequest
- type CreateConversationResponse
- type DalleContent
- type FileInfo
- type FloatMap
- type FuncType
- type GetModelsResponse
- type Message
- type OrderedMap
- type ProofWork
- type StringMap
- type WSSMsgResponse
- type WSSMsgResponseData
- type WSSSequenceAckMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PowRetryTimes = 0 PowMaxDifficulty = "000032" )
Functions ¶
func CalcProofToken ¶
func CalcProofToken(require *ChatRequire) string
func CreateConversation ¶
func NewRequest ¶
func ProcessTurnstile ¶
Types ¶
type ChatGPTWSSResponse ¶
type ChatRequire ¶
type ChatRequire 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 CheckRequire ¶
func CheckRequire(access_token string, deviceId string) (*ChatRequire, string)
type Content ¶
type Content struct {
ContentType string `json:"content_type"`
Parts []interface{} `json:"parts"`
}
type CreateConversationRequest ¶
type CreateConversationRequest struct {
Action string `json:"action"`
ConversationID string `json:"conversation_id,omitempty"`
ConversationMode ConvMode `json:"conversation_mode"`
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,omitempty"`
Model string `json:"model"`
ParentMessageID string `json:"parent_message_id,omitempty"`
ResetRateLimits bool `json:"reset_rate_limits"`
Suggestions []string `json:"suggestions"`
TimezoneOffsetMin int `json:"timezone_offset_min"`
WebsocketRequestId string `json:"websocket_request_id"`
}
func (*CreateConversationRequest) AddMessage ¶
func (c *CreateConversationRequest) AddMessage(role string, content string)
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 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 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 WSSMsgResponse ¶
type WSSMsgResponse struct {
SequenceId int `json:"sequenceId"`
Type string `json:"type"`
From string `json:"from"`
DataType string `json:"dataType"`
Data WSSMsgResponseData `json:"data"`
}
type WSSMsgResponseData ¶
type WSSSequenceAckMessage ¶
Click to show internal directories.
Click to hide internal directories.