Documentation
¶
Index ¶
- Constants
- type HuggingFaceEmbedder
- func (h *HuggingFaceEmbedder) Embed(ctx context.Context, texts []string) ([]embedder.Embedding, error)
- func (h *HuggingFaceEmbedder) WithHTTPClient(httpClient *http.Client) *HuggingFaceEmbedder
- func (h *HuggingFaceEmbedder) WithModel(model string) *HuggingFaceEmbedder
- func (h *HuggingFaceEmbedder) WithToken(token string) *HuggingFaceEmbedder
Constants ¶
View Source
const APIBaseURL = "https://api-inference.huggingface.co/pipeline/feature-extraction/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HuggingFaceEmbedder ¶
type HuggingFaceEmbedder struct {
// contains filtered or unexported fields
}
func New ¶
func New() *HuggingFaceEmbedder
func (*HuggingFaceEmbedder) Embed ¶
func (h *HuggingFaceEmbedder) Embed(ctx context.Context, texts []string) ([]embedder.Embedding, error)
Embed returns the embeddings for the given texts
func (*HuggingFaceEmbedder) WithHTTPClient ¶
func (h *HuggingFaceEmbedder) WithHTTPClient(httpClient *http.Client) *HuggingFaceEmbedder
WithHTTPClient sets the http client to use for the LLM
func (*HuggingFaceEmbedder) WithModel ¶
func (h *HuggingFaceEmbedder) WithModel(model string) *HuggingFaceEmbedder
WithModel sets the model to use for the embedder
func (*HuggingFaceEmbedder) WithToken ¶
func (h *HuggingFaceEmbedder) WithToken(token string) *HuggingFaceEmbedder
WithToken sets the API key to use for the embedder
Click to show internal directories.
Click to hide internal directories.