mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 13:22:39 +02:00
Update pre-commit's error
This commit is contained in:
parent
b43429ecc4
commit
ceccd660df
6 changed files with 10 additions and 7 deletions
|
|
@ -30,7 +30,7 @@ class RAGIndexFactory(ConfigBasedFactory):
|
|||
BM25IndexConfig: self._create_bm25,
|
||||
ElasticsearchIndexConfig: self._create_es,
|
||||
ElasticsearchKeywordIndexConfig: self._create_es,
|
||||
MilvusIndexConfig: self._create_milvus
|
||||
MilvusIndexConfig: self._create_milvus,
|
||||
}
|
||||
super().__init__(creators)
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,9 @@ class RetrieverFactory(ConfigBasedFactory):
|
|||
|
||||
@get_or_build_index
|
||||
def _build_milvus_index(self, config: MilvusRetrieverConfig, **kwargs) -> VectorStoreIndex:
|
||||
vector_store = MilvusVectorStore(uri=config.uri, collection_name=config.collection_name, token=config.token, dim=config.dimensions)
|
||||
vector_store = MilvusVectorStore(
|
||||
uri=config.uri, collection_name=config.collection_name, token=config.token, dim=config.dimensions
|
||||
)
|
||||
|
||||
return self._build_index_from_vector_store(config, vector_store, **kwargs)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ class MilvusRetriever(VectorIndexRetriever):
|
|||
def persist(self, persist_dir: str, **kwargs) -> None:
|
||||
"""Support persist.
|
||||
|
||||
Milvus automatically saves, so there is no need to implement."""
|
||||
Milvus automatically saves, so there is no need to implement."""
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from llama_index.core.embeddings import BaseEmbedding
|
|||
from llama_index.core.indices.base import BaseIndex
|
||||
from llama_index.core.schema import TextNode
|
||||
from llama_index.core.vector_stores.types import VectorStoreQueryMode
|
||||
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, model_validator, validator
|
||||
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, model_validator
|
||||
|
||||
from metagpt.config2 import config
|
||||
from metagpt.configs.embedding_config import EmbeddingType
|
||||
|
|
@ -199,6 +199,7 @@ class ChromaIndexConfig(VectorIndexConfig):
|
|||
default=None, description="Optional metadata to associate with the collection"
|
||||
)
|
||||
|
||||
|
||||
class MilvusIndexConfig(VectorIndexConfig):
|
||||
"""Config for milvus-based index."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue