Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEmbeddingsClient ¶
func RegisterEmbeddingsClient(ctx context.Context, scheme string, init_func EmbeddingsClientInitializationFunc) error
RegisterEmbeddingsClient registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `Client` instances by the `NewEmbeddingsClient` method.
Types ¶
type Embeddings ¶
type EmbeddingsClient ¶
type EmbeddingsClient interface {
ComputeTextEmbeddings(context.Context, *EmbeddingsRequest) (*Embeddings, error)
ComputeImageEmbeddings(context.Context, *EmbeddingsRequest) (*Embeddings, error)
}
func NewEmbeddingsClient ¶
func NewEmbeddingsClient(ctx context.Context, uri string) (EmbeddingsClient, error)
NewClient returns a new `Client` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `ClientInitializationFunc` function used to instantiate the new `Client`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterClient` method.
func NewGrpcEmbeddingsClient ¶
func NewGrpcEmbeddingsClient(ctx context.Context, uri string) (EmbeddingsClient, error)
func NewNullEmbeddingsClient ¶
func NewNullEmbeddingsClient(ctx context.Context, uri string) (EmbeddingsClient, error)
type EmbeddingsClientInitializationFunc ¶
type EmbeddingsClientInitializationFunc func(ctx context.Context, uri string) (EmbeddingsClient, error)
ClientInitializationFunc is a function defined by individual client package and used to create an instance of that client
type EmbeddingsRequest ¶
type GrpcEmbeddingsClient ¶
type GrpcEmbeddingsClient struct {
// contains filtered or unexported fields
}
func (*GrpcEmbeddingsClient) ComputeImageEmbeddings ¶
func (e *GrpcEmbeddingsClient) ComputeImageEmbeddings(ctx context.Context, req *EmbeddingsRequest) (*Embeddings, error)
func (*GrpcEmbeddingsClient) ComputeTextEmbeddings ¶
func (e *GrpcEmbeddingsClient) ComputeTextEmbeddings(ctx context.Context, req *EmbeddingsRequest) (*Embeddings, error)
type NullEmbeddingsClient ¶
type NullEmbeddingsClient struct{}
func (*NullEmbeddingsClient) ComputeImageEmbeddings ¶
func (e *NullEmbeddingsClient) ComputeImageEmbeddings(ctx context.Context, req *EmbeddingsRequest) (*Embeddings, error)
func (*NullEmbeddingsClient) ComputeTextEmbeddings ¶
func (e *NullEmbeddingsClient) ComputeTextEmbeddings(ctx context.Context, req *EmbeddingsRequest) (*Embeddings, error)