diff --git a/argilla/CHANGELOG.md b/argilla/CHANGELOG.md index e7b8bf6b7b..2136f769ed 100644 --- a/argilla/CHANGELOG.md +++ b/argilla/CHANGELOG.md @@ -19,6 +19,7 @@ These are the section headers that we use: ### Changed - Terms metadata properties accept other values than `str`. ([#5594](https://github.com/argilla-io/argilla/pull/5594)) +- Added support for `with_vectors` while fetching records along with a search query. ([#5638](https://github.com/argilla-io/argilla/pull/5638)) ## [2.3.0](https://github.com/argilla-io/argilla/compare/v2.2.2...v2.3.0) diff --git a/argilla/src/argilla/_api/_records.py b/argilla/src/argilla/_api/_records.py index 3c5f13270b..6581655839 100644 --- a/argilla/src/argilla/_api/_records.py +++ b/argilla/src/argilla/_api/_records.py @@ -111,13 +111,15 @@ def search( limit: int = 100, with_suggestions: bool = True, with_responses: bool = True, - # TODO: Add support for `with_vectors` + with_vectors: Optional[Union[List, bool]] = None, ) -> Tuple[List[Tuple[RecordModel, float]], int]: include = [] if with_suggestions: include.append("suggestions") if with_responses: include.append("responses") + if with_vectors: + include.append(self._represent_vectors_to_include(with_vectors)) params = { "offset": offset, "limit": limit, diff --git a/argilla/src/argilla/records/_dataset_records.py b/argilla/src/argilla/records/_dataset_records.py index 2887fd69d2..eb9b21afa3 100644 --- a/argilla/src/argilla/records/_dataset_records.py +++ b/argilla/src/argilla/records/_dataset_records.py @@ -132,6 +132,7 @@ def _fetch_from_server_with_search(self) -> List[RecordModel]: offset=self.__offset, with_responses=self.__with_responses, with_suggestions=self.__with_suggestions, + with_vectors=self.__with_vectors, ) return [record_model for record_model, _ in search_items]