Documentation
¶
Index ¶
- func New(serverURL string, opts ...Option) (embeddings.Embedder, error)
- type Embedder
- func (e *Embedder) EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error)
- func (e *Embedder) EmbedQueries(ctx context.Context, texts []string) ([][]float32, error)
- func (e *Embedder) EmbedQuery(ctx context.Context, text string) ([]float32, error)
- func (e *Embedder) GetDimension(ctx context.Context) (int, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Embedder ¶
type Embedder struct {
// contains filtered or unexported fields
}
Embedder communicates with a remote FastAPI server to generate embeddings. It directly implements the embeddings.Embedder interface.
func (*Embedder) EmbedDocuments ¶
EmbedDocuments sends a batch of documents to the FastAPI server for embedding.
func (*Embedder) EmbedQueries ¶
EmbedQueries embeds a batch of queries.
func (*Embedder) EmbedQuery ¶
EmbedQuery embeds a single query.
type Option ¶
type Option func(*options)
Option defines a function type for configuring the embedder.
func WithAPIKey ¶
func WithHTTPClient ¶
WithHTTPClient allows providing a custom http.Client.
Click to show internal directories.
Click to hide internal directories.