controller

package
v0.0.0-...-d98d1a9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChannel

func AddChannel(c *gin.Context)

func AddChannels

func AddChannels(c *gin.Context)

func AddToken

func AddToken(c *gin.Context)

func AutomaticallyTestChannels

func AutomaticallyTestChannels(frequency int)

func AutomaticallyUpdateChannels

func AutomaticallyUpdateChannels(frequency int)

func BuiltinModels

func BuiltinModels(c *gin.Context)

func ChannelDefaultModelMapping

func ChannelDefaultModelMapping(c *gin.Context)

func ChannelDefaultModelMappingByType

func ChannelDefaultModelMappingByType(c *gin.Context)

func ChannelDefaultModels

func ChannelDefaultModels(c *gin.Context)

func ChannelDefaultModelsAndMapping

func ChannelDefaultModelsAndMapping(c *gin.Context)

func ChannelDefaultModelsAndMappingByType

func ChannelDefaultModelsAndMappingByType(c *gin.Context)

func ChannelDefaultModelsByType

func ChannelDefaultModelsByType(c *gin.Context)

func CreateGroup

func CreateGroup(c *gin.Context)

func DeleteChannel

func DeleteChannel(c *gin.Context)

func DeleteGroup

func DeleteGroup(c *gin.Context)

func DeleteGroupToken

func DeleteGroupToken(c *gin.Context)

func DeleteHistoryLogs

func DeleteHistoryLogs(c *gin.Context)

func DeleteToken

func DeleteToken(c *gin.Context)

func EnabledModels

func EnabledModels(c *gin.Context)

func EnabledModelsAndPrice

func EnabledModelsAndPrice(c *gin.Context)

func EnabledType2Models

func EnabledType2Models(c *gin.Context)

func EnabledType2ModelsAndPrice

func EnabledType2ModelsAndPrice(c *gin.Context)

func GetAllChannels

func GetAllChannels(c *gin.Context)

func GetAuthHeader

func GetAuthHeader(token string) http.Header

GetAuthHeader get auth header

func GetChannel

func GetChannel(c *gin.Context)

func GetChannels

func GetChannels(c *gin.Context)

func GetGroup

func GetGroup(c *gin.Context)

func GetGroupDashboard

func GetGroupDashboard(c *gin.Context)

func GetGroupLogs

func GetGroupLogs(c *gin.Context)

func GetGroupToken

func GetGroupToken(c *gin.Context)

func GetGroupTokens

func GetGroupTokens(c *gin.Context)

func GetGroups

func GetGroups(c *gin.Context)

func GetLogs

func GetLogs(c *gin.Context)

func GetLogsSelfStat

func GetLogsSelfStat(c *gin.Context)

func GetLogsStat

func GetLogsStat(c *gin.Context)

func GetOptions

func GetOptions(c *gin.Context)

func GetResponseBody

func GetResponseBody(method, url string, _ *model.Channel, headers http.Header) ([]byte, error)

func GetStatus

func GetStatus(c *gin.Context)

func GetSubscription

func GetSubscription(c *gin.Context)

subscription

func GetToken

func GetToken(c *gin.Context)

func GetTokens

func GetTokens(c *gin.Context)

func GetUsage

func GetUsage(c *gin.Context)

func ListModels

func ListModels(c *gin.Context)

func ModelPrice

func ModelPrice(c *gin.Context)

func Relay

func Relay(c *gin.Context)

func RelayNotFound

func RelayNotFound(c *gin.Context)

func RelayNotImplemented

func RelayNotImplemented(c *gin.Context)

func RetrieveModel

func RetrieveModel(c *gin.Context)

func SearchChannels

func SearchChannels(c *gin.Context)

func SearchConsumeError

func SearchConsumeError(c *gin.Context)

func SearchGroupLogs

func SearchGroupLogs(c *gin.Context)

func SearchGroupTokens

func SearchGroupTokens(c *gin.Context)

func SearchGroups

func SearchGroups(c *gin.Context)

func SearchLogs

func SearchLogs(c *gin.Context)

func SearchTokens

func SearchTokens(c *gin.Context)

func TestChannel

func TestChannel(c *gin.Context)

func TestChannels

func TestChannels(c *gin.Context)

func UpdateAllChannelsBalance

func UpdateAllChannelsBalance(c *gin.Context)

func UpdateChannel

func UpdateChannel(c *gin.Context)

func UpdateChannelBalance

func UpdateChannelBalance(c *gin.Context)

func UpdateChannelStatus

func UpdateChannelStatus(c *gin.Context)

func UpdateGroupQPM

func UpdateGroupQPM(c *gin.Context)

func UpdateGroupStatus

func UpdateGroupStatus(c *gin.Context)

func UpdateGroupToken

func UpdateGroupToken(c *gin.Context)

func UpdateGroupTokenName

func UpdateGroupTokenName(c *gin.Context)

func UpdateGroupTokenStatus

func UpdateGroupTokenStatus(c *gin.Context)

func UpdateOption

func UpdateOption(c *gin.Context)

func UpdateOptions

func UpdateOptions(c *gin.Context)

func UpdateToken

func UpdateToken(c *gin.Context)

func UpdateTokenName

func UpdateTokenName(c *gin.Context)

func UpdateTokenStatus

func UpdateTokenStatus(c *gin.Context)

Types

type AIProxyUserOverviewResponse

type AIProxyUserOverviewResponse struct {
	Message   string `json:"message"`
	ErrorCode int    `json:"error_code"`
	Data      struct {
		TotalPoints float64 `json:"totalPoints"`
	} `json:"data"`
	Success bool `json:"success"`
}

type APGC2DGPTUsageResponse

type APGC2DGPTUsageResponse struct {
	// Grants         interface{} `json:"grants"`
	Object         string  `json:"object"`
	TotalAvailable float64 `json:"total_available"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
}

type API2GPTUsageResponse

type API2GPTUsageResponse struct {
	Object         string  `json:"object"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
	TotalRemaining float64 `json:"total_remaining"`
}

type AddChannelRequest

type AddChannelRequest struct {
	ModelMapping map[string]string   `json:"model_mapping"`
	Config       model.ChannelConfig `json:"config"`
	Name         string              `json:"name"`
	Key          string              `json:"key"`
	BaseURL      string              `json:"base_url"`
	Other        string              `json:"other"`
	Models       []string            `json:"models"`
	Type         int                 `json:"type"`
	Priority     int32               `json:"priority"`
	Status       int                 `json:"status"`
}

func (*AddChannelRequest) ToChannel

func (r *AddChannelRequest) ToChannel() *model.Channel

func (*AddChannelRequest) ToChannels

func (r *AddChannelRequest) ToChannels() []*model.Channel

type AddTokenRequest

type AddTokenRequest struct {
	Name      string   `json:"name"`
	Subnet    string   `json:"subnet"`
	Models    []string `json:"models"`
	ExpiredAt int64    `json:"expiredAt"`
	Quota     float64  `json:"quota"`
}

type CreateGroupRequest

type CreateGroupRequest struct {
	ID  string `json:"id"`
	QPM int64  `json:"qpm"`
}

type OpenAICreditGrants

type OpenAICreditGrants struct {
	Object         string  `json:"object"`
	TotalGranted   float64 `json:"total_granted"`
	TotalUsed      float64 `json:"total_used"`
	TotalAvailable float64 `json:"total_available"`
}

type OpenAIModelPermission

type OpenAIModelPermission struct {
	Group              *string `json:"group"`
	ID                 string  `json:"id"`
	Object             string  `json:"object"`
	Organization       string  `json:"organization"`
	Created            int     `json:"created"`
	AllowCreateEngine  bool    `json:"allow_create_engine"`
	AllowSampling      bool    `json:"allow_sampling"`
	AllowLogprobs      bool    `json:"allow_logprobs"`
	AllowSearchIndices bool    `json:"allow_search_indices"`
	AllowView          bool    `json:"allow_view"`
	AllowFineTuning    bool    `json:"allow_fine_tuning"`
	IsBlocking         bool    `json:"is_blocking"`
}

type OpenAIModels

type OpenAIModels struct {
	Parent     *string                 `json:"parent"`
	ID         string                  `json:"id"`
	Object     string                  `json:"object"`
	OwnedBy    string                  `json:"owned_by"`
	Root       string                  `json:"root"`
	Permission []OpenAIModelPermission `json:"permission"`
	Created    int                     `json:"created"`
}

type OpenAISBUsageResponse

type OpenAISBUsageResponse struct {
	Data *struct {
		Credit string `json:"credit"`
	} `json:"data"`
	Msg string `json:"msg"`
}

type OpenAISubscriptionResponse

type OpenAISubscriptionResponse struct {
	Object             string  `json:"object"`
	HasPaymentMethod   bool    `json:"has_payment_method"`
	SoftLimitUSD       float64 `json:"soft_limit_usd"`
	HardLimitUSD       float64 `json:"hard_limit_usd"`
	SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
	AccessUntil        int64   `json:"access_until"`
}

type OpenAIUsageDailyCost

type OpenAIUsageDailyCost struct {
	LineItems []struct {
		Name string  `json:"name"`
		Cost float64 `json:"cost"`
	}
	Timestamp float64 `json:"timestamp"`
}

type OpenAIUsageResponse

type OpenAIUsageResponse struct {
	Object string `json:"object"`
	// DailyCosts []OpenAIUsageDailyCost `json:"daily_costs"`
	TotalUsage float64 `json:"total_usage"` // unit: 0.01 dollar
}

type SiliconFlowUsageResponse

type SiliconFlowUsageResponse struct {
	Message string `json:"message"`
	Data    struct {
		ID            string `json:"id"`
		Name          string `json:"name"`
		Image         string `json:"image"`
		Email         string `json:"email"`
		Balance       string `json:"balance"`
		Status        string `json:"status"`
		Introduction  string `json:"introduction"`
		Role          string `json:"role"`
		ChargeBalance string `json:"chargeBalance"`
		TotalBalance  string `json:"totalBalance"`
		Category      string `json:"category"`
		IsAdmin       bool   `json:"isAdmin"`
	} `json:"data"`
	Code   int  `json:"code"`
	Status bool `json:"status"`
}

type StatusData

type StatusData struct {
	StartTime int64 `json:"startTime"`
}

type UpdateChannelRequest

type UpdateChannelRequest struct {
	AddChannelRequest
	ID int `json:"id"`
}

func (*UpdateChannelRequest) ToChannel

func (r *UpdateChannelRequest) ToChannel() *model.Channel

type UpdateChannelStatusRequest

type UpdateChannelStatusRequest struct {
	Status int `json:"status"`
}

type UpdateGroupQPMRequest

type UpdateGroupQPMRequest struct {
	QPM int64 `json:"qpm"`
}

type UpdateGroupStatusRequest

type UpdateGroupStatusRequest struct {
	Status int `json:"status"`
}

type UpdateGroupTokenStatusRequest

type UpdateGroupTokenStatusRequest struct {
	UpdateTokenStatusRequest
}

type UpdateTokenNameRequest

type UpdateTokenNameRequest struct {
	Name string `json:"name"`
}

type UpdateTokenStatusRequest

type UpdateTokenStatusRequest struct {
	Status int `json:"status"`
}

Jump to

Keyboard shortcuts

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