Documentation
¶
Index ¶
- Variables
- func ConvertImageRequest(meta *meta.Meta, request *http.Request) (http.Header, io.Reader, error)
- type Adaptor
- func (a *Adaptor) DoResponse(meta *meta.Meta, c *gin.Context, resp *http.Response) (usage *model.Usage, err *relaymodel.ErrorWithStatusCode)
- func (a *Adaptor) GetBalance(channel *model.Channel) (float64, error)
- func (a *Adaptor) GetBaseURL() string
- func (a *Adaptor) GetChannelName() string
- func (a *Adaptor) GetModelList() []*model.ModelConfig
- type ImageRequest
- type UsageResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelList = []*model.ModelConfig{ { Model: "BAAI/bge-reranker-v2-m3", Type: mode.Rerank, Owner: model.ModelOwnerBAAI, RPM: 2000, }, { Model: "BAAI/bge-large-zh-v1.5", Type: mode.Embeddings, Owner: model.ModelOwnerBAAI, RPM: 2000, }, { Model: "fishaudio/fish-speech-1.4", Type: mode.AudioSpeech, Owner: model.ModelOwnerFishAudio, Config: map[model.ModelConfigKey]any{ model.ModelConfigSupportVoicesKey: []string{ "fishaudio/fish-speech-1.4:alex", "fishaudio/fish-speech-1.4:benjamin", "fishaudio/fish-speech-1.4:charles", "fishaudio/fish-speech-1.4:david", "fishaudio/fish-speech-1.4:anna", "fishaudio/fish-speech-1.4:bella", "fishaudio/fish-speech-1.4:claire", "fishaudio/fish-speech-1.4:diana", }, }, }, { Model: "FunAudioLLM/SenseVoiceSmall", Type: mode.AudioTranscription, Owner: model.ModelOwnerFunAudioLLM, }, { Model: "stabilityai/stable-diffusion-3-5-large", Type: mode.ImagesGenerations, Owner: model.ModelOwnerStabilityAI, ImagePrices: map[string]float64{ "1024x1024": 0, "512x1024": 0, "768x512": 0, "768x1024": 0, "1024x576": 0, "576x1024": 0, }, }, { Model: "stabilityai/stable-diffusion-3-5-large-turbo", Type: mode.ImagesGenerations, Owner: model.ModelOwnerStabilityAI, ImagePrices: map[string]float64{ "1024x1024": 0, "512x1024": 0, "768x512": 0, "768x1024": 0, "1024x576": 0, "576x1024": 0, }, }, }
Functions ¶
Types ¶
type Adaptor ¶
func (*Adaptor) DoResponse ¶
func (*Adaptor) GetBaseURL ¶
func (*Adaptor) GetChannelName ¶
func (*Adaptor) GetModelList ¶
func (a *Adaptor) GetModelList() []*model.ModelConfig
type ImageRequest ¶
type ImageRequest struct {
Model string `json:"model"`
Prompt string `json:"prompt"`
NegativePrompt string `json:"negative_prompt"`
ImageSize string `json:"image_size"`
BatchSize int `json:"batch_size"`
Seed int64 `json:"seed"`
NumInferenceSteps int `json:"num_inference_steps"`
GuidanceScale int `json:"guidance_scale"`
PromptEnhancement bool `json:"prompt_enhancement"`
}
type UsageResponse ¶
type UsageResponse 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"`
}
Click to show internal directories.
Click to hide internal directories.