 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type ChatGPT
- func (x *ChatGPT) GetConversationID() string
- func (x *ChatGPT) GetParentMessageID() string
- func (x *ChatGPT) GetUserAgent() string
- func (x *ChatGPT) SetConversationID(conversationID string)
- func (x *ChatGPT) SetJWT(jwt string)
- func (x *ChatGPT) SetParentMessageID(parentMessageID string)
- func (x *ChatGPT) SetUserAgent(userAgent string)
- func (x *ChatGPT) Talk(question string) (*Response, error)
 
- type Request
- type RequestContent
- type RequestMessage
- type Response
- type ResponseContent
- type ResponseMessage
- type ResponseMetadata
Constants ¶
      View Source
      
  
const ConversationAPIURL = "https://chat.openai.com/backend-api/conversation"
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatGPT ¶
type ChatGPT struct {
	// contains filtered or unexported fields
}
    func NewChatGPT ¶
func (*ChatGPT) GetConversationID ¶
func (*ChatGPT) GetParentMessageID ¶
func (*ChatGPT) GetUserAgent ¶
func (*ChatGPT) SetConversationID ¶
func (*ChatGPT) SetParentMessageID ¶
func (*ChatGPT) SetUserAgent ¶
type Request ¶
type Request struct {
	Action          string           `json:"action"`
	Messages        []RequestMessage `json:"messages"`
	ConversationID  *string          `json:"conversation_id"`
	ParentMessageID *string          `json:"parent_message_id"`
	Model           string           `json:"model"`
}
    func NewRequest ¶
type RequestContent ¶
type RequestMessage ¶
type RequestMessage struct {
	ID      string         `json:"id"`
	Role    string         `json:"role"`
	Content RequestContent `json:"content"`
}
    type Response ¶
type Response struct {
	Message        ResponseMessage `json:"message"`
	ConversationID string          `json:"conversation_id"`
	Error          any             `json:"error"`
}
    type ResponseContent ¶
type ResponseMessage ¶
type ResponseMessage struct {
	ID         string           `json:"id"`
	Role       string           `json:"role"`
	User       any              `json:"user"`
	CreateTime any              `json:"create_time"`
	UpdateTime any              `json:"update_time"`
	Content    ResponseContent  `json:"content"`
	EndTurn    any              `json:"end_turn"`
	Weight     float64          `json:"weight"`
	Metadata   ResponseMetadata `json:"metadata"`
	Recipient  string           `json:"recipient"`
}
    type ResponseMetadata ¶
type ResponseMetadata struct {
}
     Click to show internal directories. 
   Click to hide internal directories. 
