♻️ (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())
|
documents.append(_input.to_lc_document())
|
||||||
else:
|
else:
|
||||||
documents.append(_input)
|
documents.append(_input)
|
||||||
if documents is None:
|
if not documents:
|
||||||
from qdrant_client import QdrantClient
|
from qdrant_client import QdrantClient
|
||||||
|
|
||||||
client = QdrantClient(
|
client = QdrantClient(
|
||||||
location=location,
|
location=location,
|
||||||
url=host,
|
url=url,
|
||||||
port=port,
|
port=port,
|
||||||
grpc_port=grpc_port,
|
grpc_port=grpc_port,
|
||||||
https=https,
|
https=https,
|
||||||
prefix=prefix,
|
prefix=prefix,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
prefer_grpc=prefer_grpc,
|
prefer_grpc=prefer_grpc,
|
||||||
metadata_payload_key=metadata_payload_key,
|
|
||||||
content_payload_key=content_payload_key,
|
|
||||||
api_key=api_key,
|
api_key=api_key,
|
||||||
collection_name=collection_name,
|
|
||||||
host=host,
|
host=host,
|
||||||
path=path,
|
path=path,
|
||||||
)
|
)
|
||||||
|
|
@ -90,6 +87,8 @@ class QdrantComponent(CustomComponent):
|
||||||
client=client,
|
client=client,
|
||||||
collection_name=collection_name,
|
collection_name=collection_name,
|
||||||
embeddings=embedding,
|
embeddings=embedding,
|
||||||
|
content_payload_key=content_payload_key,
|
||||||
|
metadata_payload_key=metadata_payload_key,
|
||||||
)
|
)
|
||||||
return vs
|
return vs
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue