client

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ModelUncontactable = "module uncontactable"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client establishes a gRPC connection to a remote contextionary service

func NewClient

func NewClient(uri string, logger logrus.FieldLogger) (*Client, error)

NewClient from gRPC discovery url to connect to a remote contextionary service

func (*Client) AddExtension

func (c *Client) AddExtension(ctx context.Context, extension *models.C11yExtension) error

func (*Client) IsStopWord

func (c *Client) IsStopWord(ctx context.Context, word string) (bool, error)

IsStopWord returns true if the given word is a stopword, errors on connection errors

func (*Client) IsWordPresent

func (c *Client) IsWordPresent(ctx context.Context, word string) (bool, error)

IsWordPresent returns true if the given word is a stopword, errors on connection errors

func (*Client) MetaInfo

func (c *Client) MetaInfo() (map[string]interface{}, error)

func (*Client) MultiNearestWordsByVector

func (c *Client) MultiNearestWordsByVector(ctx context.Context, vectors [][]float32, k, n int) ([]*txt2vecmodels.NearestNeighbors, error)

func (*Client) MultiVectorForWord

func (c *Client) MultiVectorForWord(ctx context.Context, words []string) ([][]float32, error)

func (*Client) NearestWordsByVector

func (c *Client) NearestWordsByVector(ctx context.Context, vector []float32, n int, k int) ([]string, []float32, error)

func (*Client) SafeGetSimilarWordsWithCertainty

func (c *Client) SafeGetSimilarWordsWithCertainty(ctx context.Context, word string, certainty float32) ([]string, error)

SafeGetSimilarWordsWithCertainty will always return a list words - unless there is a network error

func (*Client) SchemaSearch

func (c *Client) SchemaSearch(ctx context.Context, params traverser.SearchParams) (traverser.SearchResults, error)

SchemaSearch for related classes and properties TODO: is this still used?

func (*Client) VectorForCorpi

func (c *Client) VectorForCorpi(ctx context.Context, corpi []string, overridesMap map[string]string) ([]float32, []txt2vecmodels.InterpretationSource, error)

func (*Client) VectorForWord

func (c *Client) VectorForWord(ctx context.Context, word string) ([]float32, error)

func (*Client) VectorOnlyForCorpi

func (c *Client) VectorOnlyForCorpi(ctx context.Context, corpi []string, overrides map[string]string) ([]float32, error)

func (*Client) WaitForStartupAndValidateVersion

func (c *Client) WaitForStartupAndValidateVersion(startupCtx context.Context,
	requiredMinimumVersion string, interval time.Duration,
) error

Jump to

Keyboard shortcuts

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