Skip to content

Commit 432f557

Browse files
bharath97-gitbharath-muthinenipre-commit-ci[bot]
authored
feat: added support for with_vectors with query filter in sdk (#5638)
# 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. --> Closes #5636 **Type of change** <!-- Please delete options that are not relevant. Remember to title the PR according to the type of change --> - Improvement (change adding some improvement to an existing functionality) **How Has This Been Tested** <!-- Please add some reference about how your feature has been tested. --> Passed `with_vectors` parameter to the search method while retrieving records and I could see the vectors in the response now. - 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: bharath <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1fe3e0a commit 432f557

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

argilla/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ These are the section headers that we use:
1919
### Changed
2020

2121
- Terms metadata properties accept other values than `str`. ([#5594](https://github.com/argilla-io/argilla/pull/5594))
22+
- Added support for `with_vectors` while fetching records along with a search query. ([#5638](https://github.com/argilla-io/argilla/pull/5638))
2223

2324
## [2.3.0](https://github.com/argilla-io/argilla/compare/v2.2.2...v2.3.0)
2425

argilla/src/argilla/_api/_records.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ def search(
111111
limit: int = 100,
112112
with_suggestions: bool = True,
113113
with_responses: bool = True,
114-
# TODO: Add support for `with_vectors`
114+
with_vectors: Optional[Union[List, bool]] = None,
115115
) -> Tuple[List[Tuple[RecordModel, float]], int]:
116116
include = []
117117
if with_suggestions:
118118
include.append("suggestions")
119119
if with_responses:
120120
include.append("responses")
121+
if with_vectors:
122+
include.append(self._represent_vectors_to_include(with_vectors))
121123
params = {
122124
"offset": offset,
123125
"limit": limit,

argilla/src/argilla/records/_dataset_records.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def _fetch_from_server_with_search(self) -> List[RecordModel]:
132132
offset=self.__offset,
133133
with_responses=self.__with_responses,
134134
with_suggestions=self.__with_suggestions,
135+
with_vectors=self.__with_vectors,
135136
)
136137
return [record_model for record_model, _ in search_items]
137138

0 commit comments

Comments
 (0)