langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, model and vector store agnostic.

Home Page:http://www.langflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encountering error in building ASTRA DB Search node in the canvas. Error Building Component Error building Component Astra DB Search: Invalid inputs provided.

opened this issue · comments

This bug is currently occurring in latest version of 1.0-alpha.

The bug is if i build my flow in the langflow the node of the astra db search says,

Error Building Component
Error building Component Astra DB Search: Invalid inputs provided.

The astra db node on the canvas is connected to the chat input and in that i give a simple message.

Browser and Version

  • Browser [chrome]
  • Version [22]

To Reproduce
Steps to reproduce the behavior:

  1. Create new project and import the given json file.
    Untitled document.json
  2. Enter the required credentials from the astra db and azure openai
  3. Send a message, saying anything and watch the components build.
  4. Astra Db will through up the error saying,

Error Building Component
Error building Component Astra DB Search: Invalid inputs provided.

Hey there, @Developer-Atomic-Vishnu! 👋 I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together!

To resolve the "Error Building Component Astra DB Search: Invalid inputs provided" issue, ensure that you are providing all the required inputs correctly. The required fields for the AstraDBSearchComponent are:

  • token
  • api_endpoint
  • collection_name
  • input_value
  • embedding

Here is a sample code snippet to illustrate how to provide these inputs:

from langflow.components.vectorstores.AstraDB import AstraDBVectorStoreComponent
from langflow.field_typing import Embeddings, Text

# Example values for the required fields
embedding = Embeddings(...)  # Provide the appropriate embedding object
collection_name = "your_collection_name"
input_value = Text("your_input_value")
token = "your_authentication_token"
api_endpoint = "your_api_endpoint_url"

# Optional parameters
search_type = "Similarity"
number_of_results = 4
namespace = None
metric = None
batch_size = None
bulk_insert_batch_concurrency = None
bulk_insert_overwrite_concurrency = None
bulk_delete_concurrency = None
setup_mode = "Sync"
pre_delete_collection = False
metadata_indexing_include = None
metadata_indexing_exclude = None
collection_indexing_policy = None

# Build the AstraDBSearchComponent
astra_db_search_component = AstraDBSearchComponent()
results = astra_db_search_component.build(
    embedding=embedding,
    collection_name=collection_name,
    input_value=input_value,
    token=token,
    api_endpoint=api_endpoint,
    search_type=search_type,
    number_of_results=number_of_results,
    namespace=namespace,
    metric=metric,
    batch_size=batch_size,
    bulk_insert_batch_concurrency=bulk_insert_batch_concurrency,
    bulk_insert_overwrite_concurrency=bulk_insert_overwrite_concurrency,
    bulk_delete_concurrency=bulk_delete_concurrency,
    setup_mode=setup_mode,
    pre_delete_collection=pre_delete_collection,
    metadata_indexing_include=metadata_indexing_include,
    metadata_indexing_exclude=metadata_indexing_exclude,
    collection_indexing_policy=collection_indexing_policy,
)

Ensure that all the required fields are correctly populated with valid values. If any of these fields are missing or incorrect, you will encounter the "Invalid inputs provided" error. Additionally, make sure that your collection contains a field named 'content' if you are querying it through Langflow [1][2].

To continue talking to Dosu, mention @dosu.

Workaround: in the Chat Input component's advanced settings, turn off "Return Record"

commented

Hi, I had the same issue, I rolled back to the stable version and del and added new chat and Astra search components. in the new chat you can disable Return records.

Thanks guys that worked very well.

What version did you rollback to?