Documentation
¶
Index ¶
- Constants
- type AIDetectorCmd
- type ApiApplyRecordDTO
- type ApiInfoDTO
- type ApplyRecordGetCmd
- type AsyncBigModelService
- type BaiChuanCmd
- type BaiChuanDTO
- type BigModelService
- type CodeGeexCmd
- type CodeGeexDTO
- type DescribePictureCmd
- type GLM2Cmd
- type GLM2DTO
- type GenPictureCmd
- type IFlytekSparkCmd
- type IFlytekSparkDTO
- type LLAMA2Cmd
- type LLAMA2DTO
- type LuoJiaHFCmd
- type LuoJiaRecordDTO
- type SkyWorkCmd
- type SkyWorkDTO
- type VQAHFCmd
- type WuKongAddDiggCmd
- type WuKongAddLikeFromPublicCmd
- type WuKongAddLikeFromTempCmd
- type WuKongAddPublicFromLikeCmd
- type WuKongAddPublicFromTempCmd
- type WuKongApiCmd
- type WuKongCancelDiggCmd
- type WuKongCmd
- type WuKongHFCmd
- type WuKongIsLikeDTO
- type WuKongLikeDTO
- type WuKongListPublicGlobalCmd
- type WuKongPictureBaseDTO
- type WuKongPictureListOption
- type WuKongPicturesListCmd
- type WuKongPublicDTO
- type WuKongPublicGlobalDTO
- type WuKongRankDTO
Constants ¶
View Source
const ( ErrorCodeSystem = "system" // It exceed the max times for a day. ErrorCodeAIQuestionExceedMaxTimes = "aiquestion_exceed_max_times" ErrorCodeAIQuestionSubmissionExpiry = "aiquestion_submission_expiry" ErrorCodeAIQuestionSubmissionUnmatchedTimes = "aiquestion_submission_unmatched_times" ErrorBigModelSensitiveInfo = "bigmodel_sensitive_info" ErrorBigModelRecourseBusy = "bigmodel_resource_busy" ErrorBigModelConcurrentRequest = "bigmodel_concurrent_request" ErrorWuKongNoPicture = "bigmodel_no_wukong_picture" ErrorWuKongInvalidId = "wukong_invalid_id" ErrorWuKongInvalidOwner = "wukong_invalid_owner" ErrorWuKongInvalidPath = "wukong_invalid_path" ErrorWuKongNoAuthorization = "wukong_no_authorization" ErrorWuKongInvalidLink = "wukong_invalid_link" ErrorWuKongDuplicateLike = "wukong_duplicate_like" ErrorWuKongExccedMaxLikeNum = "wukong_excced_max_like_num" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIDetectorCmd ¶
type AIDetectorCmd struct {
User types.Account `json:"user"`
Lang domain.Lang `json:"lang"`
Text domain.AIDetectorText `json:"text"`
}
func (AIDetectorCmd) Validate ¶
func (cmd AIDetectorCmd) Validate() error
type ApiApplyRecordDTO ¶
type ApiInfoDTO ¶
type ApplyRecordGetCmd ¶
type AsyncBigModelService ¶
type AsyncBigModelService interface {
WuKong(uint64, types.Account, *WuKongCmd) error
GetIdleEndpoint(bid string) (int, error)
}
func NewAsyncBigModelService ¶
func NewAsyncBigModelService( fm bigmodel.BigModel, sender message.MessageProducer, ) AsyncBigModelService
type BaiChuanCmd ¶
type BaiChuanCmd struct {
User types.Account
Sampling bool
Text domain.BaiChuanText
TopK domain.TopK
TopP domain.TopP
Temperature domain.Temperature
RepetitionPenalty domain.RepetitionPenalty
}
baichuan
func (*BaiChuanCmd) SetDefault ¶
func (cmd *BaiChuanCmd) SetDefault()
type BaiChuanDTO ¶
type BaiChuanDTO struct {
Text string `json:"text"`
}
type BigModelService ¶
type BigModelService interface {
// luojia
LuoJiaUploadPicture(io.Reader, types.Account) error
LuoJia(types.Account) (string, error)
ListLuoJiaRecord(types.Account) ([]LuoJiaRecordDTO, error)
// wukong
GenWuKongSamples(int) ([]string, error)
WuKong(types.Account, *WuKongCmd) (map[string]string, string, error)
WuKongHF(*WuKongHFCmd) (map[string]string, string, error)
WuKongInferenceAsync(types.Account, *WuKongCmd) (string, error)
GetWuKongWaitingTaskRank(types.Account) (WuKongRankDTO, error)
GetWuKongLastTaskResp(types.Account) ([]wukongPictureDTO, string, error)
AddLikeFromTempPicture(*WuKongAddLikeFromTempCmd) (string, string, error)
AddLikeFromPublicPicture(*WuKongAddLikeFromPublicCmd) (string, string, error)
AddPublicFromTempPicture(*WuKongAddPublicFromTempCmd) (string, string, error)
AddPublicFromLikePicture(*WuKongAddPublicFromLikeCmd) (string, string, error)
CancelPublic(types.Account, string) error
GetPublicsGlobal(cmd *WuKongListPublicGlobalCmd) (WuKongPublicGlobalDTO, error)
ListPublics(types.Account) ([]WuKongPublicDTO, error)
CancelLike(types.Account, string) error
ListLikes(types.Account) ([]WuKongLikeDTO, error)
DiggPicture(*WuKongAddDiggCmd) (int, error)
CancelDiggPicture(*WuKongCancelDiggCmd) (int, error)
ReGenerateDownloadURL(types.Account, string) (string, string, error)
//api service
ApplyApi(types.Account, domain.ModelName, string) error
WukongApi(types.Account, domain.ModelName, *WuKongApiCmd) (map[string]string, string, error)
GetApplyRecordByModel(types.Account, domain.ModelName) (string, error)
GetApplyRecordByUser(types.Account) ([]ApiApplyRecordDTO, error)
IsApplyModel(types.Account, domain.ModelName) (bool, error)
UpdateToken(types.Account, domain.ModelName, string) (string, error)
//api info
GetApiInfo(model domain.ModelName) (ApiInfoDTO, error)
// ai detector
AIDetector(*AIDetectorCmd) (string, bool, error)
// baichuan
BaiChuan(*BaiChuanCmd) (string, BaiChuanDTO, error)
// glm2
GLM2(*GLM2Cmd) (string, error)
// llama2
LLAMA2(*LLAMA2Cmd) (string, error)
// iflytekspark
IFlytekSpark(*IFlytekSparkCmd) (string, error)
// skywork 13b
SkyWork(*SkyWorkCmd) (string, error)
}
func NewBigModelService ¶
func NewBigModelService( fm bigmodel.BigModel, user userrepo.User, luojia repository.LuoJia, wukong repository.WuKong, wukongPicture repository.WuKongPicture, asynccli async.AsyncTask, sender message.MessageProducer, apiService repository.ApiService, apiInfo repository.ApiInfo, userService userapp.RegService, ) BigModelService
type CodeGeexCmd ¶
type CodeGeexCmd bigmodel.CodeGeexReq
func (*CodeGeexCmd) Validate ¶
func (cmd *CodeGeexCmd) Validate() error
type CodeGeexDTO ¶
type CodeGeexDTO = bigmodel.CodeGeexResp
type DescribePictureCmd ¶
func (*DescribePictureCmd) Validate ¶
func (cmd *DescribePictureCmd) Validate() error
type GLM2Cmd ¶
type GLM2Cmd struct {
CH chan string
User types.Account
History []domain.History
Sampling bool
Text domain.GLM2Text
TopK domain.TopK
TopP domain.TopP
Temperature domain.Temperature
RepetitionPenalty domain.RepetitionPenalty
}
glm2
func (*GLM2Cmd) SetDefault ¶
func (cmd *GLM2Cmd) SetDefault()
type GenPictureCmd ¶
taichu
type IFlytekSparkCmd ¶
type IFlytekSparkCmd struct {
CH chan string
User types.Account
Sampling bool
Text domain.IFlytekSparkText
TopK domain.TopK
Temperature domain.Temperature
RepetitionPenalty domain.RepetitionPenalty
}
iflytekspark
func (*IFlytekSparkCmd) SetDefault ¶
func (cmd *IFlytekSparkCmd) SetDefault()
type IFlytekSparkDTO ¶
type LLAMA2Cmd ¶
type LLAMA2Cmd struct {
CH chan string
User types.Account
History []domain.History
Sampling bool
Text domain.LLAMA2Text
TopK domain.TopK
TopP domain.TopP
Temperature domain.Temperature
RepetitionPenalty domain.RepetitionPenalty
}
llama2
func (*LLAMA2Cmd) SetDefault ¶
func (cmd *LLAMA2Cmd) SetDefault()
type LuoJiaHFCmd ¶
type LuoJiaHFCmd struct {
User userdomain.Account
Picture io.Reader
}
func (*LuoJiaHFCmd) Validate ¶
func (cmd *LuoJiaHFCmd) Validate() error
type LuoJiaRecordDTO ¶
type SkyWorkCmd ¶
type SkyWorkCmd struct {
CH chan string
User types.Account
History []domain.History
Sampling bool
Text domain.SkyWorkText
TopK domain.TopK
TopP domain.TopP
Temperature domain.Temperature
RepetitionPenalty domain.RepetitionPenalty
}
skywork 13b
func (*SkyWorkCmd) SetDefault ¶
func (cmd *SkyWorkCmd) SetDefault()
type SkyWorkDTO ¶
type WuKongAddDiggCmd ¶
type WuKongAddPublicFromTempCmd ¶
type WuKongAddPublicFromTempCmd = WuKongAddLikeFromTempCmd
type WuKongApiCmd ¶
func (*WuKongApiCmd) Validate ¶
func (cmd *WuKongApiCmd) Validate() error
type WuKongCancelDiggCmd ¶
type WuKongCancelDiggCmd WuKongAddDiggCmd
type WuKongCmd ¶
type WuKongCmd struct {
domain.WuKongPictureMeta
EsType string
}
type WuKongHFCmd ¶
func (*WuKongHFCmd) Validate ¶
func (cmd *WuKongHFCmd) Validate() error
type WuKongIsLikeDTO ¶
type WuKongLikeDTO ¶
type WuKongLikeDTO struct {
IsPublic bool `json:"is_public"`
Avatar string `json:"avatar"`
WuKongPictureBaseDTO
}
type WuKongListPublicGlobalCmd ¶
type WuKongListPublicGlobalCmd struct {
User types.Account
Level domain.WuKongPictureLevel
WuKongPictureListOption
}
func (*WuKongListPublicGlobalCmd) Validate ¶
func (cmd *WuKongListPublicGlobalCmd) Validate() error
type WuKongPictureBaseDTO ¶
type WuKongPictureListOption ¶
type WuKongPicturesListCmd ¶
type WuKongPicturesListCmd = repository.WuKongPictureListOption
type WuKongPublicDTO ¶
type WuKongPublicGlobalDTO ¶
type WuKongPublicGlobalDTO struct {
Pictures []WuKongPublicDTO `json:"pictures"`
Total int `json:"total"`
}
type WuKongRankDTO ¶
type WuKongRankDTO struct {
Rank int `json:"rank"`
}
Click to show internal directories.
Click to hide internal directories.