langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Create Data and Update Data do not work

Open Banbury opened this issue 1 year ago • 4 comments

Bug Description

The input nodes of Create Data do not accept any input from any text output. Looking into the code, the inputs of Create Data accept "Text" and "Data". But text outputs from other nodes have the type Message. The same goes for the text input on Update Data.

Connecting a Create Data node with an Update Data node produces the error Component field 'data' might not be a valid input., if you press the play button on either node.

Reproduction

See description.

Expected behavior

Since the API Request node requires data as input, I would like those nodes to work.

Who can help?

No response

Operating System

Windows 11

Langflow Version

v1.0.17

Python Version

3.12

Screenshot

No response

Flow File

No response

Banbury avatar Sep 01 '24 12:09 Banbury

Hey @Banbury! I'm a bot here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer.

The Create Data and Update Data nodes in Langflow v1.0.17 do not accept input from text outputs because they are designed to handle data of type Data, not Message or Text. The error Component field 'data' might not be a valid input occurs when connecting a Create Data node with an Update Data node because the input types do not match the expected data types.

  • The Create Data node expects input of type Data.
  • The Update Data node also expects input of type Data.
  • Text outputs, such as those from ParseData or OpenAIModel, are of type Message or Text.

Here is an example of the relevant part of the JSON configuration:

{
  "sourceHandle": {
    "dataType": "File",
    "id": "File-31fJd",
    "name": "data",
    "output_types": [
      "Data"
    ]
  },
  "targetHandle": {
    "fieldName": "data",
    "id": "ParseData-rLcoq",
    "inputTypes": [
      "Data"
    ],
    "type": "other"
  }
}

This configuration shows that the data field expects Data type, not Message or Text [[1]](https://github.com/langflow-ai/langflow/blob/dev/src/backend/base/langflow/initial_setup/starter_projects/Document QA.json).

To resolve this, you may need to use type conversion utilities to convert Message types to Data types. There are existing functions in the codebase that can help with this conversion [2][3][4].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 01 '24 12:09 dosubot[bot]

@Banbury

Correct me if I'm wrong, is that what you're trying to do?

Please share the flow that you're trying to create.

image

carlosrcoelho avatar Sep 02 '24 14:09 carlosrcoelho

@Banbury

Correct me if I'm wrong, is that what you're trying to do?

Please share the flow that you're trying to create.

image

how to update data, the 'update data' component's 'New Data' input type is not text, it's a dict, but ,how can we construct a dict?

maxpaynebupt avatar Sep 03 '24 10:09 maxpaynebupt

The Update Data component seems to be outdated. I will direct the team to perform a new update on it soon.

carlosrcoelho avatar Sep 04 '24 13:09 carlosrcoelho