platform

package
v0.0.0-...-5c9f918 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 13 Imported by: 0

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 CreateModeration

func CreateModeration(c *gin.Context)

func CreateSpeech

func CreateSpeech(c *gin.Context)

func CreateTranscriptions

func CreateTranscriptions(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"`
	Logprobs         bool                          `json:"logprobs,omitempty"`
	TopLogprobs      int                           `json:"top_logprobs,omitempty"`
	ResponseFormat   map[string]interface{}        `json:"response_format,omitempty"`
	Seed             int                           `json:"seed,omitempty"`
	Tools            []ChatCompletionsRequestTools `json:"tools,omitempty"`
	ToolChoice       string                        `json:"tool_choice,omitempty"`
}

type ChatCompletionsRequestTools

type ChatCompletionsRequestTools struct {
	Type string              `json:"type"`
	Func map[any]interface{} `json:"function"`
}

type CreateAudioSpeech

type CreateAudioSpeech struct {
	Input          string `json:"input"`
	Model          string `json:"model"`
	Voice          string `json:"voice"`
	ResponseFormat string `json:"response_format"`
	Speech         string `json:"speech"`
}

type CreateAudioTranscriptions

type CreateAudioTranscriptions struct {
	File                   any      `form:"file"`
	Model                  string   `form:"model"`
	Language               string   `form:"language"`
	Prompt                 string   `form:"prompt"`
	ResponseFormat         string   `form:"response_format"`
	Temperature            float32  `form:"temperature"`
	TimestampGranularities []string `form:"timestamp_granularities"`
}

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 CreateModerationRequest

type CreateModerationRequest struct {
	Model string `json:"model"`
	Input string `json:"input"`
}

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