Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 13, 2024
1 parent 551e731 commit 50fe934
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/backend/base/langflow/components/vectorstores/astradb.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,20 +375,24 @@ def update_build_config(self, build_config: dict, field_value: str, field_name:
is_new_collection = field_value == "+ Create new collection"

# Set the advanced and required fields based on the collection choice
build_config["embedding_choice"].update({
"advanced": not is_new_collection,
"value": "Embedding Model" if is_new_collection else build_config["embedding_choice"].get("value"),
})
build_config["embedding_choice"].update(
{
"advanced": not is_new_collection,
"value": "Embedding Model" if is_new_collection else build_config["embedding_choice"].get("value"),
}
)

# Set the advanced field for the embedding model
build_config["embedding_model"]["advanced"] = not is_new_collection

# Set the advanced and required fields for the new collection name
build_config["collection_name_new"].update({
"advanced": not is_new_collection,
"required": is_new_collection,
"value": "" if not is_new_collection else build_config["collection_name_new"].get("value"),
})
build_config["collection_name_new"].update(
{
"advanced": not is_new_collection,
"required": is_new_collection,
"value": "" if not is_new_collection else build_config["collection_name_new"].get("value"),
}
)

# Get the collection options for the selected collection
collection_options = self.get_collection_options()
Expand Down Expand Up @@ -642,7 +646,7 @@ def build_vector_store(self, vectorize_options=None):
z_01_model_parameters=getattr(self, "z_01_model_parameters", None) or None,
z_02_api_key_name=getattr(self, "z_02_api_key_name", None) or None,
z_03_provider_api_key=getattr(self, "z_03_provider_api_key", None) or None,
z_04_authentication=getattr(self, "z_04_authentication", {}) or {}
z_04_authentication=getattr(self, "z_04_authentication", {}) or {},
)

# Set the embedding dictionary
Expand Down

0 comments on commit 50fe934

Please sign in to comment.