feat: support weaviate vectordb for knowledge retrieve
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
package weaviate
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/weaviate/weaviate-go-client/v5/weaviate"
|
||||
)
|
||||
|
||||
type weaviateRepository struct {
|
||||
client *weaviate.Client
|
||||
collectionBaseName string
|
||||
// Cache for initialized collections (dimension -> true)
|
||||
initializedCollections sync.Map
|
||||
}
|
||||
|
||||
type WeaviateVectorEmbedding struct {
|
||||
Content string `json:"content"`
|
||||
SourceID string `json:"source_id"`
|
||||
SourceType int `json:"source_type"`
|
||||
ChunkID string `json:"chunk_id"`
|
||||
KnowledgeID string `json:"knowledge_id"`
|
||||
KnowledgeBaseID string `json:"knowledge_base_id"`
|
||||
TagID string `json:"tag_id"`
|
||||
Embedding []float32 `json:"embedding"`
|
||||
IsEnabled bool `json:"is_enabled"`
|
||||
}
|
||||
|
||||
type WeaviateVectorEmbeddingWithScore struct {
|
||||
WeaviateVectorEmbedding
|
||||
Score float64
|
||||
}
|
||||
Reference in New Issue
Block a user