siliconflow

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageGenerations

type ImageGenerations struct {
	Prompt            string  `json:"prompt"`
	ImageSize         string  `json:"image_size"`
	Seed              int64   `json:"seed,omitempty"`
	NumInferenceSteps int64   `json:"num_inference_steps,omitempty"`
	NegativePrompt    string  `json:"negative_prompt,omitempty"`
	BatchSize         int     `json:"batch_size,omitempty"`
	GuidanceScale     float64 `json:"guidance_scale,omitempty"`
}

type ImageImings

type ImageImings struct {
	Inference float64 `json:"inference"`
}

type ImageRes

type ImageRes struct {
	Images  []*ImagesData `json:"images"`
	Timings *ImageImings  `json:"timings,omitempty"`
	Seed    int64         `json:"seed,omitempty"`
}

type ImagesData

type ImagesData struct {
	Url string `json:"url"`
}

type Meta

type Meta struct {
	Tokens *Tokens `json:"tokens,omitempty"`
}

type RerankRequest

type RerankRequest struct {
	Model           string   `json:"model"`
	Query           string   `json:"query"`
	TopN            int      `json:"top_n"`
	ReturnDocuments bool     `json:"return_documents"`
	Documents       []string `json:"documents"`
}

type RerankResponse

type RerankResponse struct {
	Id      string               `json:"id"`
	Results []types.RerankResult `json:"results"`
	Meta    *Meta                `json:"meta,omitempty"`
}

type Response

type Response struct {
	Code    int       `json:"code"`
	Message string    `json:"message"`
	Data    *UserInfo `json:"data,omitempty"`
}

type SiliError

type SiliError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type SiliconflowProvider

type SiliconflowProvider struct {
	openai.OpenAIProvider
}

func (*SiliconflowProvider) Balance

func (p *SiliconflowProvider) Balance() (float64, error)

func (*SiliconflowProvider) ConvertToRerank

func (*SiliconflowProvider) CreateImageGenerations

func (p *SiliconflowProvider) CreateImageGenerations(request *types.ImageRequest) (*types.ImageResponse, *types.OpenAIErrorWithStatusCode)

func (*SiliconflowProvider) CreateRerank

func (*SiliconflowProvider) GetFullRequestURL

func (p *SiliconflowProvider) GetFullRequestURL(requestURL string, modelName string) string

获取完整请求 URL

func (*SiliconflowProvider) GetRequestHeaders

func (p *SiliconflowProvider) GetRequestHeaders() (headers map[string]string)

获取请求头

type SiliconflowProviderFactory

type SiliconflowProviderFactory struct{}

func (SiliconflowProviderFactory) Create

创建 SiliconflowProvider

type Tokens

type Tokens struct {
	InputTokens  int `json:"input_tokens"`
	OutputTokens int `json:"output_tokens"`
}

type UserInfo

type UserInfo struct {
	ID           string `json:"id"`
	Balance      string `json:"balance"`
	TotalBalance string `json:"totalBalance"`
}

Jump to

Keyboard shortcuts

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