Documentation
¶
Index ¶
- Constants
- func Init(callbackUrl string)
- func ToModelConfig(provider, modelType, cfg string) (interface{}, error)
- func ToModelEndpoint(modelId, model string) map[string]interface{}
- func ToModelParams(provider, modelType, cfg string) (interface{}, map[string]interface{}, error)
- func ToModelTags(provider, modelType, cfg string) ([]mp_common.Tag, error)
- type AppModelParams
- type AppModelParamsHuoshan
- type AppModelParamsInfini
- type AppModelParamsOllama
- type AppModelParamsOpenAICompatible
- type AppModelParamsQwen
- type AppModelParamsYuanjing
- type IEmbedding
- type IGui
- type ILLM
- type ILLMParams
- type IOcr
- type IPdfParser
- type IRerank
- type ProviderModelByHuoshan
- type ProviderModelByInfini
- type ProviderModelByOllama
- type ProviderModelByOpenAICompatible
- type ProviderModelByQwen
- type ProviderModelByYuanjing
- type ProviderModelConfig
Constants ¶
View Source
const ( ModelTypeLLM = "llm" ModelTypeEmbedding = "embedding" ModelTypeRerank = "rerank" ModelTypeOcr = "ocr" ModelTypeGui = "gui" ModelTypePdfParser = "pdf-parser" )
model type
View Source
const ( ProviderOpenAICompatible = "OpenAI-API-compatible" ProviderYuanJing = "YuanJing" ProviderHuoshan = "Huoshan" ProviderOllama = "Ollama" ProviderQwen = "Qwen" ProviderInfini = "Infini" )
model provider
Variables ¶
This section is empty.
Functions ¶
func ToModelConfig ¶
ToModelConfig 返回ILLM、IEmbedding或IRerank
func ToModelEndpoint ¶
ToModelEndpoint 返回model、model_url、model_id的kv
func ToModelParams ¶
ToModelParams 返回ILLMParams、IEmbeddingParams或IRerankParams,与对应实际传给模型的参数
Types ¶
type AppModelParams ¶
type AppModelParams struct {
ProviderOpenAICompatible AppModelParamsOpenAICompatible `json:"providerOpenAICompatible"` // OpenAI-API-compatible模型配置
ProviderYuanJing AppModelParamsYuanjing `json:"providerYuanjing"` // YuanJing模型配置
ProviderHuoshan AppModelParamsHuoshan `json:"providerHuoshan"`
ProviderQwen AppModelParamsQwen `json:"providerQwen"`
ProviderOllama AppModelParamsOllama `json:"providerOllama"`
ProviderInfini AppModelParamsInfini `json:"providerModelByInfini"`
}
type AppModelParamsHuoshan ¶ added in v0.2.3
type AppModelParamsHuoshan struct {
LLM mp_huoshan.LLMParams `json:"llm"` // 大语言模型配置
}
type AppModelParamsInfini ¶ added in v0.2.3
type AppModelParamsOllama ¶ added in v0.2.3
type AppModelParamsOpenAICompatible ¶
type AppModelParamsOpenAICompatible struct {
LLM mp_openai_compatible.LLMParams `json:"llm"` // 大语言模型配置
}
type AppModelParamsQwen ¶ added in v0.2.3
type AppModelParamsYuanjing ¶
type AppModelParamsYuanjing struct {
LLM mp_yuanjing.LLMParams `json:"llm"` // 大语言模型配置
}
type IEmbedding ¶
type IEmbedding interface {
Tags() []mp_common.Tag
NewReq(req *mp_common.EmbeddingReq) (mp_common.IEmbeddingReq, error)
Embeddings(ctx context.Context, req mp_common.IEmbeddingReq, headers ...mp_common.Header) (mp_common.IEmbeddingResp, error)
}
type ILLMParams ¶
type ILLMParams interface {
GetParams() map[string]interface{}
}
type IPdfParser ¶ added in v0.2.3
type IPdfParser interface {
Tags() []mp_common.Tag
NewReq(req *mp_common.PdfParserReq) (mp_common.IPdfParserReq, error)
PdfParser(ctx *gin.Context, req mp_common.IPdfParserReq, headers ...mp_common.Header) (mp_common.IPdfParserResp, error)
}
type ProviderModelByHuoshan ¶ added in v0.1.4
type ProviderModelByHuoshan struct {
Llm mp_huoshan.LLM `json:"llm"`
Embedding mp_huoshan.Embedding `json:"embedding"`
}
type ProviderModelByInfini ¶ added in v0.2.2
type ProviderModelByOllama ¶ added in v0.1.4
type ProviderModelByOpenAICompatible ¶
type ProviderModelByOpenAICompatible struct {
Llm mp_openai_compatible.LLM `json:"llm"`
Rerank mp_openai_compatible.Rerank `json:"rerank"`
Embedding mp_openai_compatible.Embedding `json:"embedding"`
}
type ProviderModelByQwen ¶ added in v0.1.4
type ProviderModelByYuanjing ¶
type ProviderModelByYuanjing struct {
Llm mp_yuanjing.LLM `json:"llm"`
Rerank mp_yuanjing.Rerank `json:"rerank"`
Embedding mp_yuanjing.Embedding `json:"embedding"`
Ocr mp_yuanjing.Ocr `json:"ocr"`
Gui mp_yuanjing.Gui `json:"gui"`
PdfParser mp_yuanjing.PdfParser `json:"pdf-parser"`
}
type ProviderModelConfig ¶
type ProviderModelConfig struct {
ProviderYuanJing ProviderModelByYuanjing `json:"providerYuanJing"`
ProviderOpenAICompatible ProviderModelByOpenAICompatible `json:"providerOpenAICompatible"`
ProviderHuoshan ProviderModelByHuoshan `json:"providerHuoshan"`
ProviderQwen ProviderModelByQwen `json:"providerQwen"`
ProviderOllama ProviderModelByOllama `json:"providerOllama"`
ProviderInfini ProviderModelByInfini `json:"providerModelByInfini"`
}
Click to show internal directories.
Click to hide internal directories.