fix: update vector RAG flow for Astra DB comp changes (#5006)

This commit is contained in:
Eric Hare 2024-12-02 12:11:44 -08:00 committed by GitHub
commit 7a74c01a4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1358 additions and 1307 deletions

View file

@ -113,7 +113,15 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
required=True,
real_time_refresh=True,
refresh_button=True,
options=[],
options=["+ Create new collection"],
value="+ Create new collection",
),
StrInput(
name="collection_name_new",
display_name="Collection Name",
info="Name of the new collection to create.",
advanced=False,
required=True,
),
StrInput(
name="keyspace",
@ -339,13 +347,8 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
build_config["embedding_choice"]["advanced"] = False
build_config["embedding_choice"]["value"] = "Embedding Model"
new_parameter = StrInput(
name="collection_name_new",
display_name="Collection Name",
required=True,
).to_dict()
self.insert_in_dict(build_config, "embedding_choice", {"collection_name_new": new_parameter})
build_config["collection_name_new"]["advanced"] = False
build_config["collection_name_new"]["required"] = True
new_parameter = HandleInput(
name="embedding_model",
@ -356,7 +359,9 @@ class AstraDBVectorStoreComponent(LCVectorStoreComponent):
self.insert_in_dict(build_config, "collection_name_new", {"embedding_model": new_parameter})
elif field_name == "collection_name" and field_value != "+ Create new collection":
self.del_fields(build_config, ["collection_name_new"])
build_config["collection_name_new"]["advanced"] = True
build_config["collection_name_new"]["required"] = False
build_config["collection_name_new"]["value"] = ""
# Get the collection options
collection_options = self.get_collection_options()

File diff suppressed because one or more lines are too long