Documentation
¶
Index ¶
- func AreAllWeaviateDatabases(configs []config.VectorDBConfig) bool
- func ConfirmAction(message string) bool
- func CountDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
- func CountGenericCollections(ctx context.Context, cfg *config.VectorDBConfig) (int, error)
- 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 CreateDocument(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func CreateGenericCollection(ctx context.Context, cfg *config.VectorDBConfig, ...) 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 CreateSupabaseCollection(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func CreateVectorDBClient(cfg *config.VectorDBConfig) (vectordb.VectorDBClient, error)
- 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 DeleteAllDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
- 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 DeleteDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func DeleteGenericCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
- func DeleteGenericCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
- 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 DeleteSupabaseCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
- func DeleteSupabaseCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
- 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 GetSupportedVectorDBTypes() []vectordb.VectorDBType
- func GetValueType(value interface{}) string
- func GetVectorDBTypeFromConfig(dbConfig *config.VectorDBConfig) string
- func HandleConfigError(err error, exitOnError bool) bool
- func HandleSingleDatabaseSelection(ctx context.Context, selection *VectorDBSelection, cfg *config.Config, ...) *config.VectorDBConfig
- func IsImageContent(content string) bool
- func IsImageDocument(metadata map[string]interface{}) bool
- func IsImageVirtualDocument(vdoc VirtualDocument) bool
- func IsVectorDBTypeSupported(dbType string) bool
- func ListDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ListMilvusCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, ...)
- func ListMockCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, ...)
- func ListMockDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ListMongoDBCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, ...)
- func ListSupabaseCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, ...)
- func ListWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, ...)
- func ListWeaviateDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func LoadConfigWithInteractiveHelp() (*config.Config, error)
- func LoadConfigWithOverrides() (*config.Config, error)
- func ParseFieldDefinitions(fieldsStr string) ([]weaviate.FieldDefinition, error)
- func PrintConfigTips()
- 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 QueryCollection(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func QueryMockCollection(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func QueryWeaviateCollection(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func SelectDefaultDatabase(configs []config.VectorDBConfig, cfg *config.Config) *config.VectorDBConfig
- func SelectSingleDatabase(ctx context.Context, configs []config.VectorDBConfig, cfg *config.Config, ...) *config.VectorDBConfig
- func ShowCollectionMetadata(ctx context.Context, client *weaviate.Client, collectionName string, ...)
- func ShowCollectionSchema(ctx context.Context, client *weaviate.Client, collectionName string)
- func ShowDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, ...)
- func ShowDocumentMetadata(doc weaviate.Document, collectionName string)
- func ShowDocumentSchema(doc weaviate.Document, collectionName string)
- func ShowGenericCollection(ctx context.Context, cfg *config.VectorDBConfig, 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 TryWeaviateDatabasesForCollection(ctx context.Context, configs []config.VectorDBConfig, collectionName string) *config.VectorDBConfig
- func UpdateMockDocument(ctx context.Context, cfg *config.VectorDBConfig, ...)
- func UpdateWeaviateDocument(ctx context.Context, cfg *config.VectorDBConfig, ...) error
- func ValidateDatabaseSelection(selection *VectorDBSelection, opType OperationType, operationName string) error
- func WriteProcessingReport(report *ProcessingReport) error
- func WriteToFile(filePath string, content string) error
- type ChunkReport
- type CollectionExport
- type ImageGroup
- type ImageReport
- type MetadataFieldInfo
- type OperationType
- type ProcessingReport
- type VectorDBSelection
- type VirtualDocument
- type WeaviateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreAllWeaviateDatabases ¶ added in v0.3.11
func AreAllWeaviateDatabases(configs []config.VectorDBConfig) bool
AreAllWeaviateDatabases checks if all configs are Weaviate databases
func ConfirmAction ¶
ConfirmAction prompts the user for confirmation
func CountDocuments ¶ added in v0.4.0
func CountDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string) (int, error)
CountDocuments counts documents using vectordb abstraction (works for all DB types)
func CountGenericCollections ¶ added in v0.5.0
CountGenericCollections counts collections using the VectorDB interface
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 CreateDocument ¶ added in v0.3.10
func CreateDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName, filePath string, chunkSize int, imageCollection string, skipSmallImages bool, minImageSize int, batchSize int, reportPath string, reportMode string, embeddingModel string) error
CreateWeaviateDocument creates a Weaviate document CreateDocument creates a document using the vectordb abstraction (works for all DB types)
func CreateGenericCollection ¶ added in v0.5.0
func CreateGenericCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, embeddingModel string) error
CreateGenericCollection creates a collection using the generic VectorDB interface Works for any database that implements the VectorDBClient interface (Milvus, etc.)
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 CreateSupabaseCollection ¶ added in v0.3.9
func CreateSupabaseCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, embeddingModel string) error
CreateSupabaseCollection creates a Supabase collection with default schema
func CreateVectorDBClient ¶ added in v0.3.9
func CreateVectorDBClient(cfg *config.VectorDBConfig) (vectordb.VectorDBClient, error)
CreateVectorDBClient creates a vector database client using the new abstraction
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 DeleteAllDocuments ¶ added in v0.4.0
func DeleteAllDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string)
DeleteAllDocuments deletes all documents using database-specific implementations
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 DeleteDocuments ¶ added in v0.3.10
func DeleteDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, metadataFilters []string, virtual bool, pattern string, name string)
DeleteDocuments deletes documents using the vectordb abstraction (works for all DB types)
func DeleteGenericCollections ¶ added in v0.5.0
func DeleteGenericCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
DeleteGenericCollections deletes collections using the VectorDB interface
func DeleteGenericCollectionsByPattern ¶ added in v0.5.0
func DeleteGenericCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
DeleteGenericCollectionsByPattern deletes collections matching a pattern using VectorDB interface
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 DeleteSupabaseCollections ¶ added in v0.3.13
func DeleteSupabaseCollections(ctx context.Context, cfg *config.VectorDBConfig, collectionNames []string) error
DeleteSupabaseCollections deletes Supabase collections
func DeleteSupabaseCollectionsByPattern ¶ added in v0.3.13
func DeleteSupabaseCollectionsByPattern(ctx context.Context, cfg *config.VectorDBConfig, pattern string) error
DeleteSupabaseCollectionsByPattern deletes Supabase collections by pattern
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, jsonOutput bool)
DisplayQueryResults displays semantic search results with styling
func DisplayRegularDocuments ¶
func DisplayRegularDocuments(documents []weaviate.Document, collectionName string, showLong bool, shortLines int, jsonOutput bool, vectorizer string)
DisplayRegularDocuments displays regular documents with styling
func DisplayVirtualDocuments ¶
func DisplayVirtualDocuments(documents []weaviate.Document, collectionName string, showLong bool, shortLines int, summary bool, jsonOutput bool, vectorizer string)
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 GetSupportedVectorDBTypes ¶ added in v0.3.9
func GetSupportedVectorDBTypes() []vectordb.VectorDBType
GetSupportedVectorDBTypes returns all supported vector database types
func GetValueType ¶
func GetValueType(value interface{}) string
GetValueType returns a string representation of the Go type
func GetVectorDBTypeFromConfig ¶ added in v0.3.9
func GetVectorDBTypeFromConfig(dbConfig *config.VectorDBConfig) string
GetVectorDBTypeFromConfig determines the vector DB type from a VectorDBConfig
func HandleConfigError ¶ added in v0.3.6
HandleConfigError handles configuration errors with helpful messages
func HandleSingleDatabaseSelection ¶ added in v0.3.11
func HandleSingleDatabaseSelection(ctx context.Context, selection *VectorDBSelection, cfg *config.Config, collectionName, commandExample string) *config.VectorDBConfig
HandleSingleDatabaseSelection is a helper that combines smart database selection with error handling Use this in commands that need exactly one database Returns the selected database config or exits the program with an error message
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 IsVectorDBTypeSupported ¶ added in v0.3.9
IsVectorDBTypeSupported checks if a vector database type is supported
func ListDocuments ¶ added in v0.3.10
func ListDocuments(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, limit int, showLong bool, shortLines int, virtual bool, summary bool, jsonOutput bool)
ListWeaviateDocuments lists Weaviate documents ListDocuments lists documents using the vector database abstraction (works for all DB types)
func ListMilvusCollections ¶ added in v0.5.0
func ListMilvusCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, jsonOutput bool)
ListMilvusCollections lists Milvus collections
func ListMockCollections ¶
func ListMockCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, jsonOutput bool)
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 ListMongoDBCollections ¶ added in v0.4.0
func ListMongoDBCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, jsonOutput bool)
ListMongoDBCollections lists MongoDB collections
func ListSupabaseCollections ¶ added in v0.3.9
func ListSupabaseCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, jsonOutput bool)
ListSupabaseCollections lists Supabase collections
func ListWeaviateCollections ¶
func ListWeaviateCollections(ctx context.Context, cfg *config.VectorDBConfig, limit int, virtual bool, jsonOutput bool)
ListWeaviateCollections lists Weaviate collections
func ListWeaviateDocuments ¶
func LoadConfigWithInteractiveHelp ¶ added in v0.3.6
LoadConfigWithInteractiveHelp loads configuration and offers interactive help on errors
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 PrintConfigTips ¶ added in v0.3.6
func PrintConfigTips()
PrintConfigTips prints helpful tips about configuration
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 QueryCollection ¶ added in v0.3.11
func QueryCollection(ctx context.Context, cfg *config.VectorDBConfig, collectionName, queryText string, options weaviate.QueryOptions)
QueryCollection performs semantic search on a collection using the vectordb abstraction (works for all DB types)
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 SelectDefaultDatabase ¶ added in v0.3.11
func SelectDefaultDatabase(configs []config.VectorDBConfig, cfg *config.Config) *config.VectorDBConfig
SelectDefaultDatabase selects the default database from a list based on VECTOR_DB_TYPE
func SelectSingleDatabase ¶ added in v0.3.11
func SelectSingleDatabase(ctx context.Context, configs []config.VectorDBConfig, cfg *config.Config, collectionName string) *config.VectorDBConfig
SelectSingleDatabase intelligently selects a single database from multiple options Returns the selected database config, or nil if selection cannot be made This function: 1. Returns the only config if there's just one 2. Uses VECTOR_DB_TYPE from env/config as default 3. For Weaviate databases, tries to find the collection in available DBs 4. Returns nil if multiple different database types and no default
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 ShowDocument ¶ added in v0.3.10
func ShowDocument(ctx context.Context, cfg *config.VectorDBConfig, collectionName string, documentIDs []string, showLong bool, shortLines int, metadataFilters []string, name string, showSchema bool, expandMetadata bool, jsonOutput bool)
ShowWeaviateDocument shows Weaviate document details ShowDocument shows document(s) using the vectordb abstraction (works for all DB types)
func ShowDocumentMetadata ¶
ShowDocumentMetadata shows expanded metadata for a document
func ShowDocumentSchema ¶
ShowDocumentSchema shows the schema of a Weaviate document
func ShowGenericCollection ¶ added in v0.5.0
func ShowGenericCollection(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)
ShowGenericCollection shows collection details using VectorDB interface
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, jsonOutput 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 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 TryWeaviateDatabasesForCollection ¶ added in v0.3.11
func TryWeaviateDatabasesForCollection(ctx context.Context, configs []config.VectorDBConfig, collectionName string) *config.VectorDBConfig
TryWeaviateDatabasesForCollection tries to find a collection in Weaviate databases
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 ValidateDatabaseSelection ¶ added in v0.3.9
func ValidateDatabaseSelection(selection *VectorDBSelection, opType OperationType, operationName string) error
ValidateDatabaseSelection validates that the database selection is appropriate for the operation type
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 OperationType ¶ added in v0.3.9
type OperationType string
OperationType defines the type of operation being performed
const ( OperationTypeRead OperationType = "read" // ls, show, count - can use multiple DBs OperationTypeWrite OperationType = "write" // create, update - requires single DB OperationTypeDelete OperationType = "delete" // delete, da, ds - requires single DB )
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 VectorDBSelection ¶ added in v0.3.9
type VectorDBSelection struct {
Configs []config.VectorDBConfig
Types []string
}
VectorDBSelection represents the selected vector databases
func GetSelectedVectorDBs ¶ added in v0.3.9
GetSelectedVectorDBs determines which vector databases to use based on command flags
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