Documentation
¶
Index ¶
- func NewEmbeddingStoreModel() contracts.IEmbeddingStore
- type EmbeddingStore
- func (store *EmbeddingStore) CosineSimilarity(vec1, vec2 []float64) float64
- func (store *EmbeddingStore) FindRelevantChunks(queryEmbedding []float64, topN int, embeddingModel string, threshold float64) []string
- func (store *EmbeddingStore) FindThresholdByModel(modelName string) float64
- func (store *EmbeddingStore) Save(key string, code string, embeddings []float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEmbeddingStoreModel ¶
func NewEmbeddingStoreModel() contracts.IEmbeddingStore
NewEmbeddingStoreModel initializes a new CodeEmbeddingStoreModel.
Types ¶
type EmbeddingStore ¶
type EmbeddingStore struct {
EmbeddingsStore map[string][]float64
CodeStore map[string]string
// contains filtered or unexported fields
}
EmbeddingStore holds the embeddings and their corresponding code chunks.
func (*EmbeddingStore) CosineSimilarity ¶
func (store *EmbeddingStore) CosineSimilarity(vec1, vec2 []float64) float64
func (*EmbeddingStore) FindRelevantChunks ¶
func (store *EmbeddingStore) FindRelevantChunks(queryEmbedding []float64, topN int, embeddingModel string, threshold float64) []string
FindRelevantChunks retrieves the relevant code chunks from the embedding store based on a similarity threshold.
func (*EmbeddingStore) FindThresholdByModel ¶
func (store *EmbeddingStore) FindThresholdByModel(modelName string) float64
Click to show internal directories.
Click to hide internal directories.