HumanSignal / HumanSignal/label-studio

Data Import Error

Open
#6,492 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
We get an incorrect formatting error when attempting to import new data.
```
Validation error
Error at item 0: "llm.inputs.retrieved_context" key is expected in task data [assume: item["data"] = task root with values] :: {'data': {'observability.identifiers.user': [{'key': 'session_id', 'value': ''}], 'observability.identifiers.system': [{'key': 'correlation_id', 'value': ''}, {'key': 'trace_id', 'value': ''}, {'key': 'parent_span_id', 'value': ''}], 'observability.identifiers.llm': [{'key': 'interaction_id', 'value': ''}, {'key': 'runnable_sequence_id', 'value': ''}, {'key': 'runnable_sequence_step', 'value': ''}, {'key': 'runnable_id', 'value': ''}], 'llm.inputs.retrieved_context': [{'id': '1', 'title': '', 'body': ''}, {'id': '2', 'title': '', 'body': ''}], 'llm.outputs': [{'key': 'text_response', 'value': ''}]}, 'file_upload_id': 28}
```

I believe this error is telling me that the key `llm.inputs.retrieved_context` defined in my interface is not present in the data being uploaded, however it is there.

If we import a data file, then add the interface it works fine, but if the interface is already existing we get the error message.

**To Reproduce**

Example Interface:
```

.lsf-select { display: none; }

LLM Outputs:





```
example data:
[fa-test.json](https://github.com/user-attachments/files/17309047/fa-test.json)

Steps to reproduce the behavior:
1. Create a new project
2. Add Label Interface
3. Try to Import the data file

**Expected behavior**
Data file is uploaded and rendered through the interface

**Screenshots**
With data input directly into the labeling interface configuration:
Screenshot 2024-10-09 at 9 35 12 AM

When data is uploaded prior to setting up the labeling interface:
Screenshot 2024-10-09 at 9 35 28 AM

When attempting to import data as a file after labeling interface is saved:
Screenshot 2024-10-09 at 9 35 46 AM

**Environment (please complete the following information):**
- OS: Mac OS Sonoma 14.5
- Label Studio Version [e.g. 1.13.1]

**Additional context**
The same example data works if input as data in the labeling interface preview
The same example data also renders correctly in the UI if you:
1. Create a new project
2. Upload the example data file FIRST
3. Create the labeling interface

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.