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) (*relaymodel.Usage, *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: relaymode.Rerank, Owner: model.ModelOwnerBAAI, InputPrice: 0.0009, OutputPrice: 0, RPM: 2000, }, { Model: "BAAI/bge-large-zh-v1.5", Type: relaymode.Embeddings, Owner: model.ModelOwnerBAAI, InputPrice: 0.0005, RPM: 2000, }, { Model: "fishaudio/fish-speech-1.4", Type: relaymode.AudioSpeech, Owner: model.ModelOwnerFishAudio, OutputPrice: 0.105, 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: relaymode.AudioTranscription, Owner: model.ModelOwnerFunAudioLLM, }, { Model: "stabilityai/stable-diffusion-3-5-large", Type: relaymode.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: relaymode.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 (a *Adaptor) DoResponse(meta *meta.Meta, c *gin.Context, resp *http.Response) (*relaymodel.Usage, *relaymodel.ErrorWithStatusCode)
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.