code: def test_add_records(
      feedback_dataset_guidelines: str,
      feedback_dataset_fields: List["AllowedFieldTypes"],
      feedback_dataset_questions: List["AllowedQuestionTypes"],
  ) -> None:
      dataset = FeedbackDataset(
          guidelines=feedback_dataset_guidelines,
          fields=feedback_dataset_fields,
          questions=feedback_dataset_questions,
      )
  
      assert dataset.records == []
  
      dataset.add_records(
          [
              FeedbackRecord(
                  fields={
                      "text": "A",
                      "label": "B",
                  },
              ),
          ]
      )
  
      assert len(dataset.records) == 1
      assert dataset.records[0].fields == {
          "text": "A",
          "label": "B",
      }
      assert not dataset.records[0].metadata
      assert not dataset.records[0].responses
      assert not dataset.records[0].suggestions
  
      dataset.add_records(
          [
              FeedbackRecord(
                  fields={
                      "text": "C",
                      "label": "D",
                  },
                  metadata={"unit": "test"},
                  responses=[
                      {
                          "values": {
                              "question-1": {"value": "answer"},
                              "question-2": {"value": 0},
                              "question-3": {"value": "a"},
                              "question-4": {"value": ["a", "b"]},
                              "question-5": {
                                  "value": [
                                      {"rank": 1, "value": "a"},
                                      {"rank": 2, "value": "b"},
                                  ]
                              },
                          },
                          "status": "submitted",
                      },
                  ],
                  suggestions=[
                      {
                          "question_name": "question-1",
                          "value": "answer",
                      },
                      {
                          "question_name": "question-2",
                          "value": 0,
                      },
                      {
                          "question_name": "question-3",
                          "value": "a",
                      },
                      {
                          "question_name": "question-4",
                          "value": ["a", "b"],
                      },
                      {
                          "question_name": "question-5",
                          "value": [
                              {"rank": 1, "value": "a"},
                              {"rank": 2, "value": "b"},
                          ],
                      },
                  ],
                  external_id="test-id",
              ),
          ]
      )
  
      assert len(dataset.records) == 2
      assert dataset.records[1].fields == {
          "text": "C",
          "label": "D",
      }
      assert dataset.records[1].metadata == {"unit": "test"}
      assert dataset.records[1].responses[0].dict() == {
          "user_id": None,
          "values": {
              "question-1": {"value": "answer"},
              "question-2": {"value": 0},
              "question-3": {"value": "a"},
              "question-4": {"value": ["a", "b"]},
              "question-5": {
                  "value": [
                      {"rank": 1, "value": "a"},
                      {"rank": 2, "value": "b"},
                  ]
              },
          },
          "status": "submitted",
      }
      assert dataset.records[1].suggestions[0].dict() == {
          "question_name": "question-1",
          "value": "answer",
          "type": None,
          "score": None,
          "agent": None,
      }
  
      with pytest.raises(
          ValueError, match="Expected `records` to be a non-empty list"
      ):
          dataset.add_records([])
  
      with pytest.raises(
          ValueError,
          match="Expected `records` to be a list of `dict` or `FeedbackRecord`",
      ):
          dataset.add_records([None])
  
      with pytest.raises(
          ValueError,
          match="`FeedbackRecord.fields` does not match the expected schema",
      ):
          dataset.add_records(
              [
                  FeedbackRecord(
                      fields={
                          "wrong": "field",
                      },
                  ),
              ]
          )
  
      for record in dataset.records:
          assert isinstance(record, FeedbackRecord)
  
      for batch in dataset.iter(batch_size=1):
          assert len(batch) == 1
          for record in batch:
              assert isinstance(record, FeedbackRecord)
  
      assert len(dataset[:2]) == 2
      assert len(dataset[1:2]) == 1
      assert len(dataset) == len(dataset.records)
  
imports: import tempfile
  from typing import TYPE_CHECKING, List, Type, Union
  import argilla.client.singleton
  import datasets
  import pytest
  from argilla import User, Workspace
  from argilla.client.feedback.config import DatasetConfig
  from argilla.client.feedback.dataset import FeedbackDataset
  from argilla.client.feedback.schemas.fields import TextField
  from argilla.client.feedback.schemas.metadata import FloatMetadataProperty, IntegerMetadataProperty, TermsMetadataProperty
  from argilla.client.feedback.schemas.questions import TextQuestion
  from argilla.client.feedback.schemas.records import FeedbackRecord
  from argilla.client.feedback.schemas.remote.records import RemoteSuggestionSchema
  from argilla.client.feedback.schemas.vector_settings import VectorSettings
  from argilla.client.feedback.training.schemas.base import TrainingTask
  from argilla.client.models import Framework
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_records(feedback_dataset_guidelines, feedback_dataset_fields, feedback_dataset_questions) without return types