Documentation
¶
Index ¶
- Constants
- type AuthConfig
- type Authenticator
- type Author
- type ChatGPTUnoBot
- func (chat *ChatGPTUnoBot) Ask(prompt, conversationId, parentId, model string, timeout int, ...) (err error)
- func (chat *ChatGPTUnoBot) BaseURL() string
- func (chat *ChatGPTUnoBot) ClearConversations() error
- func (chat *ChatGPTUnoBot) DeleteConversation(conversationId string) error
- func (chat *ChatGPTUnoBot) Init() error
- func (chat *ChatGPTUnoBot) Login() error
- func (chat *ChatGPTUnoBot) SetAccessToken(accessToken string)
- type ChatGPTUnoConfig
- type ConversationNode
- func (node *ConversationNode) ConversationId() string
- func (node *ConversationNode) CurrentNode() string
- func (node *ConversationNode) SetConversationId(conversationId string)
- func (node *ConversationNode) SetConversationInfo(info gjson.Result)
- func (node *ConversationNode) SetCurrentNode(parentId string)
- func (node *ConversationNode) SetHistory(history gjson.Result)
- func (node *ConversationNode) SetTitle(title string)
- func (node *ConversationNode) Title() string
- type FinishDetail
- type Mapping
- type Message
- type Metadata
- type NextAction
- type PromptMessage
- type ReqContent
- type Requests
- func (r *Requests) Do(method, baseUrl string) (*http.Response, error)
- func (r *Requests) Get(baseUrl string) (*http.Response, error)
- func (r *Requests) Patch(baseUrl string) (*http.Response, error)
- func (r *Requests) Post(baseUrl string) (*http.Response, error)
- func (r *Requests) SetBody(reader io.Reader)
- func (r *Requests) SetCookie(name, value string)
- func (r *Requests) SetHeaders(headers http.Header)
- func (r *Requests) SetNoRedirects()
- func (r *Requests) SetProxy(proxy string)
- func (r *Requests) SetTimeout(timeout int)
- type ResContent
- type Response
Constants ¶
View Source
const UA = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type Authenticator ¶
type Authenticator struct { SessionToken string CsrfToken string // contains filtered or unexported fields }
OpenAI Authentication Reverse Engineered
func NewAuthenticator ¶
func NewAuthenticator(cfg *AuthConfig) *Authenticator
func (*Authenticator) AccessToken ¶
func (auth *Authenticator) AccessToken() string
func (*Authenticator) GetAccessToken ¶
func (auth *Authenticator) GetAccessToken() error
Gets access token
func (*Authenticator) Loin ¶
func (auth *Authenticator) Loin() error
type Author ¶
type Author struct { Role string `json:"role"` Name interface{} `json:"name,omitempty"` }
type ChatGPTUnoBot ¶
type ChatGPTUnoBot struct {
// contains filtered or unexported fields
}
func NewChatGPTUnoBot ¶
func NewChatGPTUnoBot(cfg *ChatGPTUnoConfig) *ChatGPTUnoBot
func (*ChatGPTUnoBot) Ask ¶
func (chat *ChatGPTUnoBot) Ask(prompt, conversationId, parentId, model string, timeout int, callback func(chatRes *Response, err error)) (err error)
The standard ChatGPT model: text-davinci-002-render-sha Turbo (Default for free users)
func (*ChatGPTUnoBot) BaseURL ¶
func (chat *ChatGPTUnoBot) BaseURL() string
func (*ChatGPTUnoBot) ClearConversations ¶
func (chat *ChatGPTUnoBot) ClearConversations() error
func (*ChatGPTUnoBot) DeleteConversation ¶
func (chat *ChatGPTUnoBot) DeleteConversation(conversationId string) error
func (*ChatGPTUnoBot) Init ¶
func (chat *ChatGPTUnoBot) Init() error
func (*ChatGPTUnoBot) Login ¶
func (chat *ChatGPTUnoBot) Login() error
func (*ChatGPTUnoBot) SetAccessToken ¶
func (chat *ChatGPTUnoBot) SetAccessToken(accessToken string)
type ChatGPTUnoConfig ¶
type ConversationNode ¶
func (*ConversationNode) ConversationId ¶
func (node *ConversationNode) ConversationId() string
func (*ConversationNode) CurrentNode ¶
func (node *ConversationNode) CurrentNode() string
func (*ConversationNode) SetConversationId ¶
func (node *ConversationNode) SetConversationId(conversationId string)
func (*ConversationNode) SetConversationInfo ¶
func (node *ConversationNode) SetConversationInfo(info gjson.Result)
func (*ConversationNode) SetCurrentNode ¶
func (node *ConversationNode) SetCurrentNode(parentId string)
func (*ConversationNode) SetHistory ¶
func (node *ConversationNode) SetHistory(history gjson.Result)
func (*ConversationNode) SetTitle ¶
func (node *ConversationNode) SetTitle(title string)
func (*ConversationNode) Title ¶
func (node *ConversationNode) Title() string
type FinishDetail ¶
type Mapping ¶
func NewMapping ¶
func NewMapping() *Mapping
func (*Mapping) GetConversationNode ¶
func (mapping *Mapping) GetConversationNode(convId string) *ConversationNode
func (*Mapping) SetConversationNode ¶
func (mapping *Mapping) SetConversationNode(convId string, node *ConversationNode)
type Message ¶
type Message struct { ID string `json:"id"` Author Author `json:"author"` CreateTime float64 `json:"create_time"` UpdateTime *float64 `json:"update_time,omitempty"` Content ResContent `json:"content"` EndTurn bool `json:"end_turn"` Weight float64 `json:"weight"` Metadata Metadata `json:"metadata"` Recipient string `json:"recipient"` }
type Metadata ¶
type Metadata struct { MessageType string `json:"message_type"` ModelSlug string `json:"model_slug"` FinishDetails FinishDetail `json:"finish_details"` }
type NextAction ¶
type NextAction struct { Action string `json:"action"` Messages []PromptMessage `json:"messages"` ConversationID *string `json:"conversation_id,omitempty"` ParentMessageID string `json:"parent_message_id"` Model interface{} `json:"model"` }
func NewNextAction ¶
func NewNextAction(prompt string, conversationId, parentId string, model string) *NextAction
func (*NextAction) Byte ¶
func (nextAction *NextAction) Byte() []byte
func (*NextAction) String ¶
func (nextAction *NextAction) String() string
type PromptMessage ¶
type PromptMessage struct { ID string `json:"id"` Role string `json:"role"` Author map[string]string `json:"author"` Content ReqContent `json:"content"` }
type ReqContent ¶
type Requests ¶
type Requests struct {
// contains filtered or unexported fields
}
func NewRequests ¶
func (*Requests) SetHeaders ¶
func (*Requests) SetNoRedirects ¶
func (r *Requests) SetNoRedirects()
func (*Requests) SetTimeout ¶
type ResContent ¶
Click to show internal directories.
Click to hide internal directories.