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

[FEATURE] custom-field-support #5422

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from
Open

Conversation

burtenshaw
Copy link
Contributor

@burtenshaw burtenshaw commented Aug 21, 2024

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()

jfcalvo and others added 30 commits July 19, 2024 16:30
…ine (#5355)

# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR adds support to indexing datasets and records with image fields.

Note: A datasets reindex is required with this change.

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- New feature (non-breaking change which adds functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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/)
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

This PR adds support to work with image fields using the SDK. 

## TODO (as separate PRs)

- [ ] Add documentation section
- [ ] Verify behavior using from/to_hub methods
- [ ] Add tooling to read data URLs from image files/folders (based on
logic defined in `image_to_html`)
- [ ] Add some media type validation (supported image types) 
- [ ] [Optional] Add tooling to re-scale images. The lower the image
sizes, the better the UI work. We can define a transparent re-scaling
process to support large images (currently the limit size in the backend
is 5MB for data URL)


**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- New feature (non-breaking change which adds functionality)

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- 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: José Francisco Calvo <[email protected]>
@burtenshaw burtenshaw marked this pull request as ready for review August 22, 2024 08:51
Copy link

The URL of the deployed environment for this PR is https://argilla-quickstart-pr-5422-ki24f765kq-no.a.run.app

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@burtenshaw burtenshaw changed the title [FEATURE] [WIP] custom-field-support [PoC] [WIP] custom-field-support Aug 23, 2024
@burtenshaw burtenshaw changed the title [PoC] [WIP] custom-field-support [FEATURE] custom-field-support Sep 2, 2024
Base automatically changed from feat/chat-field-support to develop September 17, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants