Documentation
¶
Index ¶
- type ImageGenerations
- type ImageImings
- type ImageRes
- type ImagesData
- type Meta
- type RerankRequest
- type RerankResponse
- type Response
- type SiliError
- type SiliconflowProvider
- func (p *SiliconflowProvider) Balance() (float64, error)
- func (p *SiliconflowProvider) ConvertToRerank(response *RerankResponse, request *types.RerankRequest) (*types.RerankResponse, *types.OpenAIErrorWithStatusCode)
- func (p *SiliconflowProvider) CreateImageGenerations(request *types.ImageRequest) (*types.ImageResponse, *types.OpenAIErrorWithStatusCode)
- func (p *SiliconflowProvider) CreateRerank(request *types.RerankRequest) (*types.RerankResponse, *types.OpenAIErrorWithStatusCode)
- func (p *SiliconflowProvider) GetFullRequestURL(requestURL string, modelName string) string
- func (p *SiliconflowProvider) GetRequestHeaders() (headers map[string]string)
- type SiliconflowProviderFactory
- type Tokens
- type UserInfo
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 RerankRequest ¶
type RerankResponse ¶
type RerankResponse struct {
Id string `json:"id"`
Results []types.RerankResult `json:"results"`
Meta *Meta `json:"meta,omitempty"`
}
type SiliconflowProvider ¶
type SiliconflowProvider struct {
openai.OpenAIProvider
}
func (*SiliconflowProvider) Balance ¶
func (p *SiliconflowProvider) Balance() (float64, error)
func (*SiliconflowProvider) ConvertToRerank ¶
func (p *SiliconflowProvider) ConvertToRerank(response *RerankResponse, request *types.RerankRequest) (*types.RerankResponse, *types.OpenAIErrorWithStatusCode)
func (*SiliconflowProvider) CreateImageGenerations ¶
func (p *SiliconflowProvider) CreateImageGenerations(request *types.ImageRequest) (*types.ImageResponse, *types.OpenAIErrorWithStatusCode)
func (*SiliconflowProvider) CreateRerank ¶
func (p *SiliconflowProvider) CreateRerank(request *types.RerankRequest) (*types.RerankResponse, *types.OpenAIErrorWithStatusCode)
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 ¶
func (f SiliconflowProviderFactory) Create(channel *model.Channel) base.ProviderInterface
创建 SiliconflowProvider
Click to show internal directories.
Click to hide internal directories.