-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add CassandraGraphVectorStoreComponent and HtmlLinkExtractorComponent #3757
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
"Could not import cassio integration package. " "Please install it with `pip install cassio`." | ||
) | ||
|
||
from uuid import UUID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe could be a global import, if only just for the sanity check that uuid is available at component load time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uuid
is built-in so it will always be available.
I don't mind making it a global import. This part of code was copy/pasted from CassandraVectorStoreComponent
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# use a copy because we can't change the type of the parameter | ||
database_ref = self.database_ref.split(",") | ||
|
||
if is_astra: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to add an unnecessary complication but does it make sense to have a specific AstraDBGraphVectorStore in the way we have a separate AstraDBVectorStore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the CassandraGraphVectorStore is CQL based, and AstraDBVectorStore is dataAPI based.
We are independently working on a AstraDBGraphVectorStore that is dataAPI based.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fantastic, two minor comments
from langflow.custom import Component | ||
from langflow.io import Output | ||
from langflow.schema import Data | ||
from langflow.utils.util import build_loader_repr_from_data | ||
|
||
|
||
class LCTextSplitterComponent(Component): | ||
class LCTextSplitterComponent(LCDocumentTransformerComponent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any risks to this change for other flows that use the LCTextSplitterComponent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. I don't see what could go wrong but...
fe5ff67
to
b0002a8
Compare
This commit adds the CalculatorToolComponent to the langflow/components/tools directory. The CalculatorToolComponent allows users to perform basic arithmetic operations on a given expression. It includes an input for the expression and returns the result or an error message. Ref: #3757
* feat: Add CalculatorToolComponent to langflow/components/tools This commit adds the CalculatorToolComponent to the langflow/components/tools directory. The CalculatorToolComponent allows users to perform basic arithmetic operations on a given expression. It includes an input for the expression and returns the result or an error message. Ref: #3757 * lint * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This adds:
CassandraGraphVectorStoreComponent
: a component available as "Cassandra Graph" under "Vector stores". This is a wrapper around LangChain'sCassandraGraphVectorStore
.CassandraGraphVectorStore
is an implementation ofGraphVectorStore
that is a hybrid vector and graph store. See https://python.langchain.com/v0.2/api_reference/community/graph_vectorstores.htmlHtmlLinkExtractorComponent
: a component that appears under "Link Extractors". It wraps LangChain'sHtmlLinkExtractor
. See https://python.langchain.com/v0.2/api_reference/community/graph_vectorstores/langchain_community.graph_vectorstores.extractors.html_link_extractor.HtmlLinkExtractor.html#how-to-link-documents-on-hyperlinks-in-htmlLCDocumentTransformerComponent
: an abstract component for LangChain'sBaseDocumentTransformer
.LCTextSplitterComponent
andHtmlLinkExtractorComponent
are made child classes ofLCDocumentTransformerComponent
.