Documentation ¶
Index ¶
- Constants
- Variables
- func AskDir(ctx context.Context, c Client, path string, query string, ...) (*dstypes.RetrievalResponse, error)
- func HashPath(path string) string
- type Client
- type DefaultClient
- func (c *DefaultClient) AskDirectory(ctx context.Context, path string, query string, opts *IngestPathsOpts, ...) (*dstypes.RetrievalResponse, error)
- func (c *DefaultClient) CreateDataset(_ context.Context, datasetID string) (*index.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) DeleteFile(_ context.Context, datasetID, fileID string) error
- func (c *DefaultClient) ExportDatasets(ctx context.Context, path string, datasets ...string) error
- func (c *DefaultClient) FindFile(_ context.Context, searchFile index.File) (*index.File, error)
- func (c *DefaultClient) GetDataset(_ context.Context, datasetID string) (*index.Dataset, error)
- func (c *DefaultClient) ImportDatasets(ctx context.Context, path string, datasets ...string) error
- func (c *DefaultClient) Ingest(_ context.Context, datasetID string, name string, data []byte, ...) ([]string, error)
- func (c *DefaultClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, int, error)
- func (c *DefaultClient) ListDatasets(_ context.Context) ([]types.Dataset, error)
- func (c *DefaultClient) PrunePath(ctx context.Context, datasetID string, path string, keep []string) ([]index.File, error)
- func (c *DefaultClient) Retrieve(_ context.Context, datasetIDs []string, query string, ...) (*dstypes.RetrievalResponse, error)
- func (c *DefaultClient) UpdateDataset(ctx context.Context, dataset index.Dataset, opts *datastore.UpdateDatasetOpts) (*index.Dataset, error)
- type FileMetadata
- type IngestPathsOpts
- type IngestWorkspaceOpts
- type Metadata
- type SharedIngestionOpts
- type StandaloneClient
- func (c *StandaloneClient) AskDirectory(ctx context.Context, path string, query string, opts *IngestPathsOpts, ...) (*dstypes.RetrievalResponse, error)
- func (c *StandaloneClient) CreateDataset(ctx context.Context, datasetID string) (*index.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) DeleteFile(ctx context.Context, datasetID, fileID string) error
- func (c *StandaloneClient) ExportDatasets(ctx context.Context, path string, datasets ...string) error
- func (c *StandaloneClient) FindFile(ctx context.Context, searchFile index.File) (*index.File, error)
- func (c *StandaloneClient) GetDataset(ctx context.Context, datasetID string) (*index.Dataset, error)
- func (c *StandaloneClient) ImportDatasets(ctx context.Context, path string, datasets ...string) error
- func (c *StandaloneClient) Ingest(ctx context.Context, datasetID string, name string, data []byte, ...) ([]string, error)
- func (c *StandaloneClient) IngestFromWorkspace(ctx context.Context, datasetID string, opts *IngestWorkspaceOpts, file string) error
- func (c *StandaloneClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, int, error)
- func (c *StandaloneClient) ListDatasets(ctx context.Context) ([]types.Dataset, error)
- func (c *StandaloneClient) PrunePath(ctx context.Context, datasetID string, path string, keep []string) ([]index.File, error)
- func (c *StandaloneClient) Retrieve(ctx context.Context, datasetIDs []string, query string, ...) (*dstypes.RetrievalResponse, error)
- func (c *StandaloneClient) UpdateDataset(ctx context.Context, dataset index.Dataset, opts *datastore.UpdateDatasetOpts) (*index.Dataset, error)
Constants ¶
View Source
const DefaultIgnoreFile = ".knowignore"
View Source
const MetadataFilename = ".knowledge.json"
Variables ¶
View Source
var DefaultIgnorePatterns = []gitignore.Pattern{ gitignore.ParsePattern(DefaultIgnoreFile, nil), gitignore.ParsePattern(MetadataFilename, nil), gitignore.ParsePattern("~$*", nil), gitignore.ParsePattern("$*", nil), }
Functions ¶
func AskDir ¶ added in v0.1.3
func AskDir(ctx context.Context, c Client, path string, query string, opts *IngestPathsOpts, ropts *datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error)
Types ¶
type Client ¶
type Client interface { CreateDataset(ctx context.Context, datasetID string) (*index.Dataset, error) DeleteDataset(ctx context.Context, datasetID string) error GetDataset(ctx context.Context, datasetID string) (*index.Dataset, error) FindFile(ctx context.Context, searchFile index.File) (*index.File, error) DeleteFile(ctx context.Context, datasetID, fileID string) error ListDatasets(ctx context.Context) ([]types.Dataset, error) Ingest(ctx context.Context, datasetID string, name string, data []byte, opts datastore.IngestOpts) ([]string, error) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, int, error) // returns number of files ingested, number of files skipped and first encountered error AskDirectory(ctx context.Context, path string, query string, opts *IngestPathsOpts, ropts *datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error) PrunePath(ctx context.Context, datasetID string, path string, keep []string) ([]index.File, error) DeleteDocuments(ctx context.Context, datasetID string, documentIDs ...string) error Retrieve(ctx context.Context, datasetIDs []string, query string, opts datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error) ExportDatasets(ctx context.Context, path string, datasets ...string) error ImportDatasets(ctx context.Context, path string, datasets ...string) error UpdateDataset(ctx context.Context, dataset index.Dataset, opts *datastore.UpdateDatasetOpts) (*index.Dataset, error) }
type DefaultClient ¶
type DefaultClient struct {
ServerURL string
}
func NewDefaultClient ¶
func NewDefaultClient(serverURL string) *DefaultClient
func (*DefaultClient) AskDirectory ¶ added in v0.1.3
func (c *DefaultClient) AskDirectory(ctx context.Context, path string, query string, opts *IngestPathsOpts, ropts *datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error)
func (*DefaultClient) CreateDataset ¶
func (*DefaultClient) DeleteDataset ¶
func (c *DefaultClient) DeleteDataset(_ context.Context, datasetID string) error
func (*DefaultClient) DeleteDocuments ¶
func (*DefaultClient) DeleteFile ¶ added in v0.4.17
func (c *DefaultClient) DeleteFile(_ context.Context, datasetID, fileID string) error
func (*DefaultClient) ExportDatasets ¶ added in v0.1.7
func (*DefaultClient) GetDataset ¶
func (*DefaultClient) ImportDatasets ¶ added in v0.1.7
func (*DefaultClient) Ingest ¶
func (c *DefaultClient) Ingest(_ context.Context, datasetID string, name 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, int, error)
func (*DefaultClient) ListDatasets ¶
func (*DefaultClient) Retrieve ¶
func (c *DefaultClient) Retrieve(_ context.Context, datasetIDs []string, query string, opts datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error)
func (*DefaultClient) UpdateDataset ¶ added in v0.1.8
func (c *DefaultClient) UpdateDataset(ctx context.Context, dataset index.Dataset, opts *datastore.UpdateDatasetOpts) (*index.Dataset, error)
type FileMetadata ¶ added in v0.4.14
type IngestPathsOpts ¶
type IngestWorkspaceOpts ¶ added in v0.6.8
type IngestWorkspaceOpts struct {
}type Metadata ¶ added in v0.4.14
type Metadata struct { MetadataFileAbsPath string Metadata map[string]FileMetadata `json:"metadata"` // Map of file paths to metadata }
type SharedIngestionOpts ¶ added in v0.6.8
type SharedIngestionOpts struct {}
type StandaloneClient ¶
func NewStandaloneClient ¶
func (*StandaloneClient) AskDirectory ¶ added in v0.1.3
func (c *StandaloneClient) AskDirectory(ctx context.Context, path string, query string, opts *IngestPathsOpts, ropts *datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error)
func (*StandaloneClient) CreateDataset ¶
func (*StandaloneClient) DeleteDataset ¶
func (c *StandaloneClient) DeleteDataset(ctx context.Context, datasetID string) error
func (*StandaloneClient) DeleteDocuments ¶
func (*StandaloneClient) DeleteFile ¶ added in v0.4.17
func (c *StandaloneClient) DeleteFile(ctx context.Context, datasetID, fileID string) error
func (*StandaloneClient) ExportDatasets ¶ added in v0.1.7
func (*StandaloneClient) GetDataset ¶
func (*StandaloneClient) ImportDatasets ¶ added in v0.1.7
func (*StandaloneClient) Ingest ¶
func (c *StandaloneClient) Ingest(ctx context.Context, datasetID string, name string, data []byte, opts datastore.IngestOpts) ([]string, error)
func (*StandaloneClient) IngestFromWorkspace ¶ added in v0.6.8
func (c *StandaloneClient) IngestFromWorkspace(ctx context.Context, datasetID string, opts *IngestWorkspaceOpts, file string) error
func (*StandaloneClient) IngestPaths ¶
func (c *StandaloneClient) IngestPaths(ctx context.Context, datasetID string, opts *IngestPathsOpts, paths ...string) (int, int, error)
func (*StandaloneClient) ListDatasets ¶
func (*StandaloneClient) Retrieve ¶
func (c *StandaloneClient) Retrieve(ctx context.Context, datasetIDs []string, query string, opts datastore.RetrieveOpts) (*dstypes.RetrievalResponse, error)
func (*StandaloneClient) UpdateDataset ¶ added in v0.1.8
func (c *StandaloneClient) UpdateDataset(ctx context.Context, dataset index.Dataset, opts *datastore.UpdateDatasetOpts) (*index.Dataset, error)
Click to show internal directories.
Click to hide internal directories.