teiapi

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a HTTP client for the TEI REST API using protobuf message types.

func NewClient added in v0.1.1

func NewClient(baseURL string, timeout time.Duration) *Client

NewClient creates a new HTTP client with the given baseURL and timeout.

func (*Client) Close

func (c *Client) Close() error

Close is a no-op for HTTP client.

func (*Client) Decode

Decode decodes input IDs to text.

func (*Client) Embed

func (c *Client) Embed(ctx context.Context, req *proto.EmbedRequest) (*proto.EmbedResponse, error)

Embed returns pooled embeddings.

func (*Client) EmbedAll

EmbedAll returns token-level embeddings.

func (*Client) EmbedSparse

EmbedSparse returns sparse embeddings.

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks service health.

func (*Client) Info

func (c *Client) Info(ctx context.Context, req *proto.InfoRequest) (*proto.InfoResponse, error)

Info retrieves model information.

func (*Client) Metrics

func (c *Client) Metrics(ctx context.Context) (string, error)

Metrics returns Prometheus metrics text.

func (*Client) OpenAIEmbed

func (c *Client) OpenAIEmbed(ctx context.Context, req *proto.EmbedRequest) (*proto.EmbedResponse, error)

OpenAIEmbed returns embeddings in OpenAI-compatible format.

func (*Client) Predict

Predict returns classification predictions.

func (*Client) Rerank

Rerank returns ranked texts for a query.

func (*Client) Tokenize

func (c *Client) Tokenize(ctx context.Context, req *proto.EncodeRequest) (*proto.EncodeResponse, error)

Tokenize converts text to tokens.

Jump to

Keyboard shortcuts

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