cc.unitmesh.store.MilvusEmbeddingStore.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of store-milvus Show documentation
Show all versions of store-milvus Show documentation
Chocolate Factory is a cutting-edge LLM toolkit designed to empower you in creating your very own AI assistant.
The newest version!
package cc.unitmesh.store
import cc.unitmesh.nlp.embedding.Embedding
import cc.unitmesh.rag.document.Document
import cc.unitmesh.rag.store.EmbeddingMatch
import cc.unitmesh.rag.store.EmbeddingStore
import io.milvus.client.MilvusServiceClient
import io.milvus.param.ConnectParam
/**
* The MilvusEmbeddingStore class is an implementation of the EmbeddingStore interface that
* provides functionality to store and retrieve embeddings using the Milvus service.
*
* @property host The host address of the Milvus service. Default value is "localhost".
* @property port The port number of the Milvus service. Default value is 19530.
* @property indexName The name of the index used for storing embeddings. Default value is "chocolate-code".
* @property client The MilvusServiceClient instance used for communication with the Milvus service.
*
*/
class MilvusEmbeddingStore(
private val host: String = "localhost",
private val port: Int = 19530,
private val indexName: String = "chocolate-code",
) : EmbeddingStore {
private var client: MilvusServiceClient
init {
val param = ConnectParam.newBuilder()
.withHost("localhost")
.withPort(19530)
.build()
client = MilvusServiceClient(param)
}
override fun add(embedding: Embedding): String {
TODO("Not yet implemented")
}
override fun add(id: String, embedding: Embedding) {
TODO("Not yet implemented")
}
override fun addAll(embeddings: List): List {
TODO("Not yet implemented")
}
override fun findRelevant(
referenceEmbedding: Embedding,
maxResults: Int,
minScore: Double,
): List> {
TODO("Not yet implemented")
}
override fun addAll(embeddings: List, embedded: List): List {
TODO("Not yet implemented")
}
override fun add(embedding: Embedding, embedded: Document): String {
TODO("Not yet implemented")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy