refactor: Rename SplitContentComponent to SplitTextComponent and update related variables and descriptions
This commit is contained in:
parent
f3cb8c81b0
commit
babe7ff1ac
20 changed files with 368 additions and 93 deletions
|
|
@ -4,10 +4,12 @@ from .ExtractKeyFromData import ExtractKeyFromDataComponent
|
|||
from .FlowTool import FlowToolComponent
|
||||
from .Listen import ListenComponent
|
||||
from .ListFlows import ListFlowsComponent
|
||||
from .MergeData import MergeDataComponent
|
||||
from .Notify import NotifyComponent
|
||||
from .PythonFunction import PythonFunctionComponent
|
||||
from .RunFlow import RunFlowComponent
|
||||
from .RunnableExecutor import RunnableExecComponent
|
||||
from .SplitText import SplitTextComponent
|
||||
from .SQLExecutor import SQLExecutorComponent
|
||||
from .SubFlow import SubFlowComponent
|
||||
|
||||
|
|
@ -21,10 +23,9 @@ __all__ = [
|
|||
"MergeDataComponent",
|
||||
"NotifyComponent",
|
||||
"PythonFunctionComponent",
|
||||
"PythonFunctionComponent",
|
||||
"RunFlowComponent",
|
||||
"RunnableExecComponent",
|
||||
"SplitTextComponent",
|
||||
"SQLExecutorComponent",
|
||||
"SubFlowComponent",
|
||||
"SplitContentComponent",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@ class ParseDataComponent(Component):
|
|||
icon = "braces"
|
||||
|
||||
inputs = [
|
||||
HandleInput(
|
||||
name="data", display_name="Data", info="The data to convert to text.", input_types=["Data"]
|
||||
),
|
||||
HandleInput(name="data", display_name="Data", info="The data to convert to text.", input_types=["Data"]),
|
||||
MultilineInput(
|
||||
name="template",
|
||||
display_name="Template",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ from langflow.inputs import MessageInput
|
|||
from langflow.template import Output
|
||||
|
||||
|
||||
|
||||
class AmazonBedrockComponent(LCModelComponent):
|
||||
display_name: str = "Amazon Bedrock"
|
||||
description: str = "Generate text using Amazon Bedrock LLMs."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from langchain_anthropic.chat_models import ChatAnthropic
|
||||
from pydantic.v1 import SecretStr
|
||||
|
||||
|
|
@ -15,10 +14,7 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
icon = "Anthropic"
|
||||
|
||||
inputs = [
|
||||
StrInput(
|
||||
name="input_value",
|
||||
display_name="Input",
|
||||
input_types=["Text", "Data", "Prompt", "Message"]),
|
||||
StrInput(name="input_value", display_name="Input", input_types=["Text", "Data", "Prompt", "Message"]),
|
||||
IntInput(
|
||||
name="max_tokens",
|
||||
display_name="Max Tokens",
|
||||
|
|
@ -30,7 +26,7 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
display_name="Model Name",
|
||||
options=[
|
||||
"claude-3-opus-20240229",
|
||||
"claude-3-sonnet-20240229",
|
||||
"claude-3-sonnet-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
"claude-2.1",
|
||||
"claude-2.0",
|
||||
|
|
@ -105,4 +101,3 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
raise ValueError("Could not connect to Anthropic API.") from e
|
||||
|
||||
return output
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ from langflow.field_typing import BaseLanguageModel, Text
|
|||
from langflow.inputs import BoolInput, FloatInput, SecretStrInput, StrInput
|
||||
from langflow.template import Output
|
||||
|
||||
|
||||
class QianfanChatEndpointComponent(LCModelComponent):
|
||||
display_name: str = "Qianfan"
|
||||
description: str = "Generate text using Baidu Qianfan LLMs."
|
||||
|
|
@ -120,4 +121,4 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
except Exception as e:
|
||||
raise ValueError("Could not connect to Baidu Qianfan API.") from e
|
||||
|
||||
return output
|
||||
return output
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from langchain_groq import ChatGroq
|
||||
from langflow.base.models.groq_constants import MODEL_NAMES
|
||||
from pydantic.v1 import SecretStr
|
||||
|
|
@ -8,6 +7,7 @@ from langflow.field_typing import BaseLanguageModel, Text
|
|||
from langflow.inputs import BoolInput, FloatInput, IntInput, SecretStrInput, StrInput, DropdownInput
|
||||
from langflow.template import Output
|
||||
|
||||
|
||||
class GroqModel(LCModelComponent):
|
||||
display_name: str = "Groq"
|
||||
description: str = "Generate text using Groq."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
from langchain_community.chat_models import ChatOllama
|
||||
from langflow.base.constants import STREAM_INFO_TEXT
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
|
|
@ -6,6 +5,7 @@ from langflow.field_typing import BaseLanguageModel, Text
|
|||
from langflow.inputs import BoolInput, DictInput, DropdownInput, FloatInput, IntInput, StrInput
|
||||
from langflow.template import Output
|
||||
|
||||
|
||||
class ChatOllamaComponent(LCModelComponent):
|
||||
display_name = "Ollama"
|
||||
description = "Generate text using Ollama Local LLMs."
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.field_typing import Text
|
||||
from langflow.inputs import (
|
||||
StrInput,
|
||||
IntInput,
|
||||
|
|
@ -10,10 +9,10 @@ from langflow.inputs import (
|
|||
)
|
||||
from langflow.schema import Data
|
||||
from langflow.template import Output
|
||||
from langflow.field_typing import Embeddings
|
||||
|
||||
from loguru import logger
|
||||
|
||||
|
||||
class AstraVectorStoreComponent(Component):
|
||||
display_name: str = "Astra DB Vector Store"
|
||||
description: str = "Implementation of Vector Store using Astra DB with search capabilities"
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
from typing import Any, List, Optional, Tuple
|
||||
from typing import List
|
||||
|
||||
from langchain_community.utilities.cassandra import SetupMode
|
||||
from langchain_community.vectorstores import Cassandra
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.schema import BaseRetriever
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.field_typing import Embeddings, Text
|
||||
from langflow.schema import Data
|
||||
from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput, DropdownInput
|
||||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class CassandraVectorStoreComponent(Component):
|
||||
display_name = "Cassandra"
|
||||
description = "Cassandra Vector Store with search capabilities"
|
||||
|
|
@ -19,24 +17,83 @@ class CassandraVectorStoreComponent(Component):
|
|||
icon = "Cassandra"
|
||||
|
||||
inputs = [
|
||||
StrInput(name="token", display_name="Token", info="Authentication token for accessing Cassandra on Astra DB.", password=True, required=True),
|
||||
StrInput(
|
||||
name="token",
|
||||
display_name="Token",
|
||||
info="Authentication token for accessing Cassandra on Astra DB.",
|
||||
password=True,
|
||||
required=True,
|
||||
),
|
||||
StrInput(name="database_id", display_name="Database ID", info="The Astra database ID.", required=True),
|
||||
StrInput(name="table_name", display_name="Table Name", info="The name of the table where vectors will be stored.", required=True),
|
||||
StrInput(name="keyspace", display_name="Keyspace", info="Optional key space within Astra DB. The keyspace should already be created.", advanced=True),
|
||||
IntInput(name="ttl_seconds", display_name="TTL Seconds", info="Optional time-to-live for the added texts.", advanced=True),
|
||||
IntInput(name="batch_size", display_name="Batch Size", info="Optional number of data to process in a single batch.", value=16, advanced=True),
|
||||
StrInput(name="body_index_options", display_name="Body Index Options", info="Optional options used to create the body index.", advanced=True),
|
||||
DropdownInput(name="setup_mode", display_name="Setup Mode", info="Configuration mode for setting up the Cassandra table, with options like 'Sync', 'Async', or 'Off'.", options=["Sync", "Async", "Off"], value="Sync", advanced=True),
|
||||
StrInput(
|
||||
name="table_name",
|
||||
display_name="Table Name",
|
||||
info="The name of the table where vectors will be stored.",
|
||||
required=True,
|
||||
),
|
||||
StrInput(
|
||||
name="keyspace",
|
||||
display_name="Keyspace",
|
||||
info="Optional key space within Astra DB. The keyspace should already be created.",
|
||||
advanced=True,
|
||||
),
|
||||
IntInput(
|
||||
name="ttl_seconds",
|
||||
display_name="TTL Seconds",
|
||||
info="Optional time-to-live for the added texts.",
|
||||
advanced=True,
|
||||
),
|
||||
IntInput(
|
||||
name="batch_size",
|
||||
display_name="Batch Size",
|
||||
info="Optional number of data to process in a single batch.",
|
||||
value=16,
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(
|
||||
name="body_index_options",
|
||||
display_name="Body Index Options",
|
||||
info="Optional options used to create the body index.",
|
||||
advanced=True,
|
||||
),
|
||||
DropdownInput(
|
||||
name="setup_mode",
|
||||
display_name="Setup Mode",
|
||||
info="Configuration mode for setting up the Cassandra table, with options like 'Sync', 'Async', or 'Off'.",
|
||||
options=["Sync", "Async", "Off"],
|
||||
value="Sync",
|
||||
advanced=True,
|
||||
),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=Cassandra),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class CouchbaseVectorStoreComponent(Component):
|
||||
display_name = "Couchbase"
|
||||
description = "Couchbase Vector Store with search capabilities"
|
||||
|
|
@ -25,15 +26,40 @@ class CouchbaseVectorStoreComponent(Component):
|
|||
StrInput(name="collection_name", display_name="Collection Name", required=True),
|
||||
StrInput(name="index_name", display_name="Index Name", required=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=CouchbaseVectorStore),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Vector Store",
|
||||
name="vector_store",
|
||||
method="build_vector_store",
|
||||
output_type=CouchbaseVectorStore,
|
||||
),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
from copy import deepcopy
|
||||
from typing import List, Optional, Union
|
||||
from typing import List
|
||||
|
||||
from langchain.vectorstores import FAISS
|
||||
from langchain.embeddings.base import Embeddings
|
||||
from langchain.schema import BaseRetriever
|
||||
|
||||
from langflow.custom import Component
|
||||
|
|
@ -36,9 +34,7 @@ class FaissVectorStoreComponent(Component):
|
|||
display_name="Index Name",
|
||||
value="langflow_index",
|
||||
),
|
||||
HandleInput(
|
||||
name="embedding", display_name="Embedding", input_types=["Embeddings"]
|
||||
),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
StrInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
|
|
@ -163,11 +159,7 @@ class FaissVectorStoreComponent(Component):
|
|||
logger.debug(f"Search input: {self.search_input}")
|
||||
logger.debug(f"Number of results: {self.number_of_results}")
|
||||
|
||||
if (
|
||||
self.search_input
|
||||
and isinstance(self.search_input, str)
|
||||
and self.search_input.strip()
|
||||
):
|
||||
if self.search_input and isinstance(self.search_input, str) and self.search_input.strip():
|
||||
docs = vector_store.similarity_search(
|
||||
query=self.search_input,
|
||||
k=self.number_of_results,
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class MongoVectorStoreComponent(Component):
|
||||
display_name = "MongoDB Atlas"
|
||||
description = "MongoDB Atlas Vector Store with search capabilities"
|
||||
|
|
@ -21,15 +22,40 @@ class MongoVectorStoreComponent(Component):
|
|||
StrInput(name="collection_name", display_name="Collection Name", required=True),
|
||||
StrInput(name="index_name", display_name="Index Name", required=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=MongoDBAtlasVectorSearch),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Vector Store",
|
||||
name="vector_store",
|
||||
method="build_vector_store",
|
||||
output_type=MongoDBAtlasVectorSearch,
|
||||
),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput, Dropdown
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class PineconeVectorStoreComponent(Component):
|
||||
display_name = "Pinecone"
|
||||
description = "Pinecone Vector Store with search capabilities"
|
||||
|
|
@ -18,19 +19,51 @@ class PineconeVectorStoreComponent(Component):
|
|||
inputs = [
|
||||
StrInput(name="index_name", display_name="Index Name", required=True),
|
||||
StrInput(name="namespace", display_name="Namespace", info="Namespace for the index."),
|
||||
DropdownInput(name="distance_strategy", display_name="Distance Strategy", options=["Cosine", "Euclidean", "Dot Product"], value="Cosine", advanced=True),
|
||||
DropdownInput(
|
||||
name="distance_strategy",
|
||||
display_name="Distance Strategy",
|
||||
options=["Cosine", "Euclidean", "Dot Product"],
|
||||
value="Cosine",
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(name="pinecone_api_key", display_name="Pinecone API Key", password=True, required=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
StrInput(name="text_key", display_name="Text Key", info="Key in the record to use as text.", value="text", advanced=True),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
StrInput(
|
||||
name="text_key",
|
||||
display_name="Text Key",
|
||||
info="Key in the record to use as text.",
|
||||
value="text",
|
||||
advanced=True,
|
||||
),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=Pinecone),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput, Dropdown
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class QdrantVectorStoreComponent(Component):
|
||||
display_name = "Qdrant"
|
||||
description = "Qdrant Vector Store with search capabilities"
|
||||
|
|
@ -25,19 +26,45 @@ class QdrantVectorStoreComponent(Component):
|
|||
IntInput(name="timeout", display_name="Timeout", advanced=True),
|
||||
StrInput(name="path", display_name="Path", advanced=True),
|
||||
StrInput(name="url", display_name="URL", advanced=True),
|
||||
DropdownInput(name="distance_func", display_name="Distance Function", options=["Cosine", "Euclidean", "Dot Product"], value="Cosine", advanced=True),
|
||||
DropdownInput(
|
||||
name="distance_func",
|
||||
display_name="Distance Function",
|
||||
options=["Cosine", "Euclidean", "Dot Product"],
|
||||
value="Cosine",
|
||||
advanced=True,
|
||||
),
|
||||
StrInput(name="content_payload_key", display_name="Content Payload Key", value="page_content", advanced=True),
|
||||
StrInput(name="metadata_payload_key", display_name="Metadata Payload Key", value="metadata", advanced=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=Qdrant),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
@ -79,10 +106,7 @@ class QdrantVectorStoreComponent(Component):
|
|||
|
||||
if documents:
|
||||
qdrant = Qdrant.from_documents(
|
||||
documents,
|
||||
embedding=self.embedding,
|
||||
client_kwargs=server_kwargs,
|
||||
**qdrant_kwargs
|
||||
documents, embedding=self.embedding, client_kwargs=server_kwargs, **qdrant_kwargs
|
||||
)
|
||||
else:
|
||||
from qdrant_client import QdrantClient
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.inputs import IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class SupabaseVectorStoreComponent(Component):
|
||||
display_name = "Supabase"
|
||||
description = "Supabase Vector Store with search capabilities"
|
||||
|
|
@ -22,14 +23,35 @@ class SupabaseVectorStoreComponent(Component):
|
|||
StrInput(name="table_name", display_name="Table Name", advanced=True),
|
||||
StrInput(name="query_name", display_name="Query Name"),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=SupabaseVectorStore),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Vector Store",
|
||||
name="vector_store",
|
||||
method="build_vector_store",
|
||||
output_type=SupabaseVectorStore,
|
||||
),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class UpstashVectorStoreComponent(Component):
|
||||
display_name = "Upstash"
|
||||
description = "Upstash Vector Store with search capabilities"
|
||||
|
|
@ -17,18 +18,56 @@ class UpstashVectorStoreComponent(Component):
|
|||
|
||||
inputs = [
|
||||
StrInput(name="index_url", display_name="Index URL", info="The URL of the Upstash index.", required=True),
|
||||
StrInput(name="index_token", display_name="Index Token", info="The token for the Upstash index.", required=True),
|
||||
StrInput(name="text_key", display_name="Text Key", info="The key in the record to use as text.", value="text", advanced=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"], info="To use Upstash's embeddings, don't provide an embedding."),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
StrInput(
|
||||
name="index_token", display_name="Index Token", info="The token for the Upstash index.", required=True
|
||||
),
|
||||
StrInput(
|
||||
name="text_key",
|
||||
display_name="Text Key",
|
||||
info="The key in the record to use as text.",
|
||||
value="text",
|
||||
advanced=True,
|
||||
),
|
||||
HandleInput(
|
||||
name="embedding",
|
||||
display_name="Embedding",
|
||||
input_types=["Embeddings"],
|
||||
info="To use Upstash's embeddings, don't provide an embedding.",
|
||||
),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=UpstashVectorStore),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Vector Store",
|
||||
name="vector_store",
|
||||
method="build_vector_store",
|
||||
output_type=UpstashVectorStore,
|
||||
),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class VectaraVectorStoreComponent(Component):
|
||||
display_name = "Vectara"
|
||||
description = "Vectara Vector Store with search capabilities"
|
||||
|
|
@ -20,15 +21,35 @@ class VectaraVectorStoreComponent(Component):
|
|||
StrInput(name="vectara_customer_id", display_name="Vectara Customer ID", required=True),
|
||||
StrInput(name="vectara_corpus_id", display_name="Vectara Corpus ID", required=True),
|
||||
StrInput(name="vectara_api_key", display_name="Vectara API Key", password=True, required=True),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=Vectara),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class WeaviateVectorStoreComponent(Component):
|
||||
display_name = "Weaviate"
|
||||
description = "Weaviate Vector Store with search capabilities"
|
||||
|
|
@ -22,16 +23,36 @@ class WeaviateVectorStoreComponent(Component):
|
|||
StrInput(name="index_name", display_name="Index Name", required=True),
|
||||
StrInput(name="text_key", display_name="Text Key", value="text", advanced=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
BoolInput(name="search_by_text", display_name="Search By Text", advanced=True),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=Weaviate),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.inputs import BoolInput, IntInput, StrInput, HandleInput
|
|||
from langflow.template import Output
|
||||
from langflow.helpers.data import docs_to_data
|
||||
|
||||
|
||||
class PGVectorStoreComponent(Component):
|
||||
display_name = "PGVector"
|
||||
description = "PGVector Vector Store with search capabilities"
|
||||
|
|
@ -19,15 +20,35 @@ class PGVectorStoreComponent(Component):
|
|||
StrInput(name="pg_server_url", display_name="PostgreSQL Server Connection String", required=True),
|
||||
StrInput(name="collection_name", display_name="Table", required=True),
|
||||
HandleInput(name="embedding", display_name="Embedding", input_types=["Embeddings"]),
|
||||
HandleInput(name="vector_store_inputs", display_name="Vector Store Inputs", input_types=["Document", "Data"], is_list=True),
|
||||
BoolInput(name="add_to_vector_store", display_name="Add to Vector Store", info="If true, the Vector Store Inputs will be added to the Vector Store."),
|
||||
HandleInput(
|
||||
name="vector_store_inputs",
|
||||
display_name="Vector Store Inputs",
|
||||
input_types=["Document", "Data"],
|
||||
is_list=True,
|
||||
),
|
||||
BoolInput(
|
||||
name="add_to_vector_store",
|
||||
display_name="Add to Vector Store",
|
||||
info="If true, the Vector Store Inputs will be added to the Vector Store.",
|
||||
),
|
||||
StrInput(name="search_input", display_name="Search Input"),
|
||||
IntInput(name="number_of_results", display_name="Number of Results", info="Number of results to return.", value=4, advanced=True),
|
||||
IntInput(
|
||||
name="number_of_results",
|
||||
display_name="Number of Results",
|
||||
info="Number of results to return.",
|
||||
value=4,
|
||||
advanced=True,
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Vector Store", name="vector_store", method="build_vector_store", output_type=PGVector),
|
||||
Output(display_name="Base Retriever", name="base_retriever", method="build_base_retriever", output_type=BaseRetriever),
|
||||
Output(
|
||||
display_name="Base Retriever",
|
||||
name="base_retriever",
|
||||
method="build_base_retriever",
|
||||
output_type=BaseRetriever,
|
||||
),
|
||||
Output(display_name="Search Results", name="search_results", method="search_documents"),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue