Documentation
¶
Index ¶
- func ConfirmAction(message string) bool
- func CountMockCollections(ctx context.Context, cfg *config.VectorDBConfig) (int, error)
- func CountMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
- func CountWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig) (int, error)
- func CountWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
- func CreateMockClient(cfg *config.VectorDBConfig) *mock.Client
- func CreateMockCollection(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func CreateMockDocument(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func CreateWeaviateClient(cfg *config.VectorDBConfig) (*weaviate.Client, error)
- func CreateWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func CreateWeaviateCollectionFromSchemaFile(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func CreateWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func DeleteAllMockCollections(ctx context.Context, cfg *config.VectorDBConfig)
- func DeleteAllMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
- func DeleteAllWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig)
- func DeleteAllWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
- func DeleteMockCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
- func DeleteMockCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
- func DeleteMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func DeleteWeaviateCollectionSchema(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) error
- func DeleteWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
- func DeleteWeaviateCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
- func DeleteWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func DisplayRegularDocuments(documents []weaviate.Document, collectionName string, showLong bool, ...)
- func DisplayVirtualDocuments(documents []weaviate.Document, collectionName string, showLong bool, ...)
- func ExportAsJSON(export *CollectionExport) (string, error)
- func ExportAsYAML(export *CollectionExport) (string, error)
- func GetStandaloneDocumentKey(doc weaviate.Document) string
- func GetStyledEmoji(emoji string) string
- func GetStyledKeyDimmed(key string) string
- func GetStyledKeyProminent(key string) string
- func GetStyledNumber(num interface{}) string
- func GetStyledValueDimmed(value string) string
- func GetValueType(value interface{}) string
- func IsImageContent(content string) bool
- func IsImageDocument(metadata map[string]interface{}) bool
- func IsImageVirtualDocument(vdoc VirtualDocument) bool
- func ListMockCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool)
- func ListMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ListWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool)
- func ListWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func LoadConfigWithOverrides() (*config.Config, error)
- func ParseFieldDefinitions(fieldsStr string) ([]weaviate.FieldDefinition, error)
- func PrintError(message string)
- func PrintHeader(message string)
- func PrintInfo(message string)
- func PrintStyledEmoji(emoji string)
- func PrintStyledFilename(filename string)
- func PrintStyledID(id string)
- func PrintStyledKey(key string)
- func PrintStyledKeyNumberProminentWithEmoji(key string, num int, emoji string)
- func PrintStyledKeyProminent(key string)
- func PrintStyledKeyValueDimmed(key, value string)
- func PrintStyledKeyValueProminentWithEmoji(key, value, emoji string)
- func PrintStyledNumber(num int)
- func PrintStyledValue(value string)
- func PrintStyledValueDimmed(value string)
- func PrintSuccess(message string)
- func PrintWarning(message string)
- func ShowCollectionMetadata(ctx context.Context, client *weaviate.Client, collectionName string, ...)
- func ShowCollectionSchema(ctx context.Context, client *weaviate.Client, collectionName string)
- func ShowDocumentMetadata(doc weaviate.Document, collectionName string)
- func ShowDocumentSchema(doc weaviate.Document, collectionName string)
- func ShowMockCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ShowMockDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ShowWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ShowWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func SmartTruncate(value, key string, shortLines int) string
- func TruncateMetadataValue(value interface{}, maxLength int) string
- func TruncateStringByLines(text string, maxLines int) string
- func WriteToFile(filePath string, content string) error
- type CollectionExport
- type MetadataFieldInfo
- type VirtualDocument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmAction ¶
ConfirmAction prompts the user for confirmation
func CountMockCollections ¶
CountMockCollections counts mock collections
func CountMockDocuments ¶
func CountMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
CountMockDocuments counts mock documents
func CountWeaviateCollections ¶
CountWeaviateCollections counts Weaviate collections
func CountWeaviateDocuments ¶
func CountWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
CountWeaviateDocuments counts Weaviate documents
func CreateMockClient ¶
func CreateMockClient(cfg *config.VectorDBConfig) *mock.Client
CreateMockClient creates a mock client from configuration
func CreateMockCollection ¶
func CreateMockCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, embeddingModel string, customFields []weaviate.FieldDefinition) error
CreateMockCollection creates a mock collection
func CreateMockDocument ¶
func CreateMockDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName, filePath string, chunkSize int, imageCollection string, skipSmallImages bool, minImageSize int)
CreateMockDocument creates a mock document
func CreateWeaviateClient ¶
func CreateWeaviateClient(cfg *config.VectorDBConfig) (*weaviate.Client, error)
CreateWeaviateClient creates a Weaviate client from configuration
func CreateWeaviateCollection ¶
func CreateWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, embeddingModel string, customFields []weaviate.FieldDefinition, schemaType string) error
CreateWeaviateCollection creates a Weaviate collection
func CreateWeaviateCollectionFromSchemaFile ¶ added in v0.2.4
func CreateWeaviateCollectionFromSchemaFile(ctx context.Context, cfg *config.VectorDBConfig, collectionName, schemaFilePath string) error
CreateWeaviateCollectionFromSchemaFile creates a Weaviate collection from a schema file
func CreateWeaviateDocument ¶
func CreateWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName, filePath string, chunkSize int, imageCollection string, skipSmallImages bool, minImageSize int) error
CreateWeaviateDocument creates a Weaviate document
func DeleteAllMockCollections ¶
func DeleteAllMockCollections(ctx context.Context, cfg *config.VectorDBConfig)
DeleteAllMockCollections deletes all documents from all mock collections
func DeleteAllMockDocuments ¶
func DeleteAllMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
DeleteAllMockDocuments deletes all mock documents in a collection
func DeleteAllWeaviateCollections ¶
func DeleteAllWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig)
DeleteAllWeaviateCollections deletes all documents from all Weaviate collections
func DeleteAllWeaviateDocuments ¶
func DeleteAllWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
DeleteAllWeaviateDocuments deletes all Weaviate documents in a collection
func DeleteMockCollections ¶
func DeleteMockCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
DeleteMockCollections deletes mock collections
func DeleteMockCollectionsByPattern ¶
func DeleteMockCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
DeleteMockCollectionsByPattern deletes mock collections by pattern
func DeleteMockDocuments ¶
func DeleteMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, metadataFilters []string, virtual bool, pattern string, name string)
DeleteMockDocuments deletes mock documents
func DeleteWeaviateCollectionSchema ¶
func DeleteWeaviateCollectionSchema(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) error
DeleteWeaviateCollectionSchema deletes Weaviate collection schema
func DeleteWeaviateCollections ¶
func DeleteWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
DeleteWeaviateCollections deletes Weaviate collections
func DeleteWeaviateCollectionsByPattern ¶
func DeleteWeaviateCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
DeleteWeaviateCollectionsByPattern deletes Weaviate collections by pattern
func DeleteWeaviateDocuments ¶
func DeleteWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, metadataFilters []string, virtual bool, pattern string, name string)
DeleteWeaviateDocuments deletes Weaviate documents
func DisplayRegularDocuments ¶
func DisplayRegularDocuments(documents []weaviate.Document, collectionName string, showLong bool, shortLines int)
DisplayRegularDocuments displays regular documents with styling
func DisplayVirtualDocuments ¶
func DisplayVirtualDocuments(documents []weaviate.Document, collectionName string, showLong bool, shortLines int, summary bool)
DisplayVirtualDocuments displays virtual documents with aggregation and styling
func ExportAsJSON ¶ added in v0.2.4
func ExportAsJSON(export *CollectionExport) (string, error)
ExportAsJSON exports collection data as JSON
func ExportAsYAML ¶ added in v0.2.4
func ExportAsYAML(export *CollectionExport) (string, error)
ExportAsYAML exports collection data as YAML
func GetStandaloneDocumentKey ¶
GetStandaloneDocumentKey extracts a unique key for standalone documents
func GetStyledEmoji ¶
GetStyledEmoji returns a styled emoji string
func GetStyledKeyDimmed ¶
GetStyledKeyDimmed returns a dimmed styled key string
func GetStyledKeyProminent ¶
GetStyledKeyProminent returns a styled key string
func GetStyledNumber ¶
func GetStyledNumber(num interface{}) string
GetStyledNumber returns a styled number string
func GetStyledValueDimmed ¶
GetStyledValueDimmed returns a dimmed styled value string
func GetValueType ¶
func GetValueType(value interface{}) string
GetValueType returns a string representation of the Go type
func IsImageContent ¶
IsImageContent checks if content looks like base64 image data
func IsImageDocument ¶
IsImageDocument checks if metadata indicates this is an image document
func IsImageVirtualDocument ¶
func IsImageVirtualDocument(vdoc VirtualDocument) bool
IsImageVirtualDocument checks if a virtual document represents an image collection
func ListMockCollections ¶
ListMockCollections lists mock collections
func ListMockDocuments ¶
func ListMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, limit int, showLong bool, shortLines int, virtual bool, summary bool)
ListMockDocuments lists mock documents
func ListWeaviateCollections ¶
func ListWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool)
ListWeaviateCollections lists Weaviate collections
func ListWeaviateDocuments ¶
func ListWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, limit int, showLong bool, shortLines int, virtual bool, summary bool)
ListWeaviateDocuments lists Weaviate documents
func LoadConfigWithOverrides ¶
LoadConfigWithOverrides loads configuration with command-line overrides
func ParseFieldDefinitions ¶
func ParseFieldDefinitions(fieldsStr string) ([]weaviate.FieldDefinition, error)
ParseFieldDefinitions parses field definitions from a string
func PrintHeader ¶
func PrintHeader(message string)
PrintHeader prints a header message in bold cyan
func PrintStyledFilename ¶
func PrintStyledFilename(filename string)
PrintStyledFilename prints a styled filename
func PrintStyledKeyNumberProminentWithEmoji ¶
PrintStyledKeyNumberProminentWithEmoji prints a prominent key-number pair with emoji
func PrintStyledKeyProminent ¶
func PrintStyledKeyProminent(key string)
PrintStyledKeyProminent prints a prominent styled key
func PrintStyledKeyValueDimmed ¶
func PrintStyledKeyValueDimmed(key, value string)
PrintStyledKeyValueDimmed prints a dimmed key-value pair
func PrintStyledKeyValueProminentWithEmoji ¶
func PrintStyledKeyValueProminentWithEmoji(key, value, emoji string)
PrintStyledKeyValueProminentWithEmoji prints a prominent key-value pair with emoji
func PrintStyledValueDimmed ¶
func PrintStyledValueDimmed(value string)
PrintStyledValueDimmed prints a dimmed styled value
func PrintSuccess ¶
func PrintSuccess(message string)
PrintSuccess prints a success message in green
func PrintWarning ¶
func PrintWarning(message string)
PrintWarning prints a warning message in yellow
func ShowCollectionMetadata ¶ added in v0.2.4
func ShowCollectionMetadata(ctx context.Context, client *weaviate.Client, collectionName string, expandMetadata bool)
ShowCollectionMetadata displays collection metadata with styling
func ShowCollectionSchema ¶ added in v0.2.4
ShowCollectionSchema displays the collection schema with styling
func ShowDocumentMetadata ¶
ShowDocumentMetadata shows expanded metadata for a document
func ShowDocumentSchema ¶
ShowDocumentSchema shows the schema of a Weaviate document
func ShowMockCollection ¶
func ShowMockCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, shortLines int, noTruncate bool, verbose bool, showSchema bool, showMetadata bool, expandMetadata bool, outputYAML bool, outputJSON bool, yamlFile string, jsonFile string)
ShowMockCollection shows mock collection details
func ShowMockDocument ¶
func ShowMockDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, showLong bool, shortLines int, metadataFilters []string, name string, showSchema bool, expandMetadata bool)
ShowMockDocument shows mock document details
func ShowWeaviateCollection ¶
func ShowWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, shortLines int, noTruncate bool, verbose bool, showSchema bool, showMetadata bool, expandMetadata bool, outputYAML bool, outputJSON bool, yamlFile string, jsonFile string)
ShowWeaviateCollection shows Weaviate collection details
func ShowWeaviateDocument ¶
func ShowWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, showLong bool, shortLines int, metadataFilters []string, name string, showSchema bool, expandMetadata bool)
ShowWeaviateDocument shows Weaviate document details
func SmartTruncate ¶
SmartTruncate intelligently truncates content based on key type
func TruncateMetadataValue ¶
TruncateMetadataValue truncates a metadata value to a maximum length
func TruncateStringByLines ¶
TruncateStringByLines truncates text to a maximum number of lines
func WriteToFile ¶ added in v0.2.4
WriteToFile writes content to a file
Types ¶
type CollectionExport ¶ added in v0.2.4
type CollectionExport struct {
Name string `json:"name" yaml:"name"`
Schema *weaviate.CollectionSchema `json:"schema,omitempty" yaml:"schema,omitempty"`
Metadata map[string]MetadataFieldInfo `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}
CollectionExport represents the combined schema and metadata for export
func ExportCollectionSchemaAndMetadata ¶ added in v0.2.4
func ExportCollectionSchemaAndMetadata(ctx context.Context, client *weaviate.Client, collectionName string, includeMetadata bool, expandMetadata bool) (*CollectionExport, error)
ExportCollectionSchemaAndMetadata exports collection schema and metadata
func LoadSchemaFromJSONFile ¶ added in v0.2.4
func LoadSchemaFromJSONFile(filePath string) (*CollectionExport, error)
LoadSchemaFromJSONFile loads a collection schema from a JSON file
func LoadSchemaFromYAMLFile ¶ added in v0.2.4
func LoadSchemaFromYAMLFile(filePath string) (*CollectionExport, error)
LoadSchemaFromYAMLFile loads a collection schema from a YAML file
type MetadataFieldInfo ¶ added in v0.2.4
type MetadataFieldInfo struct {
Type string `json:"type" yaml:"type"`
Occurrences int `json:"occurrences" yaml:"occurrences"`
Sample interface{} `json:"sample,omitempty" yaml:"sample,omitempty"`
}
MetadataFieldInfo represents metadata field information
type VirtualDocument ¶
type VirtualDocument struct {
OriginalFilename string
TotalChunks int
Chunks []weaviate.Document
Metadata map[string]interface{}
}
VirtualDocument represents a virtual document structure
func AggregateDocumentsByOriginal ¶
func AggregateDocumentsByOriginal(documents []weaviate.Document) []VirtualDocument
AggregateDocumentsByOriginal aggregates documents by their original filename/source