Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embedding ¶
type Embedding struct {
ApiKey string `json:"apiKey"` // ApiKey
EndpointUrl string `json:"endpointUrl"` // 推理url
ContextSize *int `json:"contextSize"` // 上下文长度
}
func (*Embedding) Embeddings ¶
func (cfg *Embedding) Embeddings(ctx context.Context, req mp_common.IEmbeddingReq, headers ...mp_common.Header) (mp_common.IEmbeddingResp, error)
func (*Embedding) NewReq ¶
func (cfg *Embedding) NewReq(req *mp_common.EmbeddingReq) (mp_common.IEmbeddingReq, error)
type LLM ¶
type LLM struct {
ApiKey string `json:"apiKey"` // ApiKey
EndpointUrl string `json:"endpointUrl"` // 推理url
FunctionCalling string `json:"functionCalling" validate:"oneof=noSupport toolCall"` // 函数调用是否支持
VisionSupport string `json:"visionSupport" validate:"oneof=noSupport support"` // 视觉支持
MaxTokens *int `json:"maxTokens"` // 模型回答最大tokens
ContextSize *int `json:"contextSize"` // 上下文长度
}
func (*LLM) ChatCompletions ¶
type LLMParams ¶
type LLMParams struct {
Temperature float32 `json:"temperature"` // 温度
TemperatureEnable bool `json:"temperatureEnable"` // 温度(开关)
TopP float32 `json:"topP"` // Top P
TopPEnable bool `json:"topPEnable"` // Top P(开关)
FrequencyPenalty float32 `json:"frequencyPenalty"` // 频率惩罚
FrequencyPenaltyEnable bool `json:"frequencyPenaltyEnable"` // 频率惩罚(开关)
PresencePenalty float32 `json:"presencePenalty"` // 存在惩罚
PresencePenaltyEnable bool `json:"presencePenaltyEnable"` // 存在惩罚(开关)
MaxTokens int32 `json:"maxTokens"` // 最大标记
MaxTokensEnable bool `json:"maxTokensEnable"` // 最大标记(开关)
}
type Rerank ¶
type Rerank struct {
ApiKey string `json:"apiKey"` // ApiKey
EndpointUrl string `json:"endpointUrl"` // 推理url
ContextSize *int `json:"contextSize"` // 上下文长度
}
Click to show internal directories.
Click to hide internal directories.