argilla icon indicating copy to clipboard operation
argilla copied to clipboard

[PoC] [WIP] custom-field-support

Open burtenshaw opened this issue 6 months ago • 3 comments

This PR implements a custom field on the server and in the SDK.

Server

Fields response is:

{
    "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": "<html></html>"
            },
            "dataset_id": "7cccb1e6-9053-4919-b824-43cdb380f7b8",
            "inserted_at": "2024-08-21T10:47:10.481962",
            "updated_at": "2024-08-21T10:47:10.481962"
        }
    ]
}

SDK

import argilla as rg

client = rg.Argilla()

settings = rg.Settings(
    fields = [
        rg.TextField('name'),
        rg.CustomField('custom_field', '<html></html>'),
    ],
    questions=[
        rg.TextQuestion('response'),
    ]
)

dataset = rg.Dataset(
    settings=settings,
    name="custom_4"
)

dataset.create()

burtenshaw avatar Aug 21 '24 10:08 burtenshaw