mp_infini

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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 (*Embedding) Tags added in v0.2.3

func (cfg *Embedding) Tags() []mp_common.Tag

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

func (cfg *LLM) ChatCompletions(ctx context.Context, req mp_common.ILLMReq, headers ...mp_common.Header) (mp_common.ILLMResp, <-chan mp_common.ILLMResp, error)

func (*LLM) NewReq

func (cfg *LLM) NewReq(req *mp_common.LLMReq) (mp_common.ILLMReq, error)

func (*LLM) Tags added in v0.2.3

func (cfg *LLM) Tags() []mp_common.Tag

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"`        // 最大标记(开关)
}

func (*LLMParams) GetParams

func (cfg *LLMParams) GetParams() map[string]interface{}

type Rerank

type Rerank struct {
	ApiKey      string `json:"apiKey"`      // ApiKey
	EndpointUrl string `json:"endpointUrl"` // 推理url
	ContextSize *int   `json:"contextSize"` // 上下文长度
}

func (*Rerank) NewReq

func (cfg *Rerank) NewReq(req *mp_common.RerankReq) (mp_common.IRerankReq, error)

func (*Rerank) Rerank

func (cfg *Rerank) Rerank(ctx context.Context, req mp_common.IRerankReq, headers ...mp_common.Header) (mp_common.IRerankResp, error)

func (*Rerank) Tags added in v0.2.3

func (cfg *Rerank) Tags() []mp_common.Tag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL