Documentation
¶
Index ¶
- func ConvertToString(chatgptResponse *ChatGPTResponse, previous_text *StringStruct, role bool) string
- func EnginesHandler(c *gin.Context)
- func GETengines() (interface{}, int, error)
- func HandleRequestError(c *gin.Context, response *http.Response) bool
- func Nightmare(c *gin.Context, httpProxy string)
- func OptionsHandler(c *gin.Context)
- func POSTConversation(message ChatGPTRequest, accessToken, httpProxy string) (*http.Response, error)
- func PUidHandler(c *gin.Context)
- type APIRequest
- type AccessToken
- type Author
- type ChatCompletion
- type ChatCompletionChunk
- type ChatGPTRequest
- type ChatGPTResponse
- type Choice
- type Choices
- type Content
- type ContinueInfo
- type Delta
- type FinishDetails
- type GenericResponseLine
- 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, previous_text *StringStruct, role bool) string
func EnginesHandler ¶
func GETengines ¶
func HandleRequestError ¶
HandleRequestError Returns whether an error was handled
func OptionsHandler ¶
func POSTConversation ¶
func POSTConversation(message ChatGPTRequest, accessToken, httpProxy string) (*http.Response, error)
func PUidHandler ¶
Types ¶
type APIRequest ¶
type AccessToken ¶
type AccessToken struct {
// contains filtered or unexported fields
}
var AccessTokens AccessToken
func NewAccessToken ¶
func NewAccessToken(tokens []string) AccessToken
func (*AccessToken) GetToken ¶
func (a *AccessToken) GetToken() string
type ChatCompletion ¶
type ChatCompletion struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Usage usage `json:"usage"`
Choices []Choice `json:"choices"`
}
func NewChatCompletion ¶
func NewChatCompletion(full_test string) 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 ChatGPTRequest ¶
type ChatGPTRequest struct {
Action string `json:"action"`
Messages []chatgptMessage `json:"messages"`
ParentMessageID string `json:"parent_message_id,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Model string `json:"model"`
HistoryAndTrainingDisabled bool `json:"history_and_training_disabled"`
ArkoseToken string `json:"arkose_token,omitempty"`
PluginIDs []string `json:"plugin_ids,omitempty"`
}
func ConvertAPIRequest ¶
func ConvertAPIRequest(apiRequest APIRequest) ChatGPTRequest
func NewChatGPTRequest ¶
func NewChatGPTRequest() ChatGPTRequest
func (*ChatGPTRequest) AddMessage ¶
func (c *ChatGPTRequest) AddMessage(role string, content string)
type ChatGPTResponse ¶
type ContinueInfo ¶
type FinishDetails ¶
type GenericResponseLine ¶
type Message ¶
type Message struct {
ID string `json:"id"`
Author Author `json:"author"`
CreateTime float64 `json:"create_time"`
UpdateTime interface{} `json:"update_time"`
Content 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 {
Timestamp string `json:"timestamp_"`
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.