Documentation ¶
Index ¶
- type Client
- type DefaultClient
- func (c *DefaultClient) CreateDataset(_ context.Context, datasetID string) (types.Dataset, error)
- func (c *DefaultClient) DeleteDataset(_ context.Context, datasetID string) error
- func (c *DefaultClient) DeleteDocuments(_ context.Context, datasetID string, documentIDs ...string) error
- func (c *DefaultClient) GetDataset(_ context.Context, datasetID string) (*index.Dataset, error)
- func (c *DefaultClient) Ingest(_ context.Context, datasetID string, data []byte, opts datastore.IngestOpts) ([]string, error)
- func (c *DefaultClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, error)
- func (c *DefaultClient) ListDatasets(_ context.Context) ([]types.Dataset, error)
- func (c *DefaultClient) Retrieve(_ context.Context, datasetID string, query string, opts RetrieveOpts) ([]vectorstore.Document, error)
- type IngestPathsOpts
- type RetrieveOpts
- type StandaloneClient
- func (c *StandaloneClient) CreateDataset(ctx context.Context, datasetID string) (types.Dataset, error)
- func (c *StandaloneClient) DeleteDataset(ctx context.Context, datasetID string) error
- func (c *StandaloneClient) DeleteDocuments(ctx context.Context, datasetID string, documentIDs ...string) error
- func (c *StandaloneClient) GetDataset(ctx context.Context, datasetID string) (*index.Dataset, error)
- func (c *StandaloneClient) Ingest(ctx context.Context, datasetID string, data []byte, opts datastore.IngestOpts) ([]string, error)
- func (c *StandaloneClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, error)
- func (c *StandaloneClient) ListDatasets(ctx context.Context) ([]types.Dataset, error)
- func (c *StandaloneClient) Retrieve(ctx context.Context, datasetID string, query string, opts RetrieveOpts) ([]vectorstore.Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { CreateDataset(ctx context.Context, datasetID string) (types.Dataset, error) DeleteDataset(ctx context.Context, datasetID string) error GetDataset(ctx context.Context, datasetID string) (*index.Dataset, error) ListDatasets(ctx context.Context) ([]types.Dataset, error) Ingest(ctx context.Context, datasetID string, data []byte, opts datastore.IngestOpts) ([]string, error) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, error) // returns number of files ingested DeleteDocuments(ctx context.Context, datasetID string, documentIDs ...string) error Retrieve(ctx context.Context, datasetID string, query string, opts RetrieveOpts) ([]vectorstore.Document, error) }
type DefaultClient ¶
type DefaultClient struct {
ServerURL string
}
func NewDefaultClient ¶
func NewDefaultClient(serverURL string) *DefaultClient
func (*DefaultClient) CreateDataset ¶
func (*DefaultClient) DeleteDataset ¶
func (c *DefaultClient) DeleteDataset(_ context.Context, datasetID string) error
func (*DefaultClient) DeleteDocuments ¶
func (*DefaultClient) GetDataset ¶
func (*DefaultClient) Ingest ¶
func (c *DefaultClient) Ingest(_ context.Context, datasetID string, data []byte, opts datastore.IngestOpts) ([]string, error)
func (*DefaultClient) IngestPaths ¶
func (c *DefaultClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, error)
func (*DefaultClient) ListDatasets ¶
func (*DefaultClient) Retrieve ¶
func (c *DefaultClient) Retrieve(_ context.Context, datasetID string, query string, opts RetrieveOpts) ([]vectorstore.Document, error)
type IngestPathsOpts ¶
type RetrieveOpts ¶
type RetrieveOpts struct {
TopK int
}
type StandaloneClient ¶
func NewStandaloneClient ¶
func NewStandaloneClient(ds *datastore.Datastore) (*StandaloneClient, error)
func (*StandaloneClient) CreateDataset ¶
func (*StandaloneClient) DeleteDataset ¶
func (c *StandaloneClient) DeleteDataset(ctx context.Context, datasetID string) error
func (*StandaloneClient) DeleteDocuments ¶
func (*StandaloneClient) GetDataset ¶
func (*StandaloneClient) Ingest ¶
func (c *StandaloneClient) Ingest(ctx context.Context, datasetID string, data []byte, opts datastore.IngestOpts) ([]string, error)
func (*StandaloneClient) IngestPaths ¶
func (c *StandaloneClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, error)
func (*StandaloneClient) ListDatasets ¶
func (*StandaloneClient) Retrieve ¶
func (c *StandaloneClient) Retrieve(ctx context.Context, datasetID string, query string, opts RetrieveOpts) ([]vectorstore.Document, error)
Click to show internal directories.
Click to hide internal directories.