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 CreateWeaviateCollectionFromConfigSchema(ctx context.Context, cfg *config.Config, dbConfig *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 DeleteWeaviateCollectionSchemasByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern 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 DisplayQueryResults(results []weaviate.QueryResult, collectionName, queryText 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 FormatCreationError(resourceType string, err error) string
- func FormatDeletionError(resourceType string, err error) string
- func FormatQueryError(err error) string
- func GenerateDefaultReportPath(filePath string) string
- 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 QueryMockCollection(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func QueryWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, ...)
- 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 SimplifyError(err error) string
- func SmartTruncate(value, key string, shortLines int) string
- func TruncateMetadataValue(value interface{}, maxLength int) string
- func TruncateStringByLines(text string, maxLines int) string
- func UpdateMockDocument(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func UpdateWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func WriteProcessingReport(report *ProcessingReport) error
- func WriteToFile(filePath string, content string) error
- type ChunkReport
- type CollectionExport
- type ImageGroup
- type ImageReport
- type MetadataFieldInfo
- type ProcessingReport
- type VirtualDocument
- type WeaviateError
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, batchSize int, reportPath string, reportMode string)
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) error
CreateWeaviateCollection creates a Weaviate collection with default schema
func CreateWeaviateCollectionFromConfigSchema ¶ added in v0.2.5
func CreateWeaviateCollectionFromConfigSchema(ctx context.Context, cfg *config.Config, dbConfig *config.VectorDBConfig, collectionName, schemaName, metadataMode string) error
CreateWeaviateCollectionFromConfigSchema creates a Weaviate collection from a named schema in config.yaml
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, batchSize int, reportPath string, reportMode string) 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 DeleteWeaviateCollectionSchemasByPattern ¶ added in v0.2.6
func DeleteWeaviateCollectionSchemasByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
DeleteWeaviateCollectionSchemasByPattern deletes Weaviate collection schemas by pattern
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 DisplayQueryResults ¶ added in v0.2.8
func DisplayQueryResults(results []weaviate.QueryResult, collectionName, queryText string, noTruncate bool)
DisplayQueryResults displays semantic search results with styling
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 with compact formatting
func FormatCreationError ¶ added in v0.2.10
FormatCreationError formats collection/document creation errors
func FormatDeletionError ¶ added in v0.2.10
FormatDeletionError formats collection/document deletion errors
func FormatQueryError ¶ added in v0.2.10
FormatQueryError formats query errors
func GenerateDefaultReportPath ¶ added in v0.2.13
GenerateDefaultReportPath generates a default CSV report path from input file
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 QueryMockCollection ¶ added in v0.2.8
func QueryMockCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, queryText string, options weaviate.QueryOptions)
QueryMockCollection performs semantic search on a mock collection
func QueryWeaviateCollection ¶ added in v0.2.8
func QueryWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, queryText string, options weaviate.QueryOptions)
QueryWeaviateCollection performs semantic search on a Weaviate collection
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, compact bool)
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, compact bool)
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 SimplifyError ¶ added in v0.2.10
SimplifyError takes a verbose error message and makes it more human-friendly
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 UpdateMockDocument ¶ added in v0.2.9
func UpdateMockDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName, documentID, docName string, metadataFilter []string, content, filePath string, metadata []string)
UpdateMockDocument updates a document in the mock database
func UpdateWeaviateDocument ¶ added in v0.2.9
func UpdateWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName, documentID, docName string, metadataFilter []string, content, filePath string, metadata []string) error
UpdateWeaviateDocument updates an existing document in Weaviate
func WriteProcessingReport ¶ added in v0.2.13
func WriteProcessingReport(report *ProcessingReport) error
WriteProcessingReport writes or appends a processing report to CSV
func WriteToFile ¶ added in v0.2.4
WriteToFile writes content to a file
Types ¶
type ChunkReport ¶ added in v0.2.13
ChunkReport tracks a single text chunk processing result
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"`
SchemaMetadata map[string]interface{} `json:"schema_metadata,omitempty" yaml:"metadata,omitempty"`
Metadata map[string]MetadataFieldInfo `json:"metadata,omitempty" yaml:"runtime_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, compact 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 ImageGroup ¶ added in v0.2.13
type ImageGroup struct {
SourcePDF string
DisplayName string
TotalCount int
TotalChunks int
Images []VirtualDocument
MinPage int
MaxPage int
IsImage bool // true for images, false for regular documents
}
ImageGroup represents a group of images or documents from the same source
type ImageReport ¶ added in v0.2.13
type ImageReport struct {
ImageNumber int
Filename string
Success bool
Error string
SizeBytes int
OCRWarnings []string
}
ImageReport tracks a single image processing result
type MetadataFieldInfo ¶ added in v0.2.4
type MetadataFieldInfo struct {
Type string `json:"type" yaml:"type"`
Occurrences int `json:"occurrences,omitempty" yaml:"occurrences,omitempty"`
Sample interface{} `json:"sample,omitempty" yaml:"sample,omitempty"`
JSONSchema map[string]interface{} `json:"json_schema,omitempty" yaml:"json_schema,omitempty"`
}
MetadataFieldInfo represents metadata field information
type ProcessingReport ¶ added in v0.2.13
type ProcessingReport struct {
FilePath string
Collection string
Timestamp time.Time
TextChunks []ChunkReport
Images []ImageReport
ReportPath string
ReportMode string
}
ProcessingReport tracks processing results for CSV reporting
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
type WeaviateError ¶ added in v0.2.10
type WeaviateError struct {
Error []struct {
Message string `json:"message"`
} `json:"error"`
}
WeaviateError represents a structured error from Weaviate