endpoint

package
v0.0.0-...-aa8845d Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeEndpointOfDelete

func MakeEndpointOfDelete(s api.VectorStore) endpoint.Endpoint

MakeEndpointOfDelete creates the endpoint for s.Delete.

func MakeEndpointOfQuery

func MakeEndpointOfQuery(s api.VectorStore) endpoint.Endpoint

MakeEndpointOfQuery creates the endpoint for s.Query.

func MakeEndpointOfUpsert

func MakeEndpointOfUpsert(s api.VectorStore) endpoint.Endpoint

MakeEndpointOfUpsert creates the endpoint for s.Upsert.

func ValidateDeleteRequest

func ValidateDeleteRequest(newSchema func(*DeleteRequest) validating.Schema) httpoption.Validator

ValidateDeleteRequest creates a validator for DeleteRequest.

func ValidateQueryRequest

func ValidateQueryRequest(newSchema func(*QueryRequest) validating.Schema) httpoption.Validator

ValidateQueryRequest creates a validator for QueryRequest.

func ValidateUpsertRequest

func ValidateUpsertRequest(newSchema func(*UpsertRequest) validating.Schema) httpoption.Validator

ValidateUpsertRequest creates a validator for UpsertRequest.

Types

type DeleteRequest

type DeleteRequest struct {
	Vendor    string   `json:"vendor"`
	SourceIDs []string `json:"source_i_ds"`
}

type DeleteResponse

type DeleteResponse struct {
	Err error `json:"-"`
}

func (*DeleteResponse) Body

func (r *DeleteResponse) Body() interface{}

func (*DeleteResponse) Failed

func (r *DeleteResponse) Failed() error

Failed implements endpoint.Failer.

type QueryRequest

type QueryRequest struct {
	Vendor   string    `json:"vendor"`
	Vector   []float64 `json:"vector"`
	TopK     int       `json:"top_k"`
	MinScore float64   `json:"min_score"`
}

type QueryResponse

type QueryResponse struct {
	Similarities []*api.Similarity `json:"similarities"`
	Err          error             `json:"-"`
}

func (*QueryResponse) Body

func (r *QueryResponse) Body() interface{}

func (*QueryResponse) Failed

func (r *QueryResponse) Failed() error

Failed implements endpoint.Failer.

type UpsertRequest

type UpsertRequest struct {
	Vendor    string          `json:"vendor"`
	Documents []*api.Document `json:"documents"`
}

type UpsertResponse

type UpsertResponse struct {
	Err error `json:"-"`
}

func (*UpsertResponse) Body

func (r *UpsertResponse) Body() interface{}

func (*UpsertResponse) Failed

func (r *UpsertResponse) Failed() error

Failed implements endpoint.Failer.

Jump to

Keyboard shortcuts

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