Documentation ¶
Index ¶
- Constants
- type Author
- type ChatUnoRequest
- func (r *ChatUnoRequest) Do(method, baseUrl string) (*http.Response, error)
- func (r *ChatUnoRequest) Get(baseUrl string) (*http.Response, error)
- func (r *ChatUnoRequest) Patch(baseUrl string) (*http.Response, error)
- func (r *ChatUnoRequest) Post(baseUrl string) (*http.Response, error)
- func (r *ChatUnoRequest) SetBody(reader io.Reader)
- func (r *ChatUnoRequest) SetCookie(name, value string)
- func (r *ChatUnoRequest) SetHeaders(headers http.Header)
- func (r *ChatUnoRequest) SetNoRedirects()
- func (r *ChatUnoRequest) SetProxy(proxy string)
- func (r *ChatUnoRequest) SetTimeout(timeout int)
- type Config
- 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 ResContent
- type Response
- type UnoBot
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 Author ¶
type Author struct { Role string `json:"role"` Name interface{} `json:"name,omitempty"` }
type ChatUnoRequest ¶
type ChatUnoRequest struct {
// contains filtered or unexported fields
}
func NewRequests ¶
func NewRequests(jar http.CookieJar) *ChatUnoRequest
func (*ChatUnoRequest) Do ¶
func (r *ChatUnoRequest) Do(method, baseUrl string) (*http.Response, error)
func (*ChatUnoRequest) Patch ¶
func (r *ChatUnoRequest) Patch(baseUrl string) (*http.Response, error)
func (*ChatUnoRequest) SetBody ¶
func (r *ChatUnoRequest) SetBody(reader io.Reader)
func (*ChatUnoRequest) SetCookie ¶
func (r *ChatUnoRequest) SetCookie(name, value string)
func (*ChatUnoRequest) SetHeaders ¶
func (r *ChatUnoRequest) SetHeaders(headers http.Header)
func (*ChatUnoRequest) SetNoRedirects ¶
func (r *ChatUnoRequest) SetNoRedirects()
func (*ChatUnoRequest) SetProxy ¶
func (r *ChatUnoRequest) SetProxy(proxy string)
func (*ChatUnoRequest) SetTimeout ¶
func (r *ChatUnoRequest) SetTimeout(timeout int)
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 ResContent ¶
type Response ¶
type Response struct { Message Message `json:"message"` ConversationID string `json:"conversation_id"` Error *string `json:"error"` Raw string }
func NewResponse ¶
Click to show internal directories.
Click to hide internal directories.