🌟 Release highlights
Custom Fields: the most powerful way to build custom annotation tasks
We heard you. This new type of field gives you full control over how data is presented to annotators.
With custom fields, you can use your own CSS, HTML, and even Javascript (welcome interactive fields!). Moreover, you can populate your fields with custom structures like `custom_field={"image1": ..., "image_2": ..., etc.}`.
Here's an example:
> Imagine you want to show two images and a prompt to your users.
With a custom field
With the new custom field, you can configure something like this:
<img width="952" alt="Screenshot 2024-10-04 at 13 04 28" src="https://github.com/user-attachments/assets/1e85a5e5-7e35-4912-8f32-aeed4e32adfe">
And you can set this up with a few lines of code:
python
css_template = """
<style>
container {
display: flex;
flex-direction: column;
font-family: Arial, sans-serif;
}
.prompt {
margin-bottom: 10px;
font-size: 16px;
line-height: 1.4;
color: 333;
background-color: f8f8f8;
padding: 10px;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.image-container {
display: flex;
gap: 10px;
}
.column {
flex: 1;
position: relative;
}
img {
max-width: 100%;
height: auto;
display: block;
}
.image-label {
position: absolute;
top: 10px;
right: 10px;
background-color: rgba(255, 255, 255, 0.7);
color: black;
padding: 5px 10px;
border-radius: 5px;
font-weight: bold;
}
</style>
"""
html_template = """
<div id="container">
<div class="prompt"><strong>Prompt:</strong> {{record.fields.images.prompt}}</div>
<div class="image-container">
<div class="column">
<img src="{{record.fields.images.image_1}}" />
<div class="image-label">Image 1</div>
</div>
<div class="column">
<img src="{{record.fields.images.image_2}}" />
<div class="image-label">Image 2</div>
</div>
</div>
</div>
"""
custom_field = rg.CustomField(
name="images",
template=css_template + html_template,
)
and the log records like this
rg.Record(
fields={
"prompt": prompt,
"image_1": schnell_uri,
"image_2": dev_uri,
}
)
Before the custom field
Before this release, you were forced to use two `ImageField` and a `TextField`, which would be displayed sequentially, limiting the ability to compare the images side-by-side, with clear labels, prompt text, etc. It would look like this:
<img width="736" alt="Screenshot 2024-10-04 at 14 13 52" src="https://github.com/user-attachments/assets/03ac0a7d-04a6-4f53-96f9-40a070d1c130">
How to get started with custom fields
Here we've shown a basic presentation-oriented custom field but you can set up anything you can think of, leveraging JS, html, and css. Imagination is the limit!
To get started check the docs: https://docs.argilla.io/v2.3/how_to_guides/custom_fields/
Other features
- Support for similarity search [from the SDK](https://docs.argilla.io/latest/how_to_guides/query/#similarity-search) and other search and [filtering improvements](https://docs.argilla.io/latest/how_to_guides/query/#available-fields).
- New Helm chart [deployment configuration](https://github.com/argilla-io/argilla/tree/v2.3.0/examples/deployments/k8s/argilla-chart).
- Support credentials from colab secrets.
An other changes and fixes
Changed
- Changed the __repr__ method for `SettingsProperties` to display the details of all the properties in `Setting` object. ([5380](https://github.com/argilla-io/argilla/issues/5380))
- Changed error messages when creating datasets with insufficient permissions. ([5540](https://github.com/argilla-io/argilla/pull/5554))
Fixed
- Fixed serialization of `ChatField` when collecting records from the hub and exporting to `datasets`. ([5554](https://github.com/argilla-io/argilla/pull/5553))
- Fixed error when creating default user with existing default workspace. ([5558](https://github.com/argilla-io/argilla/pull/5558))
- Fixed the deployment yaml used to create a new Argilla server in K8s. Added `USERNAME` and `PASSWORD` to the environment variables of pod template. ([5434](https://github.com/argilla-io/argilla/issues/5434))
- Fix autofill form on sign-in page [5522](https://github.com/argilla-io/argilla/pull/5522)
- Support copy on clipboard for no secure context [5535](https://github.com/argilla-io/argilla/pull/5535)
New Contributors
* not-lain made their first contribution in https://github.com/argilla-io/argilla/pull/5541
Thanks to
* bikash119 for Helm chart in https://github.com/argilla-io/argilla/pull/5512
**Full Changelog**: https://github.com/argilla-io/argilla/compare/v2.2.2...v2.3.0