Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelOwners map[consts.ModelOwner]*ModelOwner
View Source
var Models []Model
View Source
var TypeModelMap map[consts.ModelType][]*Model
Functions ¶
This section is empty.
Types ¶
type CheckModelReq ¶
type CheckModelResp ¶
type GetProviderModelListReq ¶
type GetProviderModelListReq struct {
Provider string `` /* 166-byte string literal not displayed */
BaseURL string `json:"base_url" query:"base_url" validate:"required"`
APIKey string `json:"api_key" query:"api_key"`
APIHeader string `json:"api_header" query:"api_header"`
Type string `json:"type" query:"type" validate:"required,oneof=chat embedding rerank"`
}
type GetProviderModelListResp ¶
type GetProviderModelListResp struct {
Models []ProviderModelListItem `json:"models"`
}
type ListModelReq ¶
type ListModelReq struct {
OwnedBy consts.ModelOwner `json:"owned_by" query:"owned_by"` // 提供商
SubType consts.ModelType `json:"sub_type" query:"sub_type"` // 模型类型
}
type ModelKit ¶
type ModelKit interface {
CheckModel(ctx context.Context, req *CheckModelReq) (*Model, error)
ListModel(ctx context.Context, req *ListModelReq) ([]*Model, error)
PandaModelList(ctx context.Context, req *GetProviderModelListReq) (*GetProviderModelListResp, error)
}
type ModelOwner ¶
type ModelOwner struct {
OwnerName consts.ModelOwner `json:"owner_name"` // 提供商
APIBase string `json:"api_base"` // 接口地址 如:https://api.qwen.com
APIKey string `json:"api_key"` // 接口密钥 如:sk-xxxx
APIVersion string `json:"api_version"` // 接口版本 如:2023-05-15
APIHeader string `json:"api_header"` // 接口头 如:Authorization: Bearer sk-xxxx
Models []*Model `json:"models"` // 模型列表
}
type ProviderModelListItem ¶
type ProviderModelListItem struct {
Model string `json:"model"`
}
func From ¶
func From(modelOwner *ModelOwner) []ProviderModelListItem
Click to show internal directories.
Click to hide internal directories.