|
94 | 94 | JOB_CREATION_TIME_KEY,
|
95 | 95 | IMAGE_KEY,
|
96 | 96 | IMAGE_URL_KEY,
|
| 97 | + INDEX_CONTINUOUS_ENABLE_KEY, |
97 | 98 | ITEM_METADATA_SCHEMA_KEY,
|
98 | 99 | ITEMS_KEY,
|
99 | 100 | KEEP_HISTORY_KEY,
|
@@ -1205,6 +1206,37 @@ def delete_custom_index(self, dataset_id: str):
|
1205 | 1206 | requests_command=requests.delete,
|
1206 | 1207 | )
|
1207 | 1208 |
|
| 1209 | + def toggle_continuous_indexing(self, dataset_id: str, enable: bool = True): |
| 1210 | + """ |
| 1211 | + Toggles continuous indexing for a given dataset, which will automatically generate embeddings whenever |
| 1212 | + new images are uploaded. This endpoint is currently locked for most users. Please contact the nucleus team if |
| 1213 | + you wish to use this endpoint. |
| 1214 | +
|
| 1215 | + :param |
| 1216 | + dataset_id: id of dataset that continuous indexing is being toggled for |
| 1217 | + enable: boolean, sets whether we are enabling or disabling continuous indexing. The default behavior is to enable. |
| 1218 | + """ |
| 1219 | + return self.make_request( |
| 1220 | + {INDEX_CONTINUOUS_ENABLE_KEY: enable}, |
| 1221 | + f"indexing/{dataset_id}/toggleContinuous", |
| 1222 | + requests_command=requests.post, |
| 1223 | + ) |
| 1224 | + |
| 1225 | + def kickoff_image_indexing(self, dataset_id: str, enable: bool = True): |
| 1226 | + """ |
| 1227 | + Starts indexing generating embeddings for images without embeddings in a given dataset. These embeddings will |
| 1228 | + be used for autotag and similarity search. This endpoint is currently locked for most users. |
| 1229 | + Please contact the nucleus team if you wish to use this endpoint. |
| 1230 | +
|
| 1231 | + :param |
| 1232 | + dataset_id: id of dataset for generating embeddings on. |
| 1233 | + """ |
| 1234 | + return self.make_request( |
| 1235 | + {}, |
| 1236 | + f"indexing/{dataset_id}/kickoffImage", |
| 1237 | + requests_command=requests.post, |
| 1238 | + ) |
| 1239 | + |
1208 | 1240 | def make_request(
|
1209 | 1241 | self, payload: dict, route: str, requests_command=requests.post
|
1210 | 1242 | ) -> dict:
|
|
0 commit comments