siliconflow

package
v0.0.0-...-d017c07 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

func ConvertImageRequest

func ConvertImageRequest(meta *meta.Meta, request *http.Request) (http.Header, io.Reader, error)

Types

type Adaptor

type Adaptor struct {
	openai.Adaptor
}

func (*Adaptor) DoResponse

func (a *Adaptor) DoResponse(meta *meta.Meta, c *gin.Context, resp *http.Response) (*relaymodel.Usage, *relaymodel.ErrorWithStatusCode)

func (*Adaptor) GetBalance

func (a *Adaptor) GetBalance(channel *model.Channel) (float64, error)

func (*Adaptor) GetBaseURL

func (a *Adaptor) GetBaseURL() string

func (*Adaptor) GetChannelName

func (a *Adaptor) GetChannelName() string

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"`
}

Jump to

Keyboard shortcuts

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