Skip to content

Commit

Permalink
feat: 修改bisheng_retriever对象类型 (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 26, 2024
2 parents 8a32f0d + 0feab28 commit c450e86
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import yaml
import httpx
from typing import Any, Dict, Tuple, Type, Union, Optional

from langchain_core.vectorstores import VectorStoreRetriever
from loguru import logger
from langchain_core.tools import BaseTool, Tool
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
Expand Down Expand Up @@ -73,7 +75,11 @@ def __init__(

# init milvus
if vector_store:
self.vector_store = vector_store
# if vector_store is retriever, get vector_store instance
if isinstance(vector_store, VectorStoreRetriever):
self.vector_store = vector_store.vectorstore
else:
self.vector_store = vector_store
else:
# init embeddings
embedding_params = self.params['embedding']
Expand Down

0 comments on commit c450e86

Please sign in to comment.