♻️ (Qdrant.py): refactor QdrantComponent class to improve code readability and maintainability by reordering and organizing the initialization parameters.
This commit is contained in:
parent
f9026ba8f6
commit
642acf8172
1 changed files with 4 additions and 5 deletions
|
|
@ -67,22 +67,19 @@ class QdrantComponent(CustomComponent):
|
|||
documents.append(_input.to_lc_document())
|
||||
else:
|
||||
documents.append(_input)
|
||||
if documents is None:
|
||||
if not documents:
|
||||
from qdrant_client import QdrantClient
|
||||
|
||||
client = QdrantClient(
|
||||
location=location,
|
||||
url=host,
|
||||
url=url,
|
||||
port=port,
|
||||
grpc_port=grpc_port,
|
||||
https=https,
|
||||
prefix=prefix,
|
||||
timeout=timeout,
|
||||
prefer_grpc=prefer_grpc,
|
||||
metadata_payload_key=metadata_payload_key,
|
||||
content_payload_key=content_payload_key,
|
||||
api_key=api_key,
|
||||
collection_name=collection_name,
|
||||
host=host,
|
||||
path=path,
|
||||
)
|
||||
|
|
@ -90,6 +87,8 @@ class QdrantComponent(CustomComponent):
|
|||
client=client,
|
||||
collection_name=collection_name,
|
||||
embeddings=embedding,
|
||||
content_payload_key=content_payload_key,
|
||||
metadata_payload_key=metadata_payload_key,
|
||||
)
|
||||
return vs
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue