entity

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse[T any] interface {
	BindError(err error)
	BindData(data T)
}

type BatchModifyWhisperUserBalanceRequest

type BatchModifyWhisperUserBalanceRequest struct {
	Users        []int           `json:"users" vc:"key:users,required"`
	ChangeAmount decimal.Decimal `json:"change_amount" vc:"key:change_amount,required"`
	Action       string          `json:"action" vc:"key:action,required"`
	Reason       string          `json:"reason" vc:"key:reason,required"`
}

type BatchModifyWhisperUserBalanceResult

type BatchModifyWhisperUserBalanceResult struct {
	Success bool `json:"success"`
}

type ClientItem

type ClientItem struct {
	ID       int             `json:"id"`
	Name     string          `json:"name"`
	ApiKey   string          `json:"api_key"`
	Endpoint string          `json:"endpoint"`
	Weight   int             `json:"weight"`
	Balance  decimal.Decimal `json:"balance"`
}

type CreateClientModelItem

type CreateClientModelItem struct {
	Name            string          `json:"name" vc:"key:name,required"`
	MaxTokens       int             `json:"max_tokens" vc:"key:max_tokens,required"`
	PromptPrice     decimal.Decimal `json:"prompt_price" vc:"key:prompt_price,required"`
	CompletionPrice decimal.Decimal `json:"completion_price" vc:"key:completion_price,required"`
	RpmLimit        int             `json:"rpm_limit,omitempty"`
	TpmLimit        int             `json:"tpm_limit,omitempty"`
}

type CreateClientModelRequest

type CreateClientModelRequest struct {
	Models []CreateClientModelItem `json:"models" vc:"key:models,required"`
}

type CreateClientModelResponse

type CreateClientModelResponse = http.BaseResponse[*CreateResponse]

type CreateClientRequest

type CreateClientRequest struct {
	Name     string `json:"name" vc:"key:name,required"`
	ApiKey   string `json:"api_key" vc:"key:api_key,required"`
	Endpoint string `json:"endpoint" vc:"key:endpoint,required"`
	Weight   int    `json:"weight" vc:"key:weight,required"`
}

type CreateClientResponse

type CreateClientResponse = http.BaseResponse[[]*CreateClientScanModelItem]

type CreateClientScanModelItem

type CreateClientScanModelItem struct {
	ModelName string `json:"model_name"`
	CreatedAt int64  `json:"created_at"`
}

type CreateResponse

type CreateResponse struct {
	Success bool `json:"success"`
}

type CreateWhisperUserRequest

type CreateWhisperUserRequest struct {
	Email    string   `json:"email" vc:"key:email,required"`
	Language string   `json:"language,omitempty" vc:"key:language"`
	AllowIPs []string `json:"allow_ips,omitempty" vc:"key:allow_ips"`
	Role     string   `json:"role,omitempty" vc:"key:role"`
}

type CreateWhisperUserResponse

type CreateWhisperUserResponse = http.BaseResponse[*WhisperUserResult]

type GetWhisperUserRequest

type GetWhisperUserRequest = http.NoBody

type GetWhisperUserResponse

type GetWhisperUserResponse = http.BaseResponse[*WhisperUserInfo]

type ListClientModelRequest

type ListClientModelRequest = http.NoBody

type ListClientModelResponse

type ListClientModelResponse = http.BaseResponse[[]*ModelItem]

type ListClientResponse

type ListClientResponse = http.BaseResponse[[]*ClientItem]

type ListClientsRequest

type ListClientsRequest = http.NoBody

type ListWhisperUserBalanceLogsRequest

type ListWhisperUserBalanceLogsRequest = http.NoBody

type ListWhisperUserBalanceLogsResponse

type ListWhisperUserBalanceLogsResponse = http.BaseResponse[[]*WhisperUserBalanceLog]

type ListWhisperUserPermissionsRequest

type ListWhisperUserPermissionsRequest = http.NoBody

type ListWhisperUserPermissionsResponse

type ListWhisperUserPermissionsResponse = http.BaseResponse[[]*WhisperUserClientPermission]

type ListWhisperUsersRequest

type ListWhisperUsersRequest = http.NoBody

type ListWhisperUsersResponse

type ListWhisperUsersResponse = http.BaseResponse[[]*WhisperUserResult]

type LoginToken

type LoginToken struct {
	IP        string    `json:"ip"`
	CreatedAt time.Time `json:"created_at"`
}

type ModelItem

type ModelItem struct {
	ID              int             `json:"id"`
	Name            string          `json:"name"`
	MaxTokens       int             `json:"max_tokens"`
	RpmLimit        int             `json:"rpm_limit"`
	TpmLimit        int             `json:"tpm_limit"`
	PromptPrice     decimal.Decimal `json:"prompt_price"`
	CompletionPrice decimal.Decimal `json:"completion_price"`
	LastUpdatedAt   int64           `json:"last_updated_at"`
}

type ModifyOpenaiClientBalanceRequest

type ModifyOpenaiClientBalanceRequest struct {
	ChangeAmount decimal.Decimal                     `json:"change_amount" vc:"key:change_amount,required"`
	Action       model.EnumOpenaiClientBalanceAction `json:"action" vc:"key:action,required"`
	Reason       string                              `json:"reason" vc:"key:reason,required"`
}

type ModifyOpenaiClientBalanceResult

type ModifyOpenaiClientBalanceResult struct {
	Remaining decimal.Decimal `json:"remaining"`
}

type ModifyWhisperUserBalanceRequest

type ModifyWhisperUserBalanceRequest struct {
	ChangeAmount decimal.Decimal `json:"change_amount" vc:"key:change_amount,required"`
	Action       string          `json:"action" vc:"key:action,required"`
	Reason       string          `json:"reason" vc:"key:reason,required"`
}

type ModifyWhisperUserBalanceResponse

type ModifyWhisperUserBalanceResponse = http.BaseResponse[*WhisperUserBalanceLog]

type ModifyWhisperUserClientPermissions

type ModifyWhisperUserClientPermissions struct {
	ClientName string   `json:"client_name" vc:"key:client_name,required"`
	Models     []string `json:"models" vc:"key:models,required"`
}

type ModifyWhisperUserPermissionRequest

type ModifyWhisperUserPermissionRequest struct {
	Permissions []ModifyWhisperUserClientPermissions `json:"permissions" vc:"key:permissions,required"`
}

type ModifyWhisperUserPermissionResult

type ModifyWhisperUserPermissionResult struct {
	Success bool `json:"success"`
}

type OverviewClientBalanceLog

type OverviewClientBalanceLog struct {
	ClientName   string          `json:"client_name"`
	TotalRequest int             `json:"total_request"`
	TotalCost    decimal.Decimal `json:"total_cost"`
	Date         string          `json:"date"`
}

type OverviewRequest

type OverviewRequest = http.NoBody

type OverviewResponse

type OverviewResponse = http.BaseResponse[*OverviewResult]

type OverviewResult

type OverviewResult struct {
	Clients           []ClientItem               `json:"clients"`
	ClientBalanceLogs []OverviewClientBalanceLog `json:"client_balance_logs"`
}

type UpdateWhisperUserRequest

type UpdateWhisperUserRequest struct {
	Email           string   `json:"email,omitempty" vc:"key:email,required"`
	Language        string   `json:"language,omitempty" vc:"key:language,required"`
	AllowIPs        []string `json:"allow_ips,omitempty" vc:"key:allow_ips"`
	RefreshApiToken bool     `json:"refresh_api_token,omitempty" vc:"key:refresh_api_token"`
}

type UpdateWhisperUserResponse

type UpdateWhisperUserResponse = http.BaseResponse[*WhisperUserResult]

type WhisperUserBalanceLog

type WhisperUserBalanceLog struct {
	ID           int             `json:"id,omitempty"`
	ChangeAmount decimal.Decimal `json:"change_amount"`
	Remaining    decimal.Decimal `json:"remaining"`
	Action       string          `json:"action"`
	Reason       string          `json:"reason"`
	CreatedAt    string          `json:"created_at"`
}

type WhisperUserClientPermission

type WhisperUserClientPermission struct {
	ClientID   int                          `json:"client_id"`
	ClientName string                       `json:"client_name"`
	Models     []WhisperUserModelPermission `json:"models"`
}

type WhisperUserInfo

type WhisperUserInfo struct {
	ID              int             `json:"id"`
	Email           string          `json:"email"`
	ApiKey          string          `json:"api_key"`
	Role            string          `json:"role"`
	Language        string          `json:"language"`
	Balance         decimal.Decimal `json:"balance"`
	AvailableModels []string        `json:"available_models"`
	UpdatedAt       string          `json:"updated_at"`
	AllowIPs        []string        `json:"allow_ips,omitempty"`
}

type WhisperUserModelPermission

type WhisperUserModelPermission struct {
	ModelID   int    `json:"model_id"`
	ModelName string `json:"model_name"`
}

type WhisperUserResult

type WhisperUserResult struct {
	ID       int      `json:"id"`
	ApiKey   string   `json:"api_key"`
	Email    string   `json:"email"`
	Language string   `json:"language"`
	AllowIPs []string `json:"allow_ips"`
}

Jump to

Keyboard shortcuts

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