Documentation
¶
Overview ¶
Package embedder 提供文本转向量的实现 支持 OpenAI 兼容 API 和 Ollama 原生 API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Embedder ¶
Embedder 文本转向量接口
func NewOllama ¶
func NewOllama(config *OllamaConfig) Embedder
func NewOpenAI ¶
func NewOpenAI(config *OpenAIConfig) Embedder
type OllamaConfig ¶
type OllamaConfig struct {
BaseURL string // 如 "http://localhost:11434"
Model string // 如 "nomic-embed-text"
Timeout time.Duration
}
type OpenAIConfig ¶
type OpenAIConfig struct {
BaseURL string // 如 "https://api.openai.com/v1" 或 "http://localhost:11434/v1"
APIKey string
Model string
Timeout time.Duration
}
Click to show internal directories.
Click to hide internal directories.