Documentation
¶
Index ¶
- type FastEmbed
- func (e *FastEmbed) EmbedDocuments(ctx context.Context, texts []string, callback ...types.EmbeddingProgress) (*types.EmbeddingResults, error)
- func (e *FastEmbed) EmbedQuery(ctx context.Context, text string, callback ...types.EmbeddingProgress) (*types.EmbeddingResult, error)
- func (e *FastEmbed) GetDimension() int
- func (e *FastEmbed) GetHost() string
- func (e *FastEmbed) GetModel() string
- func (e *FastEmbed) HasKey() bool
- type FastEmbedOptions
- type Openai
- func (e *Openai) EmbedDocuments(ctx context.Context, texts []string, callback ...types.EmbeddingProgress) (*types.EmbeddingResults, error)
- func (e *Openai) EmbedQuery(ctx context.Context, text string, callback ...types.EmbeddingProgress) (*types.EmbeddingResult, error)
- func (e *Openai) GetDimension() int
- func (e *Openai) GetModel() string
- type OpenaiOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FastEmbed ¶
type FastEmbed struct {
Connector connector.Connector
Concurrent int
Dimension int
Model string
Host string
Key string
}
FastEmbed embedding function
func NewFastEmbed ¶
func NewFastEmbed(options FastEmbedOptions) (*FastEmbed, error)
NewFastEmbed create a new FastEmbed embedding function with options
func NewFastEmbedWithDefaults ¶
NewFastEmbedWithDefaults create a new FastEmbed embedding function with default settings
func (*FastEmbed) EmbedDocuments ¶
func (e *FastEmbed) EmbedDocuments(ctx context.Context, texts []string, callback ...types.EmbeddingProgress) (*types.EmbeddingResults, error)
EmbedDocuments embed documents with optional progress callback
func (*FastEmbed) EmbedQuery ¶
func (e *FastEmbed) EmbedQuery(ctx context.Context, text string, callback ...types.EmbeddingProgress) (*types.EmbeddingResult, error)
EmbedQuery embed query using FastEmbed API with optional progress callback
func (*FastEmbed) GetDimension ¶
GetDimension returns the embedding dimension
type FastEmbedOptions ¶
type FastEmbedOptions struct {
ConnectorName string // Connector name
Concurrent int // Maximum concurrent requests
Dimension int // Embedding dimension
Model string // Model name (optional, can be overridden by connector)
Host string // FastEmbed service host (optional, can be overridden by connector)
Key string // FastEmbed service key (optional, can be overridden by connector)
}
FastEmbedOptions defines the options for FastEmbed embedding
type Openai ¶
Openai embedding function
func NewOpenai ¶
func NewOpenai(options OpenaiOptions) (*Openai, error)
NewOpenai create a new Openai embedding function with options
func NewOpenaiWithDefaults ¶
NewOpenaiWithDefaults create a new Openai embedding function with default settings
func (*Openai) EmbedDocuments ¶
func (e *Openai) EmbedDocuments(ctx context.Context, texts []string, callback ...types.EmbeddingProgress) (*types.EmbeddingResults, error)
EmbedDocuments embed documents with optional progress callback
func (*Openai) EmbedQuery ¶
func (e *Openai) EmbedQuery(ctx context.Context, text string, callback ...types.EmbeddingProgress) (*types.EmbeddingResult, error)
EmbedQuery embed query using direct POST request with optional progress callback
func (*Openai) GetDimension ¶
GetDimension returns the embedding dimension