From a150b5517a33e4e0228896a2ba11d770d5df4f2a Mon Sep 17 00:00:00 2001 From: Paco Aranda Date: Wed, 2 Oct 2024 14:10:49 +0200 Subject: [PATCH 1/9] fix: get default workspace if exits when creating default user (#5558) # Description This PR fixes the create_default CLI command errors when creating a default user and the default workspace already exists. **Type of change** - Bug fix (non-breaking change which fixes an issue) **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla-server/CHANGELOG.md | 4 ++++ .../cli/database/users/create_default.py | 4 +++- .../unit/cli/database/users/test_create_default.py | 13 ++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/argilla-server/CHANGELOG.md b/argilla-server/CHANGELOG.md index 6fef52233e..2b0e53d259 100644 --- a/argilla-server/CHANGELOG.md +++ b/argilla-server/CHANGELOG.md @@ -20,6 +20,10 @@ These are the section headers that we use: - Added helm chart for argilla. ([#5512](https://github.com/argilla-io/argilla/pull/5512)) +### Fixed + +- Fixed error when creating default user with existing default workspace. ([#5558](https://github.com/argilla-io/argilla/pull/5558)) + ## [2.2.0](https://github.com/argilla-io/argilla/compare/v2.1.0...v2.2.0) ### Added diff --git a/argilla-server/src/argilla_server/cli/database/users/create_default.py b/argilla-server/src/argilla_server/cli/database/users/create_default.py index 3c885db158..37321775f9 100644 --- a/argilla-server/src/argilla_server/cli/database/users/create_default.py +++ b/argilla-server/src/argilla_server/cli/database/users/create_default.py @@ -20,6 +20,8 @@ from argilla_server.database import AsyncSessionLocal from argilla_server.models import User, UserRole, Workspace +from .utils import get_or_new_workspace + async def _create_default(api_key: str, password: str, quiet: bool): """Creates a user with default credentials on database suitable to start experimenting with argilla.""" @@ -37,7 +39,7 @@ async def _create_default(api_key: str, password: str, quiet: bool): role=UserRole.owner, api_key=api_key, password_hash=accounts.hash_password(password), - workspaces=[Workspace(name=DEFAULT_USERNAME)], + workspaces=[await get_or_new_workspace(session, DEFAULT_USERNAME)], ) if not quiet: diff --git a/argilla-server/tests/unit/cli/database/users/test_create_default.py b/argilla-server/tests/unit/cli/database/users/test_create_default.py index 850260dfb8..86df21c532 100644 --- a/argilla-server/tests/unit/cli/database/users/test_create_default.py +++ b/argilla-server/tests/unit/cli/database/users/test_create_default.py @@ -15,7 +15,8 @@ from argilla_server.constants import DEFAULT_API_KEY, DEFAULT_PASSWORD, DEFAULT_USERNAME from argilla_server.contexts import accounts -from argilla_server.models import User, UserRole +from argilla_server.models import User, UserRole, Workspace +from tests.factories import WorkspaceSyncFactory if TYPE_CHECKING: from sqlalchemy.orm import Session @@ -87,3 +88,13 @@ def test_create_default_with_existent_default_user_and_quiet(sync_db: "Session", assert result.exit_code == 0 assert result.output == "" assert sync_db.query(User).count() == 1 + + +def test_create_default_with_existent_default_workspace(sync_db: "Session", cli_runner: "CliRunner", cli: "Typer"): + WorkspaceSyncFactory.create(name=DEFAULT_USERNAME) + + result = cli_runner.invoke(cli, "database users create_default") + + assert result.exit_code == 0 + assert result.output != "" + assert sync_db.query(User).count() == 1 From de5085d4e0c1d1ada7ccdd59ef2e97b5174eae29 Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Wed, 2 Oct 2024 14:11:46 +0200 Subject: [PATCH 2/9] [BUGFIX] serialize-chat-fields (#5553) # Description Closes # **Type of change** - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Refactor (change restructuring the codebase without changing functionality) - Improvement (change adding some improvement to an existing functionality) - Documentation update **How Has This Been Tested** **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- argilla/src/argilla/records/_resource.py | 18 +- .../tests/integration/test_export_dataset.py | 19 ++ .../tests/integration/test_export_records.py | 268 ++++-------------- argilla/tests/unit/test_record_fields.py | 16 +- 4 files changed, 106 insertions(+), 215 deletions(-) diff --git a/argilla/src/argilla/records/_resource.py b/argilla/src/argilla/records/_resource.py index 4fb1cf98a7..8de89b11c1 100644 --- a/argilla/src/argilla/records/_resource.py +++ b/argilla/src/argilla/records/_resource.py @@ -300,7 +300,18 @@ def __init__(self, record: Record, fields: Optional[Dict[str, FieldValue]] = Non self.record = record def to_dict(self) -> dict: - return {key: cast_image(value) if self._is_image(key) else value for key, value in self.items()} + fields = {} + + for key, value in self.items(): + if value is None: + continue + elif self._is_image(key): + fields[key] = cast_image(value) + elif self._is_chat(key): + fields[key] = [message.model_dump() if not isinstance(message, dict) else message for message in value] + else: + fields[key] = value + return fields def __getitem__(self, key: str) -> FieldValue: value = super().__getitem__(key) @@ -311,6 +322,11 @@ def _is_image(self, key: str) -> bool: return False return self.record.dataset.settings.schema[key].type == "image" + def _is_chat(self, key: str) -> bool: + if not self.record.dataset: + return False + return self.record.dataset.settings.schema[key].type == "chat" + class RecordMetadata(dict): """This is a container class for the metadata of a Record.""" diff --git a/argilla/tests/integration/test_export_dataset.py b/argilla/tests/integration/test_export_dataset.py index 51586dda39..65117ed23c 100644 --- a/argilla/tests/integration/test_export_dataset.py +++ b/argilla/tests/integration/test_export_dataset.py @@ -37,6 +37,7 @@ def dataset(client) -> rg.Dataset: fields=[ rg.TextField(name="text"), rg.ImageField(name="image"), + rg.ChatField(name="chat"), ], questions=[ rg.LabelQuestion(name="label", labels=["positive", "negative"]), @@ -58,18 +59,36 @@ def mock_data() -> List[dict[str, Any]]: { "text": "Hello World, how are you?", "image": "http://mock.url/image", + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], "label": "positive", "id": uuid.uuid4(), }, { "text": "Hello World, how are you?", "image": "http://mock.url/image", + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], "label": "negative", "id": uuid.uuid4(), }, { "text": "Hello World, how are you?", "image": "http://mock.url/image", + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], "label": "positive", "id": uuid.uuid4(), }, diff --git a/argilla/tests/integration/test_export_records.py b/argilla/tests/integration/test_export_records.py index 1ec806e950..0314cd8741 100644 --- a/argilla/tests/integration/test_export_records.py +++ b/argilla/tests/integration/test_export_records.py @@ -33,6 +33,8 @@ def dataset(client) -> rg.Dataset: settings = rg.Settings( fields=[ rg.TextField(name="text"), + rg.ChatField(name="chat"), + rg.ImageField(name="image"), ], questions=[ rg.TextQuestion(name="label", use_markdown=False), @@ -48,24 +50,49 @@ def dataset(client) -> rg.Dataset: dataset.delete() -def test_export_records_dict_flattened(client: Argilla, dataset: rg.Dataset): - mock_data = [ +@pytest.fixture +def mock_data(): + return [ { "text": "Hello World, how are you?", "label": "positive", - "id": uuid.uuid4(), + "id": uuid.uuid4().hex, + "image": Image.new("RGB", (100, 100)), + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], }, { "text": "Hello World, how are you?", "label": "negative", - "id": uuid.uuid4(), + "id": uuid.uuid4().hex, + "image": Image.new("RGB", (100, 100)), + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], }, { "text": "Hello World, how are you?", "label": "positive", - "id": uuid.uuid4(), + "id": uuid.uuid4().hex, + "image": Image.new("RGB", (100, 100)), + "chat": [ + { + "role": "user", + "content": "Hello World, how are you?", + } + ], }, ] + + +def test_export_records_dict_flattened(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records.to_dict(flatten=True) assert isinstance(exported_records, dict) @@ -75,24 +102,7 @@ def test_export_records_dict_flattened(client: Argilla, dataset: rg.Dataset): assert exported_records["text"] == ["Hello World, how are you?"] * 3 -def test_export_records_list_flattened(client: Argilla, dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_list_flattened(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records.to_list(flatten=True) assert len(exported_records) == len(mock_data) @@ -106,24 +116,7 @@ def test_export_records_list_flattened(client: Argilla, dataset: rg.Dataset): assert exported_records[0]["label.suggestion.score"] is None -def test_export_record_list_with_filtered_records(client: Argilla, dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_record_list_with_filtered_records(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records(query=rg.Query(query="hello")).to_list(flatten=True) assert len(exported_records) == len(mock_data) @@ -137,24 +130,7 @@ def test_export_record_list_with_filtered_records(client: Argilla, dataset: rg.D assert exported_records[0]["label.suggestion.score"] is None -def test_export_records_list_nested(client: Argilla, dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_list_nested(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records.to_list(flatten=False) assert len(exported_records) == len(mock_data) @@ -163,25 +139,7 @@ def test_export_records_list_nested(client: Argilla, dataset: rg.Dataset): assert exported_records[0]["suggestions"]["label"]["score"] is None -def test_export_records_dict_nested(client: Argilla, dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] - +def test_export_records_dict_nested(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records.to_dict(flatten=False) assert isinstance(exported_records, dict) @@ -189,24 +147,7 @@ def test_export_records_dict_nested(client: Argilla, dataset: rg.Dataset): assert exported_records["suggestions"][0]["label"]["value"] == "positive" -def test_export_records_dict_nested_orient_index(client: Argilla, dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_dict_nested_orient_index(client: Argilla, dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) exported_records = dataset.records.to_dict(flatten=False, orient="index") assert isinstance(exported_records, dict) @@ -217,24 +158,7 @@ def test_export_records_dict_nested_orient_index(client: Argilla, dataset: rg.Da assert exported_record["id"] == str(mock_record["id"]) -def test_export_records_to_json(dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_to_json(dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) with TemporaryDirectory() as temp_dir: @@ -247,24 +171,7 @@ def test_export_records_to_json(dataset: rg.Dataset): assert exported_records[0]["suggestions"]["label"]["value"] == "positive" -def test_export_records_from_json(dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_from_json(dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) with TemporaryDirectory() as temp_dir: @@ -278,24 +185,7 @@ def test_export_records_from_json(dataset: rg.Dataset): assert record.id == str(mock_data[i]["id"]) -def test_export_records_to_hf_datasets(dataset: rg.Dataset): - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": uuid.uuid4(), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": uuid.uuid4(), - }, - ] +def test_export_records_to_hf_datasets(dataset: rg.Dataset, mock_data): dataset.records.log(records=mock_data) hf_dataset = dataset.records.to_datasets() @@ -306,73 +196,27 @@ def test_export_records_to_hf_datasets(dataset: rg.Dataset): assert hf_dataset["text"][0] == "Hello World, how are you?" assert hf_dataset["id"][0] == str(mock_data[0]["id"]) + assert "image" in hf_dataset.column_names + for i, image in enumerate(hf_dataset["image"]): + assert isinstance(image, Image.Image) -def test_import_records_from_hf_dataset(dataset: rg.Dataset) -> None: - mock_data = [ - { - "text": "Hello World, how are you?", - "label": "positive", - "id": str(uuid.uuid4()), - }, - { - "text": "Hello World, how are you?", - "label": "negative", - "id": str(uuid.uuid4()), - }, - { - "text": "Hello World, how are you?", - "label": "positive", - "id": str(uuid.uuid4()), - }, - ] + assert "chat" in hf_dataset.column_names + for i, chat in enumerate(hf_dataset["chat"]): + assert isinstance(chat, list) + assert isinstance(chat[0], dict) + assert chat[0]["role"] == "user" + assert chat[0]["content"] == "Hello World, how are you?" + + +def test_import_records_from_hf_dataset(dataset: rg.Dataset, mock_data) -> None: mock_hf_dataset = HFDataset.from_list(mock_data) dataset.records.log(records=mock_hf_dataset) for i, record in enumerate(dataset.records(with_suggestions=True)): assert record.fields["text"] == mock_data[i]["text"] + assert record.fields["image"].size == mock_data[i]["image"].size + assert record.fields["image"].mode == mock_data[i]["image"].mode + assert record.fields["chat"][0].role == "user" + assert record.fields["chat"][0].content == "Hello World, how are you?" assert record.suggestions["label"].value == mock_data[i]["label"] assert record.id == str(mock_data[i]["id"]) - - -def test_export_records_with_images_to_hf_datasets(client): - mock_dataset_name = "".join(random.choices(ascii_lowercase, k=16)) - settings = rg.Settings( - fields=[ - rg.ImageField(name="image"), - ], - questions=[ - rg.TextQuestion(name="label", use_markdown=False), - ], - ) - dataset = rg.Dataset( - name=mock_dataset_name, - settings=settings, - client=client, - ) - dataset.create() - mock_data = [ - { - "image": Image.new("RGB", (100, 100)), - "label": "positive", - "id": uuid.uuid4(), - }, - { - "image": Image.new("RGB", (100, 100)), - "label": "negative", - "id": uuid.uuid4(), - }, - { - "image": Image.new("RGB", (100, 100)), - "label": "positive", - "id": uuid.uuid4(), - }, - ] - dataset.records.log(records=mock_data) - hf_dataset = dataset.records.to_datasets() - - assert isinstance(hf_dataset, HFDataset) - assert hf_dataset.num_rows == len(mock_data) - assert "image" in hf_dataset.column_names - assert "label.suggestion" in hf_dataset.column_names - for i, image in enumerate(hf_dataset["image"]): - assert isinstance(image, Image.Image) diff --git a/argilla/tests/unit/test_record_fields.py b/argilla/tests/unit/test_record_fields.py index 36553954ab..0819cb5185 100644 --- a/argilla/tests/unit/test_record_fields.py +++ b/argilla/tests/unit/test_record_fields.py @@ -18,7 +18,7 @@ from PIL import Image -from argilla import Record, Settings, ImageField, Dataset +from argilla import Record, Settings, ImageField, Dataset, ChatField, TextField @pytest.fixture @@ -39,7 +39,7 @@ def dataset(): dataset = Dataset( name=f"test_dataset_{random.randint(1, 1000)}", settings=Settings( - fields=[ImageField(name="image")], + fields=[ImageField(name="image"), ChatField(name="chat"), TextField(name="text")], ), ) return dataset @@ -80,3 +80,15 @@ def test_create_record_with_wrong_image_type(self, dataset): record.fields.to_dict() with pytest.raises(ValueError): record.fields["image"] + + def test_serialize_record_fields(self, pil_image, dataset): + record = Record( + fields={"image": pil_image, "chat": [{"role": "bot", "content": "leave me now"}], "text": "why pat?"}, + _dataset=dataset, + ) + + fields = record.fields.to_dict() + assert isinstance(fields["image"], str) + assert isinstance(fields["chat"], list) + assert all(isinstance(chat, dict) for chat in fields["chat"]) + assert isinstance(fields["text"], str) From efc4a562fa7599bbfa1a6b4d44835386f1d8ed4b Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Wed, 2 Oct 2024 14:14:29 +0200 Subject: [PATCH 3/9] [FEATURE] custom-field-support (#5422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR implements a custom field on the server and in the SDK. ## Server Fields response is: ```json { "items": [ { "id": "11aff30d-e5cf-4485-b646-07adab0bc5b7", "name": "name", "title": "name", "required": true, "settings": { "type": "text", "use_markdown": false }, "dataset_id": "7cccb1e6-9053-4919-b824-43cdb380f7b8", "inserted_at": "2024-08-21T10:47:10.471676", "updated_at": "2024-08-21T10:47:10.471676" }, { "id": "9650009e-e198-40e3-827f-8e0474287fd6", "name": "custom_field", "title": "custom_field", "required": true, "settings": { "type": "custom", "template": "" }, "dataset_id": "7cccb1e6-9053-4919-b824-43cdb380f7b8", "inserted_at": "2024-08-21T10:47:10.481962", "updated_at": "2024-08-21T10:47:10.481962" } ] } ``` ## SDK ```python import argilla as rg client = rg.Argilla() settings = rg.Settings( fields = [ rg.TextField('name'), rg.CustomField('custom_field', ''), ], questions=[ rg.TextQuestion('response'), ] ) dataset = rg.Dataset( settings=settings, name="custom_4" ) dataset.create() ```` --------- Co-authored-by: José Francisco Calvo Co-authored-by: José Francisco Calvo Co-authored-by: Damián Pumar Co-authored-by: Paco Aranda Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Francisco Aranda Co-authored-by: David Berenstein Co-authored-by: Leire Aguirre --- .github/workflows/argilla.yml | 2 +- argilla-frontend/CHANGELOG.md | 4 + .../container/fields/RecordFields.vue | 17 +- .../container/fields/chat-field/ChatField.vue | 1 - .../fields/custom-field/CustomField.vue | 97 + .../container/fields/sandbox/Sandbox.vue | 62 + .../container/fields/text-field/Sandbox.vue | 29 - .../container/fields/text-field/TextField.vue | 11 +- .../annotation/settings/SettingsFields.vue | 18 + argilla-frontend/nuxt.config.ts | 7 +- argilla-frontend/static/js/handlebars.min.js | 5975 +++++++++++++++++ argilla-frontend/translation/de.js | 1 + argilla-frontend/translation/en.js | 1 + argilla-frontend/translation/es.js | 1 + .../domain/entities/__mocks__/field/mocks.ts | 20 +- .../v1/domain/entities/field/Field.ts | 22 +- .../get-dataset-settings-use-case.ts | 1 - .../v1/domain/usecases/get-fields-use-case.ts | 1 - .../get-records-by-criteria-use-case.ts | 8 +- argilla-server/CHANGELOG.md | 7 - .../argilla_server/api/schemas/v1/fields.py | 21 + .../argilla_server/api/schemas/v1/records.py | 7 +- argilla-server/src/argilla_server/enums.py | 1 + .../src/argilla_server/models/database.py | 4 + .../argilla_server/search_engine/commons.py | 14 +- .../src/argilla_server/validators/records.py | 32 +- argilla-server/tests/factories.py | 8 + .../test_create_dataset_records_bulk.py | 96 + .../unit/api/handlers/v1/test_datasets.py | 10 + argilla/src/argilla/_models/__init__.py | 1 + .../src/argilla/_models/_record/_record.py | 8 +- .../src/argilla/_models/_settings/_fields.py | 12 +- argilla/src/argilla/settings/_field.py | 91 +- .../tests/integration/test_create_datasets.py | 24 + .../tests/unit/test_resources/test_fields.py | 12 +- .../test_settings/test_settings_fields.py | 16 + examples/custom_field/custom_field.ipynb | 261 + examples/custom_field/interactive_chat.html | 163 + 38 files changed, 6987 insertions(+), 79 deletions(-) create mode 100644 argilla-frontend/components/features/annotation/container/fields/custom-field/CustomField.vue create mode 100644 argilla-frontend/components/features/annotation/container/fields/sandbox/Sandbox.vue delete mode 100644 argilla-frontend/components/features/annotation/container/fields/text-field/Sandbox.vue create mode 100644 argilla-frontend/static/js/handlebars.min.js create mode 100644 examples/custom_field/custom_field.ipynb create mode 100644 examples/custom_field/interactive_chat.html diff --git a/.github/workflows/argilla.yml b/.github/workflows/argilla.yml index 3f8bad1a76..90db68654f 100644 --- a/.github/workflows/argilla.yml +++ b/.github/workflows/argilla.yml @@ -21,7 +21,7 @@ jobs: build: services: argilla-server: - image: argilladev/argilla-hf-spaces:pr-5546 + image: argilladev/argilla-hf-spaces:pr-5422 ports: - 6900:6900 env: diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index f36eaec6a6..054f7cb5e7 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -16,6 +16,10 @@ These are the section headers that we use: ## [Unreleased]() +### Added + +- Added new field `CustomField` [#5462](https://github.com/argilla-io/argilla/pull/5462) + ### Fixed - Fix autofill form on sign-in page [#5522](https://github.com/argilla-io/argilla/pull/5522) diff --git a/argilla-frontend/components/features/annotation/container/fields/RecordFields.vue b/argilla-frontend/components/features/annotation/container/fields/RecordFields.vue index ea54d9c056..2ce0ceaa6b 100644 --- a/argilla-frontend/components/features/annotation/container/fields/RecordFields.vue +++ b/argilla-frontend/components/features/annotation/container/fields/RecordFields.vue @@ -7,6 +7,7 @@ title, content, settings, + sdkRecord, isTextType, isImageType, isChatType, @@ -30,6 +31,7 @@ :fieldText="content" :useMarkdown="settings.use_markdown" :searchText="recordCriteria.committed.searchText.value.text" + :record="record" /> - + + diff --git a/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue b/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue index 1389c8f155..971ede238a 100644 --- a/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue +++ b/argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue @@ -2,7 +2,6 @@
diff --git a/argilla-frontend/components/features/annotation/container/fields/custom-field/CustomField.vue b/argilla-frontend/components/features/annotation/container/fields/custom-field/CustomField.vue new file mode 100644 index 0000000000..b3493cd41b --- /dev/null +++ b/argilla-frontend/components/features/annotation/container/fields/custom-field/CustomField.vue @@ -0,0 +1,97 @@ + + + + diff --git a/argilla-frontend/components/features/annotation/container/fields/sandbox/Sandbox.vue b/argilla-frontend/components/features/annotation/container/fields/sandbox/Sandbox.vue new file mode 100644 index 0000000000..bf00971086 --- /dev/null +++ b/argilla-frontend/components/features/annotation/container/fields/sandbox/Sandbox.vue @@ -0,0 +1,62 @@ +