cmd

package
v0.4.14-rc.23 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 30 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 {
	Server string `usage:"URL of the Knowledge API Server" default:"" env:"KNOW_SERVER_URL"`

	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 added in v0.1.3

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 added in v0.1.3

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

func (*ClientAskDir) Run added in v0.1.3

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

type ClientCreateDataset

type ClientCreateDataset struct {
	Client
}

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 ClientEditDataset added in v0.1.8

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 added in v0.1.8

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

func (*ClientEditDataset) Run added in v0.1.8

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

type ClientExportDatasets added in v0.1.7

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

func (*ClientExportDatasets) Customize added in v0.1.7

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

func (*ClientExportDatasets) Run added in v0.1.7

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

type ClientFlowsConfig added in v0.1.6

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 ClientImportDatasets added in v0.1.7

type ClientImportDatasets struct {
	Client
}

func (*ClientImportDatasets) Customize added in v0.1.7

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

func (*ClientImportDatasets) Run added in v0.1.7

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

type ClientIngest

type ClientIngest struct {
	Client
	Dataset string `usage:"Target Dataset ID" short:"d" default:"default" env:"KNOW_DATASET"`
	Prune   bool   `usage:"Prune deleted files" env:"KNOW_INGEST_PRUNE"`
	ClientIngestOpts
	textsplitter.TextSplitterOpts
	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 added in v0.1.3

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"`
}

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 added in v0.4.14

type ClientLoad struct {
	Loader string `usage:"Choose a document loader to use"`
}

func (*ClientLoad) Customize added in v0.4.14

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

func (*ClientLoad) Run added in v0.4.14

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

type ClientResetDatastore

type ClientResetDatastore struct {
	Client
}

func (*ClientResetDatastore) Customize

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

func (*ClientResetDatastore) Run

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

type ClientRetrieve

type ClientRetrieve struct {
	Client
	Datasets []string `usage:"Target Dataset IDs" short:"d" default:"default" 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 added in v0.1.3

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 added in v0.4.14

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

func (*Knowledge) Run

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

type Server

type Server struct {
	ServerURL     string `usage:"Server URL" default:"http://localhost" env:"KNOW_SERVER_URL"`
	ServerPort    string `usage:"Server port" default:"8000" env:"KNOW_SERVER_PORT"`
	ServerAPIBase string `usage:"Server API base" default:"/v1" env:"KNOW_SERVER_API_BASE"`

	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
}

Server is the Server CLI command

func (*Server) Customize added in v0.3.0

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

func (*Server) Run

func (s *Server) Run(cmd *cobra.Command, _ []string) error

type Version added in v0.1.5

type Version struct{}

func (*Version) Run added in v0.1.5

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