huggingfaceembedder

package
v0.0.12-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL