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

Create Data and Update Data do not work #3644

Closed
Banbury opened this issue Sep 1, 2024 · 4 comments · Fixed by #3715
Closed

Create Data and Update Data do not work #3644

Banbury opened this issue Sep 1, 2024 · 4 comments · Fixed by #3715
Assignees
Labels
bug Something isn't working

Comments

@Banbury
Copy link

Banbury commented Sep 1, 2024

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 Banbury added the bug Something isn't working label Sep 1, 2024
Copy link

dosubot bot commented Sep 1, 2024

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.

@carlosrcoelho
Copy link
Contributor

@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

@maxpaynebupt
Copy link
Contributor

maxpaynebupt commented Sep 3, 2024

@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?

@carlosrcoelho
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants