Skip to content
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(Weaviate): Enforce capitalized index name #3791

Merged
merged 18 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8feaa3b
feat(Weaviate): Enforce capitalized index name
edwinjosechittilappilly Sep 12, 2024
dcdf405
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 12, 2024
8035778
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 13, 2024
9a4ad06
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 18, 2024
f7f330a
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 20, 2024
ab7a210
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 20, 2024
9ef84d6
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 27, 2024
0e91131
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 27, 2024
5a699cc
updated the component
edwinjosechittilappilly Sep 27, 2024
4ea1f3f
Merge branch 'fix-weaviate-index-name' of https://github.com/langflow…
edwinjosechittilappilly Sep 27, 2024
eca1511
Update Weaviate.py
edwinjosechittilappilly Sep 27, 2024
9f18536
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 27, 2024
311df54
Lint error solved
edwinjosechittilappilly Sep 27, 2024
d550e14
Merge branch 'fix-weaviate-index-name' of https://github.com/langflow…
edwinjosechittilappilly Sep 27, 2024
6699c3f
Code corrections discarded unwanted validate functions
edwinjosechittilappilly Sep 30, 2024
b56e98c
Merge branch 'main' into fix-weaviate-index-name
edwinjosechittilappilly Sep 30, 2024
52f15a8
Update Weaviate.py
edwinjosechittilappilly Sep 30, 2024
7cf57c0
Merge branch 'main' into fix-weaviate-index-name
ogabrielluiz Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/backend/base/langflow/components/vectorstores/Weaviate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import weaviate # type: ignore
import weaviate
from langchain_community.vectorstores import Weaviate

from langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store
Expand All @@ -17,7 +17,12 @@ class WeaviateVectorStoreComponent(LCVectorStoreComponent):
inputs = [
StrInput(name="url", display_name="Weaviate URL", value="http://localhost:8080", required=True),
SecretStrInput(name="api_key", display_name="API Key", required=False),
StrInput(name="index_name", display_name="Index Name", required=True),
StrInput(
name="index_name",
display_name="Index Name",
required=True,
info="Requires capitalized index name.",
),
StrInput(name="text_key", display_name="Text Key", value="text", advanced=True),
MultilineInput(name="search_query", display_name="Search Query"),
DataInput(
Expand All @@ -44,6 +49,9 @@ def build_vector_store(self) -> Weaviate:
else:
client = weaviate.Client(url=self.url)

if self.index_name != self.index_name.capitalize():
raise ValueError(f"Weaviate requires the index name to be capitalized. Use: {self.index_name.capitalize()}")

documents = []
for _input in self.ingest_data or []:
if isinstance(_input, Data):
Expand Down