cmd

package
v0.0.0-...-751b377 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *cobra.Command

Types

type Client

type Client struct {
	EmbeddingModelProvider string `` /* 134-byte string literal not displayed */
	ConfigFile             string `usage:"Path to the configuration file" env:"KNOW_CONFIG_FILE" default:"" short:"c"`

	config.DatabaseConfig
	config.VectorDBConfig
	// contains filtered or unexported fields
}

type ClientAskDir

type ClientAskDir struct {
	Client
	Path    string `usage:"Path to the directory to query" short:"p" default:"."`
	NoPrune bool   `usage:"Do not prune deleted files" env:"KNOW_ASKDIR_NO_PRUNE"`
	ClientIngestOpts
	ClientRetrieveOpts
	ClientFlowsConfig
}

func (*ClientAskDir) Customize

func (s *ClientAskDir) Customize(cmd *cobra.Command)

func (*ClientAskDir) Run

func (s *ClientAskDir) Run(cmd *cobra.Command, args []string) error

type ClientCreateDataset

type ClientCreateDataset struct {
	Client
	ErrOnExists bool `usage:"Return an error if the dataset already exists"`
}

func (*ClientCreateDataset) Customize

func (s *ClientCreateDataset) Customize(cmd *cobra.Command)

func (*ClientCreateDataset) Run

func (s *ClientCreateDataset) Run(cmd *cobra.Command, args []string) error

type ClientDeleteDataset

type ClientDeleteDataset struct {
	Client
}

func (*ClientDeleteDataset) Customize

func (s *ClientDeleteDataset) Customize(cmd *cobra.Command)

func (*ClientDeleteDataset) Run

func (s *ClientDeleteDataset) Run(cmd *cobra.Command, args []string) error

type ClientDeleteFile

type ClientDeleteFile struct {
	Client
	Dataset string `usage:"Target Dataset ID" short:"d"`
}

func (*ClientDeleteFile) Customize

func (s *ClientDeleteFile) Customize(cmd *cobra.Command)

func (*ClientDeleteFile) Run

func (s *ClientDeleteFile) Run(cmd *cobra.Command, args []string) error

type ClientEditDataset

type ClientEditDataset struct {
	Client
	ResetMetadata   bool              `usage:"reset metadata to default (empty)"`
	UpdateMetadata  map[string]string `usage:"update metadata key-value pairs (existing metadata will be updated/preserved)"`
	ReplaceMetadata map[string]string `usage:"replace metadata with key-value pairs (existing metadata will be removed)"`
}

func (*ClientEditDataset) Customize

func (s *ClientEditDataset) Customize(cmd *cobra.Command)

func (*ClientEditDataset) Run

func (s *ClientEditDataset) Run(cmd *cobra.Command, args []string) error

type ClientExportDatasets

type ClientExportDatasets struct {
	Client
	Output string `usage:"Output path" default:"."`
	All    bool   `usage:"Export all datasets" short:"a"`
}

func (*ClientExportDatasets) Customize

func (s *ClientExportDatasets) Customize(cmd *cobra.Command)

func (*ClientExportDatasets) Run

func (s *ClientExportDatasets) Run(cmd *cobra.Command, args []string) error

type ClientFlowsConfig

type ClientFlowsConfig struct {
	FlowsFile string `usage:"Path to a YAML/JSON file containing ingestion/retrieval flows" env:"KNOW_FLOWS_FILE" default:"blueprint:default"`
	Flow      string `usage:"Flow name" env:"KNOW_FLOW"`
}

type ClientGetDataset

type ClientGetDataset struct {
	Client
	Archive string `usage:"Path to the archive file"`
	NoDocs  bool   `usage:"Do not include documents in output (way less verbose)"`
}

func (*ClientGetDataset) Customize

func (s *ClientGetDataset) Customize(cmd *cobra.Command)

func (*ClientGetDataset) Run

func (s *ClientGetDataset) Run(cmd *cobra.Command, args []string) error

type ClientGetFile

type ClientGetFile struct {
	Client
	Dataset string `usage:"Target Dataset ID" short:"d"`
}

func (*ClientGetFile) Customize

func (s *ClientGetFile) Customize(cmd *cobra.Command)

func (*ClientGetFile) Run

func (s *ClientGetFile) Run(cmd *cobra.Command, args []string) error

type ClientImportDatasets

type ClientImportDatasets struct {
	Client
}

func (*ClientImportDatasets) Customize

func (s *ClientImportDatasets) Customize(cmd *cobra.Command)

func (*ClientImportDatasets) Run

func (s *ClientImportDatasets) Run(cmd *cobra.Command, args []string) error

type ClientIngest

type ClientIngest struct {
	Client
	Dataset string `usage:"Target Dataset ID" short:"d" env:"KNOW_DATASET"`
	Prune   bool   `usage:"Prune deleted files" env:"KNOW_INGEST_PRUNE"`
	ClientIngestOpts
	ClientFlowsConfig
}

func (*ClientIngest) Customize

func (s *ClientIngest) Customize(cmd *cobra.Command)

func (*ClientIngest) Run

func (s *ClientIngest) Run(cmd *cobra.Command, args []string) error

type ClientIngestOpts

type ClientIngestOpts struct {
	IgnoreExtensions      string            `usage:"Comma-separated list of file extensions to ignore" env:"KNOW_INGEST_IGNORE_EXTENSIONS"`
	IgnoreFile            string            `usage:"Path to a .gitignore style file" env:"KNOW_INGEST_IGNORE_FILE"`
	IncludeHidden         bool              `usage:"Include hidden files and directories" default:"false" env:"KNOW_INGEST_INCLUDE_HIDDEN"`
	Concurrency           int               `usage:"Number of concurrent ingestion processes" default:"10" env:"KNOW_INGEST_CONCURRENCY"`
	NoRecursive           bool              `usage:"Don't recursively ingest directories" default:"false" env:"KNOW_NO_INGEST_RECURSIVE"`
	NoCreateDataset       bool              `usage:"Do NOT create the dataset if it doesn't exist" default:"true" env:"KNOW_INGEST_NO_CREATE_DATASET"`
	DeduplicationFuncName string            `usage:"Name of the deduplication function to use" name:"dedupe-func" env:"KNOW_INGEST_DEDUPE_FUNC"`
	ErrOnUnsupportedFile  bool              `usage:"Error on unsupported file types" default:"false" env:"KNOW_INGEST_ERR_ON_UNSUPPORTED_FILE"`
	ExitOnFailedFile      bool              `usage:"Exit directly on failed file" default:"false" env:"KNOW_INGEST_EXIT_ON_FAILED_FILE"`
	Metadata              map[string]string `usage:"Metadata to attach to the ingested files" env:"KNOW_INGEST_METADATA"`
	MetadataJSON          string            `usage:"Metadata to attach to the loaded files in JSON format" env:"METADATA_JSON"`
}

type ClientListDatasets

type ClientListDatasets struct {
	Client
	Archive string `usage:"Path to the archive file"`
}

func (*ClientListDatasets) Customize

func (s *ClientListDatasets) Customize(cmd *cobra.Command)

func (*ClientListDatasets) Run

func (s *ClientListDatasets) Run(cmd *cobra.Command, args []string) error

type ClientLoad

type ClientLoad struct {
	Loader       string            `usage:"Choose a document loader to use"`
	OutputFormat string            `name:"format" usage:"Choose an output format" default:"structured"`
	Metadata     map[string]string `usage:"Metadata to attach to the loaded files" env:"METADATA"`
	MetadataJSON string            `usage:"Metadata to attach to the loaded files in JSON format" env:"METADATA_JSON"`
	ClientFlowsConfig
}

func (*ClientLoad) Customize

func (s *ClientLoad) Customize(cmd *cobra.Command)

func (*ClientLoad) Run

func (s *ClientLoad) Run(cmd *cobra.Command, args []string) error

type ClientRetrieve

type ClientRetrieve struct {
	Client
	Datasets []string `usage:"Target Dataset IDs" short:"d" env:"KNOW_DATASETS" name:"dataset"`
	Archive  string   `usage:"Path to the archive file"`
	ClientRetrieveOpts
	ClientFlowsConfig
}

func (*ClientRetrieve) Customize

func (s *ClientRetrieve) Customize(cmd *cobra.Command)

func (*ClientRetrieve) Run

func (s *ClientRetrieve) Run(cmd *cobra.Command, args []string) error

type ClientRetrieveOpts

type ClientRetrieveOpts struct {
	TopK     int      `usage:"Number of sources to retrieve" short:"k" default:"10"`
	Keywords []string `usage:"Keywords that retrieved documents must contain" short:"w" name:"keyword" env:"KNOW_RETRIEVE_KEYWORDS"`
}

type Knowledge

type Knowledge struct {
	Debug bool `usage:"Enable debug logging" env:"DEBUG" hidden:"true"`
	Json  bool `usage:"Output JSON" env:"KNOW_JSON" hidden:"true"`
}

func (*Knowledge) PersistentPre

func (c *Knowledge) PersistentPre(_ *cobra.Command, _ []string) error

func (*Knowledge) Run

func (c *Knowledge) Run(cmd *cobra.Command, _ []string) error

type Version

type Version struct{}

func (*Version) Run

func (c *Version) Run(cmd *cobra.Command, _ []string) error

Jump to

Keyboard shortcuts

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