Documentation
¶
Index ¶
- func ConvertToString(chatgptResponse *ChatGPTResponse, previousText *StringStruct, role bool) string
- func CreateChatCompletions(c *gin.Context)
- func GetImageSource(wg *sync.WaitGroup, url string, prompt string, token string, idx int, ...)
- func HandleRequestError(c *gin.Context, response *http.Response) bool
- func NewChatGPTRequest() chatgpt.CreateConversationRequest
- type APIRequest
- type ApiMessage
- type ChatCompletion
- type ChatCompletionChunk
- type ChatGPTResponse
- type Choice
- type Choices
- type CitaMeta
- type Citation
- type ContinueInfo
- type Delta
- type FinishDetails
- type Message
- type Metadata
- type Msg
- type StringStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToString ¶
func ConvertToString(chatgptResponse *ChatGPTResponse, previousText *StringStruct, role bool) string
func CreateChatCompletions ¶
func GetImageSource ¶
func NewChatGPTRequest ¶
func NewChatGPTRequest() chatgpt.CreateConversationRequest
Types ¶
type APIRequest ¶
type APIRequest struct { Messages []ApiMessage `json:"messages"` Stream bool `json:"stream"` Model string `json:"model"` }
type ApiMessage ¶
type ChatCompletion ¶
type ChatCompletionChunk ¶
type ChatCompletionChunk struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Model string `json:"model"` Choices []Choices `json:"choices"` }
func NewChatCompletionChunk ¶
func NewChatCompletionChunk(text string) ChatCompletionChunk
func StopChunk ¶
func StopChunk(reason string) ChatCompletionChunk
func (*ChatCompletionChunk) String ¶
func (chunk *ChatCompletionChunk) String() string
type ChatGPTResponse ¶
type ContinueInfo ¶
type FinishDetails ¶
type Message ¶
type Message struct { ID string `json:"id"` Author chatgpt.Author `json:"author"` CreateTime float64 `json:"create_time"` UpdateTime interface{} `json:"update_time"` Content chatgpt.Content `json:"content"` EndTurn interface{} `json:"end_turn"` Weight float64 `json:"weight"` Metadata Metadata `json:"metadata"` Recipient string `json:"recipient"` }
type Metadata ¶
type Metadata struct { Citations []Citation `json:"citations,omitempty"` MessageType string `json:"message_type"` FinishDetails *FinishDetails `json:"finish_details"` ModelSlug string `json:"model_slug"` Recipient string `json:"recipient"` }
type StringStruct ¶
type StringStruct struct {
Text string `json:"text"`
}
Click to show internal directories.
Click to hide internal directories.