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 ¶ added in v0.0.9
type HuggingFaceEmbedder struct {
// contains filtered or unexported fields
}
func New ¶
func New() *HuggingFaceEmbedder
func (*HuggingFaceEmbedder) Embed ¶ added in v0.0.9
func (h *HuggingFaceEmbedder) Embed(ctx context.Context, texts []string) ([]embedder.Embedding, error)
Embed returns the embeddings for the given texts
func (*HuggingFaceEmbedder) WithHTTPClient ¶ added in v0.0.11
func (h *HuggingFaceEmbedder) WithHTTPClient(httpClient *http.Client) *HuggingFaceEmbedder
WithHTTPClient sets the http client to use for the LLM
func (*HuggingFaceEmbedder) WithModel ¶ added in v0.0.9
func (h *HuggingFaceEmbedder) WithModel(model string) *HuggingFaceEmbedder
WithModel sets the model to use for the embedder
func (*HuggingFaceEmbedder) WithToken ¶ added in v0.0.9
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.