platform

package
v0.0.0-...-cfad31d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: GPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChatCompletions

func CreateChatCompletions(c *gin.Context)

func CreateCompletions

func CreateCompletions(c *gin.Context)

func CreateEdit

func CreateEdit(c *gin.Context)

func CreateEmbeddings

func CreateEmbeddings(c *gin.Context)

func CreateImage

func CreateImage(c *gin.Context)

func GetApiKeys

func GetApiKeys(c *gin.Context)

func GetCreditGrants

func GetCreditGrants(c *gin.Context)

func GetSubscription

func GetSubscription(c *gin.Context)

func ListFiles

func ListFiles(c *gin.Context)

func ListModels

func ListModels(c *gin.Context)

func Login

func Login(c *gin.Context)

func RetrieveModel

func RetrieveModel(c *gin.Context)

Types

type ChatCompletionsMessage

type ChatCompletionsMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
	Name    string `json:"name,omitempty"`
}

type ChatCompletionsRequest

type ChatCompletionsRequest struct {
	Model            string                   `json:"model"`
	Messages         []ChatCompletionsMessage `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  int                      `json:"presence_penalty,omitempty"`
	FrequencyPenalty int                      `json:"frequency_penalty,omitempty"`
	LogitBias        map[string]interface{}   `json:"logit_bias,omitempty"`
	User             string                   `json:"user,omitempty"`
}

type CreateCompletionsRequest

type CreateCompletionsRequest struct {
	Model            string                 `json:"model"`
	Prompt           string                 `json:"prompt,omitempty"`
	Suffix           string                 `json:"suffix,omitempty"`
	MaxTokens        int                    `json:"max_tokens,omitempty"`
	Temperature      int                    `json:"temperature,omitempty"`
	TopP             int                    `json:"top_p,omitempty"`
	N                int                    `json:"n,omitempty"`
	Stream           bool                   `json:"stream,omitempty"`
	Logprobs         int                    `json:"logprobs,omitempty"`
	Echo             bool                   `json:"echo,omitempty"`
	Stop             string                 `json:"stop,omitempty"`
	PresencePenalty  int                    `json:"presence_penalty,omitempty"`
	FrequencyPenalty int                    `json:"frequency_penalty,omitempty"`
	BestOf           int                    `json:"best_of,omitempty"`
	LogitBias        map[string]interface{} `json:"logit_bias,omitempty"`
	User             string                 `json:"user,omitempty"`
}

type CreateEditRequest

type CreateEditRequest struct {
	Model       string `json:"model"`
	Input       string `json:"input"`
	Instruction string `json:"instruction"`
	N           int    `json:"n,omitempty"`
	Temperature int    `json:"temperature,omitempty"`
	TopP        int    `json:"top_p,omitempty"`
}

type CreateEmbeddingsRequest

type CreateEmbeddingsRequest struct {
	Model string `json:"model"`
	Input string `json:"input"`
	User  string `json:"user,omitempty"`
}

type CreateImageRequest

type CreateImageRequest struct {
	Prompt         string `json:"prompt"`
	N              int    `json:"n,omitempty"`
	Size           string `json:"size,omitempty"`
	ResponseFormat string `json:"response_format,omitempty"`
	User           string `json:"user,omitempty"`
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	ClientID    string `json:"client_id"`
	GrantType   string `json:"grant_type"`
	Code        string `json:"code"`
	RedirectURI string `json:"redirect_uri"`
}

type GetAccessTokenResponse

type GetAccessTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	Scope        string `json:"scope"`
	ExpiresIn    int    `json:"expires_in"`
	TokenType    string `json:"token_type"`
}

type UserLogin

type UserLogin struct {
	// contains filtered or unexported fields
}

func (*UserLogin) CheckPassword

func (userLogin *UserLogin) CheckPassword(state string, username string, password string) (string, int, error)

func (*UserLogin) CheckUsername

func (userLogin *UserLogin) CheckUsername(state string, username string) (int, error)

func (*UserLogin) GetAccessToken

func (userLogin *UserLogin) GetAccessToken(code string) (string, int, error)

func (*UserLogin) GetAuthorizedUrl

func (userLogin *UserLogin) GetAuthorizedUrl(csrfToken string) (string, int, error)

func (*UserLogin) GetState

func (userLogin *UserLogin) GetState(authorizedUrl string) (string, int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL