Documentation ¶
Index ¶
- type ChatGPT
- func (c *ChatGPT) CreateChatRequest(message string) ChatRequest
- func (c *ChatGPT) CreateEditRequest(instruction, message string) EditRequest
- func (c *ChatGPT) CreateImage(message string) (*CreateImageResponse, error)
- func (c *ChatGPT) CreateImageRequest(message string) CreateImageRequest
- func (c *ChatGPT) CreateRequest() *resty.Request
- func (c *ChatGPT) Edit(instruction, message string) (*ChatResponse, error)
- func (c *ChatGPT) InitApi()
- func (c *ChatGPT) Talk(message string) (*ChatResponse, error)
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type Choice
- type CreateImageRequest
- type CreateImageResponse
- type EditRequest
- type UrlReponse
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatGPT ¶
type ChatGPT struct { ApiKey string GptModel string ChatUrl string CreateImageUrl string EditUrl string }
func NewChatGPT ¶
func NewChatGPT() *ChatGPT
func (*ChatGPT) CreateChatRequest ¶
func (c *ChatGPT) CreateChatRequest(message string) ChatRequest
func (*ChatGPT) CreateEditRequest ¶
func (c *ChatGPT) CreateEditRequest(instruction, message string) EditRequest
func (*ChatGPT) CreateImage ¶
func (c *ChatGPT) CreateImage(message string) (*CreateImageResponse, error)
func (*ChatGPT) CreateImageRequest ¶
func (c *ChatGPT) CreateImageRequest(message string) CreateImageRequest
func (*ChatGPT) CreateRequest ¶
func (c *ChatGPT) CreateRequest() *resty.Request
type ChatMessage ¶
type ChatRequest ¶
type ChatRequest struct { Model string `json:"model"` Messages []ChatMessage `json:"messages"` Temperature *int `json:"temperature,omitempty"` TopP *int `json:"top_p,omitempty"` N *int `json:"n,omitempty"` Stream *bool `json:"stream,omitempty"` Stop *string `json:"stop,omitempty"` MaxTokens *int `json:"max_tokens,omitempty"` PresencePenalty *float32 `json:"presence_penalty,omitempty"` FrequencyPenalty *float32 `json:"frequency_penalty,omitempty"` User *string `json:"user,omitempty"` }
type ChatResponse ¶
type Choice ¶
type Choice struct { Index int `json:"index"` Message ChatMessage `json:"message"` FinishReason *string `json:"finish_reason,omitempty"` }
type CreateImageRequest ¶
type CreateImageResponse ¶
type CreateImageResponse struct { Created int64 `json:"created"` Data []UrlReponse `json:"data"` }
type EditRequest ¶
type UrlReponse ¶
type UrlReponse struct {
Url string `json:"url"`
}
Click to show internal directories.
Click to hide internal directories.