Fix documentation link and code formatting

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-15 16:53:45 -03:00
commit 25774265d3
6 changed files with 32 additions and 27 deletions

View file

@ -6,9 +6,7 @@ from langchain_community.embeddings.huggingface import HuggingFaceInferenceAPIEm
class HuggingFaceInferenceAPIEmbeddingsComponent(CustomComponent):
display_name = "HuggingFaceInferenceAPIEmbeddings"
description = "HuggingFace sentence_transformers embedding models, API version."
documentation = (
"https://github.com/huggingface/text-embeddings-inference"
)
documentation = "https://github.com/huggingface/text-embeddings-inference"
def build_config(self):
return {

View file

@ -56,9 +56,10 @@ class QdrantComponent(CustomComponent):
) -> Union[VectorStore, Qdrant, BaseRetriever]:
if documents is None:
from qdrant_client import QdrantClient
client = QdrantClient(
location=location,
url=host,
url=host,
port=port,
grpc_port=grpc_port,
https=https,
@ -71,13 +72,14 @@ class QdrantComponent(CustomComponent):
collection_name=collection_name,
host=host,
path=path,
)
vs = Qdrant(client=client,
collection_name=collection_name,
embeddings=embedding,
search_kwargs=search_kwargs,
distance_func=distance_func,
)
)
vs = Qdrant(
client=client,
collection_name=collection_name,
embeddings=embedding,
search_kwargs=search_kwargs,
distance_func=distance_func,
)
return vs
else:
vs = Qdrant.from_documents(
@ -99,5 +101,5 @@ class QdrantComponent(CustomComponent):
search_kwargs=search_kwargs,
timeout=timeout,
url=url,
)
)
return vs

View file

@ -7,8 +7,6 @@ from loguru import logger
from langflow.api.v1.callback import AsyncStreamingLLMCallbackHandler, StreamingLLMCallbackHandler
from langflow.processing.process import fix_memory_inputs, format_actions
from langflow.services.deps import get_plugins_service
from langflow.processing.process import fix_memory_inputs, format_actions
from langflow.services.deps import get_plugins_service
if TYPE_CHECKING:
from langfuse.callback import CallbackHandler # type: ignore