databricks-sdk 0.49.0__py3-none-any.whl → 0.51.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

@@ -47,14 +47,19 @@ class ColumnInfo:
47
47
  @dataclass
48
48
  class CreateEndpoint:
49
49
  name: str
50
- """Name of endpoint"""
50
+ """Name of the vector search endpoint"""
51
51
 
52
52
  endpoint_type: EndpointType
53
- """Type of endpoint."""
53
+ """Type of endpoint"""
54
+
55
+ budget_policy_id: Optional[str] = None
56
+ """The budget policy id to be applied"""
54
57
 
55
58
  def as_dict(self) -> dict:
56
59
  """Serializes the CreateEndpoint into a dictionary suitable for use as a JSON request body."""
57
60
  body = {}
61
+ if self.budget_policy_id is not None:
62
+ body["budget_policy_id"] = self.budget_policy_id
58
63
  if self.endpoint_type is not None:
59
64
  body["endpoint_type"] = self.endpoint_type.value
60
65
  if self.name is not None:
@@ -64,6 +69,8 @@ class CreateEndpoint:
64
69
  def as_shallow_dict(self) -> dict:
65
70
  """Serializes the CreateEndpoint into a shallow dictionary of its immediate attributes."""
66
71
  body = {}
72
+ if self.budget_policy_id is not None:
73
+ body["budget_policy_id"] = self.budget_policy_id
67
74
  if self.endpoint_type is not None:
68
75
  body["endpoint_type"] = self.endpoint_type
69
76
  if self.name is not None:
@@ -73,7 +80,11 @@ class CreateEndpoint:
73
80
  @classmethod
74
81
  def from_dict(cls, d: Dict[str, Any]) -> CreateEndpoint:
75
82
  """Deserializes the CreateEndpoint from a dictionary."""
76
- return cls(endpoint_type=_enum(d, "endpoint_type", EndpointType), name=d.get("name", None))
83
+ return cls(
84
+ budget_policy_id=d.get("budget_policy_id", None),
85
+ endpoint_type=_enum(d, "endpoint_type", EndpointType),
86
+ name=d.get("name", None),
87
+ )
77
88
 
78
89
 
79
90
  @dataclass
@@ -88,12 +99,11 @@ class CreateVectorIndexRequest:
88
99
  """Primary key of the index"""
89
100
 
90
101
  index_type: VectorIndexType
91
- """There are 2 types of Vector Search indexes:
92
-
93
- - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and
94
- incrementally updating the index as the underlying data in the Delta Table changes. -
95
- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through
96
- our REST and SDK APIs. With this model, the user manages index updates."""
102
+ """There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that automatically syncs
103
+ with a source Delta Table, automatically and incrementally updating the index as the underlying
104
+ data in the Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write
105
+ of vectors and metadata through our REST and SDK APIs. With this model, the user manages index
106
+ updates."""
97
107
 
98
108
  delta_sync_index_spec: Optional[DeltaSyncVectorIndexSpecRequest] = None
99
109
  """Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`."""
@@ -149,33 +159,39 @@ class CreateVectorIndexRequest:
149
159
 
150
160
 
151
161
  @dataclass
152
- class CreateVectorIndexResponse:
153
- vector_index: Optional[VectorIndex] = None
162
+ class CustomTag:
163
+ key: str
164
+ """Key field for a vector search endpoint tag."""
165
+
166
+ value: Optional[str] = None
167
+ """[Optional] Value field for a vector search endpoint tag."""
154
168
 
155
169
  def as_dict(self) -> dict:
156
- """Serializes the CreateVectorIndexResponse into a dictionary suitable for use as a JSON request body."""
170
+ """Serializes the CustomTag into a dictionary suitable for use as a JSON request body."""
157
171
  body = {}
158
- if self.vector_index:
159
- body["vector_index"] = self.vector_index.as_dict()
172
+ if self.key is not None:
173
+ body["key"] = self.key
174
+ if self.value is not None:
175
+ body["value"] = self.value
160
176
  return body
161
177
 
162
178
  def as_shallow_dict(self) -> dict:
163
- """Serializes the CreateVectorIndexResponse into a shallow dictionary of its immediate attributes."""
179
+ """Serializes the CustomTag into a shallow dictionary of its immediate attributes."""
164
180
  body = {}
165
- if self.vector_index:
166
- body["vector_index"] = self.vector_index
181
+ if self.key is not None:
182
+ body["key"] = self.key
183
+ if self.value is not None:
184
+ body["value"] = self.value
167
185
  return body
168
186
 
169
187
  @classmethod
170
- def from_dict(cls, d: Dict[str, Any]) -> CreateVectorIndexResponse:
171
- """Deserializes the CreateVectorIndexResponse from a dictionary."""
172
- return cls(vector_index=_from_dict(d, "vector_index", VectorIndex))
188
+ def from_dict(cls, d: Dict[str, Any]) -> CustomTag:
189
+ """Deserializes the CustomTag from a dictionary."""
190
+ return cls(key=d.get("key", None), value=d.get("value", None))
173
191
 
174
192
 
175
193
  @dataclass
176
194
  class DeleteDataResult:
177
- """Result of the upsert or delete operation."""
178
-
179
195
  failed_primary_keys: Optional[List[str]] = None
180
196
  """List of primary keys for rows that failed to process."""
181
197
 
@@ -209,51 +225,14 @@ class DeleteDataResult:
209
225
 
210
226
 
211
227
  class DeleteDataStatus(Enum):
212
- """Status of the delete operation."""
213
228
 
214
229
  FAILURE = "FAILURE"
215
230
  PARTIAL_SUCCESS = "PARTIAL_SUCCESS"
216
231
  SUCCESS = "SUCCESS"
217
232
 
218
233
 
219
- @dataclass
220
- class DeleteDataVectorIndexRequest:
221
- """Request payload for deleting data from a vector index."""
222
-
223
- primary_keys: List[str]
224
- """List of primary keys for the data to be deleted."""
225
-
226
- index_name: Optional[str] = None
227
- """Name of the vector index where data is to be deleted. Must be a Direct Vector Access Index."""
228
-
229
- def as_dict(self) -> dict:
230
- """Serializes the DeleteDataVectorIndexRequest into a dictionary suitable for use as a JSON request body."""
231
- body = {}
232
- if self.index_name is not None:
233
- body["index_name"] = self.index_name
234
- if self.primary_keys:
235
- body["primary_keys"] = [v for v in self.primary_keys]
236
- return body
237
-
238
- def as_shallow_dict(self) -> dict:
239
- """Serializes the DeleteDataVectorIndexRequest into a shallow dictionary of its immediate attributes."""
240
- body = {}
241
- if self.index_name is not None:
242
- body["index_name"] = self.index_name
243
- if self.primary_keys:
244
- body["primary_keys"] = self.primary_keys
245
- return body
246
-
247
- @classmethod
248
- def from_dict(cls, d: Dict[str, Any]) -> DeleteDataVectorIndexRequest:
249
- """Deserializes the DeleteDataVectorIndexRequest from a dictionary."""
250
- return cls(index_name=d.get("index_name", None), primary_keys=d.get("primary_keys", None))
251
-
252
-
253
234
  @dataclass
254
235
  class DeleteDataVectorIndexResponse:
255
- """Response to a delete data vector index request."""
256
-
257
236
  result: Optional[DeleteDataResult] = None
258
237
  """Result of the upsert or delete operation."""
259
238
 
@@ -331,20 +310,17 @@ class DeltaSyncVectorIndexSpecRequest:
331
310
  """The columns that contain the embedding source."""
332
311
 
333
312
  embedding_vector_columns: Optional[List[EmbeddingVectorColumn]] = None
334
- """The columns that contain the embedding vectors. The format should be array[double]."""
313
+ """The columns that contain the embedding vectors."""
335
314
 
336
315
  embedding_writeback_table: Optional[str] = None
337
- """[Optional] Automatically sync the vector index contents and computed embeddings to the specified
338
- Delta table. The only supported table name is the index name with the suffix `_writeback_table`."""
316
+ """[Optional] Name of the Delta table to sync the vector index contents and computed embeddings to."""
339
317
 
340
318
  pipeline_type: Optional[PipelineType] = None
341
- """Pipeline execution mode.
342
-
343
- - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing
344
- after successfully refreshing the source table in the pipeline once, ensuring the table is
345
- updated based on the data available when the update started. - `CONTINUOUS`: If the pipeline
346
- uses continuous execution, the pipeline processes new data as it arrives in the source table to
347
- keep vector index fresh."""
319
+ """Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the triggered execution mode, the
320
+ system stops processing after successfully refreshing the source table in the pipeline once,
321
+ ensuring the table is updated based on the data available when the update started. -
322
+ `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it
323
+ arrives in the source table to keep vector index fresh."""
348
324
 
349
325
  source_table: Optional[str] = None
350
326
  """The name of the source table."""
@@ -411,13 +387,11 @@ class DeltaSyncVectorIndexSpecResponse:
411
387
  """The ID of the pipeline that is used to sync the index."""
412
388
 
413
389
  pipeline_type: Optional[PipelineType] = None
414
- """Pipeline execution mode.
415
-
416
- - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing
417
- after successfully refreshing the source table in the pipeline once, ensuring the table is
418
- updated based on the data available when the update started. - `CONTINUOUS`: If the pipeline
419
- uses continuous execution, the pipeline processes new data as it arrives in the source table to
420
- keep vector index fresh."""
390
+ """Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the triggered execution mode, the
391
+ system stops processing after successfully refreshing the source table in the pipeline once,
392
+ ensuring the table is updated based on the data available when the update started. -
393
+ `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it
394
+ arrives in the source table to keep vector index fresh."""
421
395
 
422
396
  source_table: Optional[str] = None
423
397
  """The name of the source table."""
@@ -472,17 +446,15 @@ class DeltaSyncVectorIndexSpecResponse:
472
446
  @dataclass
473
447
  class DirectAccessVectorIndexSpec:
474
448
  embedding_source_columns: Optional[List[EmbeddingSourceColumn]] = None
475
- """Contains the optional model endpoint to use during query time."""
449
+ """The columns that contain the embedding source. The format should be array[double]."""
476
450
 
477
451
  embedding_vector_columns: Optional[List[EmbeddingVectorColumn]] = None
452
+ """The columns that contain the embedding vectors. The format should be array[double]."""
478
453
 
479
454
  schema_json: Optional[str] = None
480
- """The schema of the index in JSON format.
481
-
482
- Supported types are `integer`, `long`, `float`, `double`, `boolean`, `string`, `date`,
483
- `timestamp`.
484
-
485
- Supported types for vector column: `array<float>`, `array<double>`,`."""
455
+ """The schema of the index in JSON format. Supported types are `integer`, `long`, `float`,
456
+ `double`, `boolean`, `string`, `date`, `timestamp`. Supported types for vector column:
457
+ `array<float>`, `array<double>`,`."""
486
458
 
487
459
  def as_dict(self) -> dict:
488
460
  """Serializes the DirectAccessVectorIndexSpec into a dictionary suitable for use as a JSON request body."""
@@ -588,11 +560,17 @@ class EndpointInfo:
588
560
  creator: Optional[str] = None
589
561
  """Creator of the endpoint"""
590
562
 
563
+ custom_tags: Optional[List[CustomTag]] = None
564
+ """The custom tags assigned to the endpoint"""
565
+
566
+ effective_budget_policy_id: Optional[str] = None
567
+ """The budget policy id applied to the endpoint"""
568
+
591
569
  endpoint_status: Optional[EndpointStatus] = None
592
570
  """Current status of the endpoint"""
593
571
 
594
572
  endpoint_type: Optional[EndpointType] = None
595
- """Type of endpoint."""
573
+ """Type of endpoint"""
596
574
 
597
575
  id: Optional[str] = None
598
576
  """Unique identifier of the endpoint"""
@@ -604,7 +582,7 @@ class EndpointInfo:
604
582
  """User who last updated the endpoint"""
605
583
 
606
584
  name: Optional[str] = None
607
- """Name of endpoint"""
585
+ """Name of the vector search endpoint"""
608
586
 
609
587
  num_indexes: Optional[int] = None
610
588
  """Number of indexes on the endpoint"""
@@ -616,6 +594,10 @@ class EndpointInfo:
616
594
  body["creation_timestamp"] = self.creation_timestamp
617
595
  if self.creator is not None:
618
596
  body["creator"] = self.creator
597
+ if self.custom_tags:
598
+ body["custom_tags"] = [v.as_dict() for v in self.custom_tags]
599
+ if self.effective_budget_policy_id is not None:
600
+ body["effective_budget_policy_id"] = self.effective_budget_policy_id
619
601
  if self.endpoint_status:
620
602
  body["endpoint_status"] = self.endpoint_status.as_dict()
621
603
  if self.endpoint_type is not None:
@@ -639,6 +621,10 @@ class EndpointInfo:
639
621
  body["creation_timestamp"] = self.creation_timestamp
640
622
  if self.creator is not None:
641
623
  body["creator"] = self.creator
624
+ if self.custom_tags:
625
+ body["custom_tags"] = self.custom_tags
626
+ if self.effective_budget_policy_id is not None:
627
+ body["effective_budget_policy_id"] = self.effective_budget_policy_id
642
628
  if self.endpoint_status:
643
629
  body["endpoint_status"] = self.endpoint_status
644
630
  if self.endpoint_type is not None:
@@ -661,6 +647,8 @@ class EndpointInfo:
661
647
  return cls(
662
648
  creation_timestamp=d.get("creation_timestamp", None),
663
649
  creator=d.get("creator", None),
650
+ custom_tags=_repeated_dict(d, "custom_tags", CustomTag),
651
+ effective_budget_policy_id=d.get("effective_budget_policy_id", None),
664
652
  endpoint_status=_from_dict(d, "endpoint_status", EndpointStatus),
665
653
  endpoint_type=_enum(d, "endpoint_type", EndpointType),
666
654
  id=d.get("id", None),
@@ -756,7 +744,14 @@ class ListEndpointResponse:
756
744
 
757
745
  @dataclass
758
746
  class ListValue:
747
+ """copied from proto3 / Google Well Known Types, source:
748
+ https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
749
+ `ListValue` is a wrapper around a repeated field of values.
750
+
751
+ The JSON representation for `ListValue` is JSON array."""
752
+
759
753
  values: Optional[List[Value]] = None
754
+ """Repeated field of dynamically typed values."""
760
755
 
761
756
  def as_dict(self) -> dict:
762
757
  """Serializes the ListValue into a dictionary suitable for use as a JSON request body."""
@@ -856,12 +851,11 @@ class MiniVectorIndex:
856
851
  """Name of the endpoint associated with the index"""
857
852
 
858
853
  index_type: Optional[VectorIndexType] = None
859
- """There are 2 types of Vector Search indexes:
860
-
861
- - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and
862
- incrementally updating the index as the underlying data in the Delta Table changes. -
863
- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through
864
- our REST and SDK APIs. With this model, the user manages index updates."""
854
+ """There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that automatically syncs
855
+ with a source Delta Table, automatically and incrementally updating the index as the underlying
856
+ data in the Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write
857
+ of vectors and metadata through our REST and SDK APIs. With this model, the user manages index
858
+ updates."""
865
859
 
866
860
  name: Optional[str] = None
867
861
  """Name of the index"""
@@ -911,14 +905,69 @@ class MiniVectorIndex:
911
905
  )
912
906
 
913
907
 
914
- class PipelineType(Enum):
915
- """Pipeline execution mode.
908
+ @dataclass
909
+ class PatchEndpointBudgetPolicyRequest:
910
+ budget_policy_id: str
911
+ """The budget policy id to be applied"""
912
+
913
+ endpoint_name: Optional[str] = None
914
+ """Name of the vector search endpoint"""
915
+
916
+ def as_dict(self) -> dict:
917
+ """Serializes the PatchEndpointBudgetPolicyRequest into a dictionary suitable for use as a JSON request body."""
918
+ body = {}
919
+ if self.budget_policy_id is not None:
920
+ body["budget_policy_id"] = self.budget_policy_id
921
+ if self.endpoint_name is not None:
922
+ body["endpoint_name"] = self.endpoint_name
923
+ return body
924
+
925
+ def as_shallow_dict(self) -> dict:
926
+ """Serializes the PatchEndpointBudgetPolicyRequest into a shallow dictionary of its immediate attributes."""
927
+ body = {}
928
+ if self.budget_policy_id is not None:
929
+ body["budget_policy_id"] = self.budget_policy_id
930
+ if self.endpoint_name is not None:
931
+ body["endpoint_name"] = self.endpoint_name
932
+ return body
933
+
934
+ @classmethod
935
+ def from_dict(cls, d: Dict[str, Any]) -> PatchEndpointBudgetPolicyRequest:
936
+ """Deserializes the PatchEndpointBudgetPolicyRequest from a dictionary."""
937
+ return cls(budget_policy_id=d.get("budget_policy_id", None), endpoint_name=d.get("endpoint_name", None))
938
+
916
939
 
917
- - `TRIGGERED`: If the pipeline uses the triggered execution mode, the system stops processing
918
- after successfully refreshing the source table in the pipeline once, ensuring the table is
919
- updated based on the data available when the update started. - `CONTINUOUS`: If the pipeline
920
- uses continuous execution, the pipeline processes new data as it arrives in the source table to
921
- keep vector index fresh."""
940
+ @dataclass
941
+ class PatchEndpointBudgetPolicyResponse:
942
+ effective_budget_policy_id: Optional[str] = None
943
+ """The budget policy applied to the vector search endpoint."""
944
+
945
+ def as_dict(self) -> dict:
946
+ """Serializes the PatchEndpointBudgetPolicyResponse into a dictionary suitable for use as a JSON request body."""
947
+ body = {}
948
+ if self.effective_budget_policy_id is not None:
949
+ body["effective_budget_policy_id"] = self.effective_budget_policy_id
950
+ return body
951
+
952
+ def as_shallow_dict(self) -> dict:
953
+ """Serializes the PatchEndpointBudgetPolicyResponse into a shallow dictionary of its immediate attributes."""
954
+ body = {}
955
+ if self.effective_budget_policy_id is not None:
956
+ body["effective_budget_policy_id"] = self.effective_budget_policy_id
957
+ return body
958
+
959
+ @classmethod
960
+ def from_dict(cls, d: Dict[str, Any]) -> PatchEndpointBudgetPolicyResponse:
961
+ """Deserializes the PatchEndpointBudgetPolicyResponse from a dictionary."""
962
+ return cls(effective_budget_policy_id=d.get("effective_budget_policy_id", None))
963
+
964
+
965
+ class PipelineType(Enum):
966
+ """Pipeline execution mode. - `TRIGGERED`: If the pipeline uses the triggered execution mode, the
967
+ system stops processing after successfully refreshing the source table in the pipeline once,
968
+ ensuring the table is updated based on the data available when the update started. -
969
+ `CONTINUOUS`: If the pipeline uses continuous execution, the pipeline processes new data as it
970
+ arrives in the source table to keep vector index fresh."""
922
971
 
923
972
  CONTINUOUS = "CONTINUOUS"
924
973
  TRIGGERED = "TRIGGERED"
@@ -980,9 +1029,11 @@ class QueryVectorIndexRequest:
980
1029
  filters_json: Optional[str] = None
981
1030
  """JSON string representing query filters.
982
1031
 
983
- Example filters: - `{"id <": 5}`: Filter for id less than 5. - `{"id >": 5}`: Filter for id
984
- greater than 5. - `{"id <=": 5}`: Filter for id less than equal to 5. - `{"id >=": 5}`: Filter
985
- for id greater than equal to 5. - `{"id": 5}`: Filter for id equal to 5."""
1032
+ Example filters:
1033
+
1034
+ - `{"id <": 5}`: Filter for id less than 5. - `{"id >": 5}`: Filter for id greater than 5. -
1035
+ `{"id <=": 5}`: Filter for id less than equal to 5. - `{"id >=": 5}`: Filter for id greater than
1036
+ equal to 5. - `{"id": 5}`: Filter for id equal to 5."""
986
1037
 
987
1038
  index_name: Optional[str] = None
988
1039
  """Name of the vector index to query."""
@@ -1114,7 +1165,7 @@ class QueryVectorIndexResponse:
1114
1165
  class ResultData:
1115
1166
  """Data returned in the query result."""
1116
1167
 
1117
- data_array: Optional[List[List[str]]] = None
1168
+ data_array: Optional[List[ListValue]] = None
1118
1169
  """Data rows returned in the query."""
1119
1170
 
1120
1171
  row_count: Optional[int] = None
@@ -1124,7 +1175,7 @@ class ResultData:
1124
1175
  """Serializes the ResultData into a dictionary suitable for use as a JSON request body."""
1125
1176
  body = {}
1126
1177
  if self.data_array:
1127
- body["data_array"] = [v for v in self.data_array]
1178
+ body["data_array"] = [v.as_dict() for v in self.data_array]
1128
1179
  if self.row_count is not None:
1129
1180
  body["row_count"] = self.row_count
1130
1181
  return body
@@ -1141,7 +1192,7 @@ class ResultData:
1141
1192
  @classmethod
1142
1193
  def from_dict(cls, d: Dict[str, Any]) -> ResultData:
1143
1194
  """Deserializes the ResultData from a dictionary."""
1144
- return cls(data_array=d.get("data_array", None), row_count=d.get("row_count", None))
1195
+ return cls(data_array=_repeated_dict(d, "data_array", ListValue), row_count=d.get("row_count", None))
1145
1196
 
1146
1197
 
1147
1198
  @dataclass
@@ -1180,8 +1231,6 @@ class ResultManifest:
1180
1231
 
1181
1232
  @dataclass
1182
1233
  class ScanVectorIndexRequest:
1183
- """Request payload for scanning data from a vector index."""
1184
-
1185
1234
  index_name: Optional[str] = None
1186
1235
  """Name of the vector index to scan."""
1187
1236
 
@@ -1259,6 +1308,15 @@ class ScanVectorIndexResponse:
1259
1308
 
1260
1309
  @dataclass
1261
1310
  class Struct:
1311
+ """copied from proto3 / Google Well Known Types, source:
1312
+ https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1313
+ `Struct` represents a structured data value, consisting of fields which map to dynamically typed
1314
+ values. In some languages, `Struct` might be supported by a native representation. For example,
1315
+ in scripting languages like JS a struct is represented as an object. The details of that
1316
+ representation are described together with the proto support for the language.
1317
+
1318
+ The JSON representation for `Struct` is JSON object."""
1319
+
1262
1320
  fields: Optional[List[MapStringValueEntry]] = None
1263
1321
  """Data entry, corresponding to a row in a vector index."""
1264
1322
 
@@ -1301,9 +1359,71 @@ class SyncIndexResponse:
1301
1359
 
1302
1360
 
1303
1361
  @dataclass
1304
- class UpsertDataResult:
1305
- """Result of the upsert or delete operation."""
1362
+ class UpdateEndpointCustomTagsRequest:
1363
+ custom_tags: List[CustomTag]
1364
+ """The new custom tags for the vector search endpoint"""
1365
+
1366
+ endpoint_name: Optional[str] = None
1367
+ """Name of the vector search endpoint"""
1368
+
1369
+ def as_dict(self) -> dict:
1370
+ """Serializes the UpdateEndpointCustomTagsRequest into a dictionary suitable for use as a JSON request body."""
1371
+ body = {}
1372
+ if self.custom_tags:
1373
+ body["custom_tags"] = [v.as_dict() for v in self.custom_tags]
1374
+ if self.endpoint_name is not None:
1375
+ body["endpoint_name"] = self.endpoint_name
1376
+ return body
1377
+
1378
+ def as_shallow_dict(self) -> dict:
1379
+ """Serializes the UpdateEndpointCustomTagsRequest into a shallow dictionary of its immediate attributes."""
1380
+ body = {}
1381
+ if self.custom_tags:
1382
+ body["custom_tags"] = self.custom_tags
1383
+ if self.endpoint_name is not None:
1384
+ body["endpoint_name"] = self.endpoint_name
1385
+ return body
1386
+
1387
+ @classmethod
1388
+ def from_dict(cls, d: Dict[str, Any]) -> UpdateEndpointCustomTagsRequest:
1389
+ """Deserializes the UpdateEndpointCustomTagsRequest from a dictionary."""
1390
+ return cls(custom_tags=_repeated_dict(d, "custom_tags", CustomTag), endpoint_name=d.get("endpoint_name", None))
1391
+
1392
+
1393
+ @dataclass
1394
+ class UpdateEndpointCustomTagsResponse:
1395
+ custom_tags: Optional[List[CustomTag]] = None
1396
+ """All the custom tags that are applied to the vector search endpoint."""
1397
+
1398
+ name: Optional[str] = None
1399
+ """The name of the vector search endpoint whose custom tags were updated."""
1400
+
1401
+ def as_dict(self) -> dict:
1402
+ """Serializes the UpdateEndpointCustomTagsResponse into a dictionary suitable for use as a JSON request body."""
1403
+ body = {}
1404
+ if self.custom_tags:
1405
+ body["custom_tags"] = [v.as_dict() for v in self.custom_tags]
1406
+ if self.name is not None:
1407
+ body["name"] = self.name
1408
+ return body
1409
+
1410
+ def as_shallow_dict(self) -> dict:
1411
+ """Serializes the UpdateEndpointCustomTagsResponse into a shallow dictionary of its immediate attributes."""
1412
+ body = {}
1413
+ if self.custom_tags:
1414
+ body["custom_tags"] = self.custom_tags
1415
+ if self.name is not None:
1416
+ body["name"] = self.name
1417
+ return body
1418
+
1419
+ @classmethod
1420
+ def from_dict(cls, d: Dict[str, Any]) -> UpdateEndpointCustomTagsResponse:
1421
+ """Deserializes the UpdateEndpointCustomTagsResponse from a dictionary."""
1422
+ return cls(custom_tags=_repeated_dict(d, "custom_tags", CustomTag), name=d.get("name", None))
1423
+
1306
1424
 
1425
+ @dataclass
1426
+ class UpsertDataResult:
1307
1427
  failed_primary_keys: Optional[List[str]] = None
1308
1428
  """List of primary keys for rows that failed to process."""
1309
1429
 
@@ -1337,7 +1457,6 @@ class UpsertDataResult:
1337
1457
 
1338
1458
 
1339
1459
  class UpsertDataStatus(Enum):
1340
- """Status of the upsert operation."""
1341
1460
 
1342
1461
  FAILURE = "FAILURE"
1343
1462
  PARTIAL_SUCCESS = "PARTIAL_SUCCESS"
@@ -1346,8 +1465,6 @@ class UpsertDataStatus(Enum):
1346
1465
 
1347
1466
  @dataclass
1348
1467
  class UpsertDataVectorIndexRequest:
1349
- """Request payload for upserting data into a vector index."""
1350
-
1351
1468
  inputs_json: str
1352
1469
  """JSON string representing the data to be upserted."""
1353
1470
 
@@ -1380,8 +1497,6 @@ class UpsertDataVectorIndexRequest:
1380
1497
 
1381
1498
  @dataclass
1382
1499
  class UpsertDataVectorIndexResponse:
1383
- """Response to an upsert data vector index request."""
1384
-
1385
1500
  result: Optional[UpsertDataResult] = None
1386
1501
  """Result of the upsert or delete operation."""
1387
1502
 
@@ -1417,14 +1532,25 @@ class Value:
1417
1532
  bool_value: Optional[bool] = None
1418
1533
 
1419
1534
  list_value: Optional[ListValue] = None
1420
-
1421
- null_value: Optional[str] = None
1535
+ """copied from proto3 / Google Well Known Types, source:
1536
+ https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1537
+ `ListValue` is a wrapper around a repeated field of values.
1538
+
1539
+ The JSON representation for `ListValue` is JSON array."""
1422
1540
 
1423
1541
  number_value: Optional[float] = None
1424
1542
 
1425
1543
  string_value: Optional[str] = None
1426
1544
 
1427
1545
  struct_value: Optional[Struct] = None
1546
+ """copied from proto3 / Google Well Known Types, source:
1547
+ https://github.com/protocolbuffers/protobuf/blob/450d24ca820750c5db5112a6f0b0c2efb9758021/src/google/protobuf/struct.proto
1548
+ `Struct` represents a structured data value, consisting of fields which map to dynamically typed
1549
+ values. In some languages, `Struct` might be supported by a native representation. For example,
1550
+ in scripting languages like JS a struct is represented as an object. The details of that
1551
+ representation are described together with the proto support for the language.
1552
+
1553
+ The JSON representation for `Struct` is JSON object."""
1428
1554
 
1429
1555
  def as_dict(self) -> dict:
1430
1556
  """Serializes the Value into a dictionary suitable for use as a JSON request body."""
@@ -1433,8 +1559,6 @@ class Value:
1433
1559
  body["bool_value"] = self.bool_value
1434
1560
  if self.list_value:
1435
1561
  body["list_value"] = self.list_value.as_dict()
1436
- if self.null_value is not None:
1437
- body["null_value"] = self.null_value
1438
1562
  if self.number_value is not None:
1439
1563
  body["number_value"] = self.number_value
1440
1564
  if self.string_value is not None:
@@ -1450,8 +1574,6 @@ class Value:
1450
1574
  body["bool_value"] = self.bool_value
1451
1575
  if self.list_value:
1452
1576
  body["list_value"] = self.list_value
1453
- if self.null_value is not None:
1454
- body["null_value"] = self.null_value
1455
1577
  if self.number_value is not None:
1456
1578
  body["number_value"] = self.number_value
1457
1579
  if self.string_value is not None:
@@ -1466,7 +1588,6 @@ class Value:
1466
1588
  return cls(
1467
1589
  bool_value=d.get("bool_value", None),
1468
1590
  list_value=_from_dict(d, "list_value", ListValue),
1469
- null_value=d.get("null_value", None),
1470
1591
  number_value=d.get("number_value", None),
1471
1592
  string_value=d.get("string_value", None),
1472
1593
  struct_value=_from_dict(d, "struct_value", Struct),
@@ -1486,12 +1607,11 @@ class VectorIndex:
1486
1607
  """Name of the endpoint associated with the index"""
1487
1608
 
1488
1609
  index_type: Optional[VectorIndexType] = None
1489
- """There are 2 types of Vector Search indexes:
1490
-
1491
- - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and
1492
- incrementally updating the index as the underlying data in the Delta Table changes. -
1493
- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through
1494
- our REST and SDK APIs. With this model, the user manages index updates."""
1610
+ """There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that automatically syncs
1611
+ with a source Delta Table, automatically and incrementally updating the index as the underlying
1612
+ data in the Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write
1613
+ of vectors and metadata through our REST and SDK APIs. With this model, the user manages index
1614
+ updates."""
1495
1615
 
1496
1616
  name: Optional[str] = None
1497
1617
  """Name of the index"""
@@ -1610,12 +1730,11 @@ class VectorIndexStatus:
1610
1730
 
1611
1731
 
1612
1732
  class VectorIndexType(Enum):
1613
- """There are 2 types of Vector Search indexes:
1614
-
1615
- - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and
1616
- incrementally updating the index as the underlying data in the Delta Table changes. -
1617
- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through
1618
- our REST and SDK APIs. With this model, the user manages index updates."""
1733
+ """There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that automatically syncs
1734
+ with a source Delta Table, automatically and incrementally updating the index as the underlying
1735
+ data in the Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write
1736
+ of vectors and metadata through our REST and SDK APIs. With this model, the user manages index
1737
+ updates."""
1619
1738
 
1620
1739
  DELTA_SYNC = "DELTA_SYNC"
1621
1740
  DIRECT_ACCESS = "DIRECT_ACCESS"
@@ -1661,21 +1780,27 @@ class VectorSearchEndpointsAPI:
1661
1780
  attempt += 1
1662
1781
  raise TimeoutError(f"timed out after {timeout}: {status_message}")
1663
1782
 
1664
- def create_endpoint(self, name: str, endpoint_type: EndpointType) -> Wait[EndpointInfo]:
1783
+ def create_endpoint(
1784
+ self, name: str, endpoint_type: EndpointType, *, budget_policy_id: Optional[str] = None
1785
+ ) -> Wait[EndpointInfo]:
1665
1786
  """Create an endpoint.
1666
1787
 
1667
1788
  Create a new endpoint.
1668
1789
 
1669
1790
  :param name: str
1670
- Name of endpoint
1791
+ Name of the vector search endpoint
1671
1792
  :param endpoint_type: :class:`EndpointType`
1672
- Type of endpoint.
1793
+ Type of endpoint
1794
+ :param budget_policy_id: str (optional)
1795
+ The budget policy id to be applied
1673
1796
 
1674
1797
  :returns:
1675
1798
  Long-running operation waiter for :class:`EndpointInfo`.
1676
1799
  See :method:wait_get_endpoint_vector_search_endpoint_online for more details.
1677
1800
  """
1678
1801
  body = {}
1802
+ if budget_policy_id is not None:
1803
+ body["budget_policy_id"] = budget_policy_id
1679
1804
  if endpoint_type is not None:
1680
1805
  body["endpoint_type"] = endpoint_type.value
1681
1806
  if name is not None:
@@ -1693,26 +1818,39 @@ class VectorSearchEndpointsAPI:
1693
1818
  )
1694
1819
 
1695
1820
  def create_endpoint_and_wait(
1696
- self, name: str, endpoint_type: EndpointType, timeout=timedelta(minutes=20)
1821
+ self,
1822
+ name: str,
1823
+ endpoint_type: EndpointType,
1824
+ *,
1825
+ budget_policy_id: Optional[str] = None,
1826
+ timeout=timedelta(minutes=20),
1697
1827
  ) -> EndpointInfo:
1698
- return self.create_endpoint(endpoint_type=endpoint_type, name=name).result(timeout=timeout)
1828
+ return self.create_endpoint(budget_policy_id=budget_policy_id, endpoint_type=endpoint_type, name=name).result(
1829
+ timeout=timeout
1830
+ )
1699
1831
 
1700
1832
  def delete_endpoint(self, endpoint_name: str):
1701
1833
  """Delete an endpoint.
1702
1834
 
1835
+ Delete a vector search endpoint.
1836
+
1703
1837
  :param endpoint_name: str
1704
- Name of the endpoint
1838
+ Name of the vector search endpoint
1705
1839
 
1706
1840
 
1707
1841
  """
1708
1842
 
1709
- headers = {}
1843
+ headers = {
1844
+ "Accept": "application/json",
1845
+ }
1710
1846
 
1711
1847
  self._api.do("DELETE", f"/api/2.0/vector-search/endpoints/{endpoint_name}", headers=headers)
1712
1848
 
1713
1849
  def get_endpoint(self, endpoint_name: str) -> EndpointInfo:
1714
1850
  """Get an endpoint.
1715
1851
 
1852
+ Get details for a single vector search endpoint.
1853
+
1716
1854
  :param endpoint_name: str
1717
1855
  Name of the endpoint
1718
1856
 
@@ -1729,6 +1867,8 @@ class VectorSearchEndpointsAPI:
1729
1867
  def list_endpoints(self, *, page_token: Optional[str] = None) -> Iterator[EndpointInfo]:
1730
1868
  """List all endpoints.
1731
1869
 
1870
+ List all vector search endpoints in the workspace.
1871
+
1732
1872
  :param page_token: str (optional)
1733
1873
  Token for pagination
1734
1874
 
@@ -1751,14 +1891,66 @@ class VectorSearchEndpointsAPI:
1751
1891
  return
1752
1892
  query["page_token"] = json["next_page_token"]
1753
1893
 
1894
+ def update_endpoint_budget_policy(
1895
+ self, endpoint_name: str, budget_policy_id: str
1896
+ ) -> PatchEndpointBudgetPolicyResponse:
1897
+ """Update the budget policy of an endpoint.
1898
+
1899
+ Update the budget policy of an endpoint
1900
+
1901
+ :param endpoint_name: str
1902
+ Name of the vector search endpoint
1903
+ :param budget_policy_id: str
1904
+ The budget policy id to be applied
1905
+
1906
+ :returns: :class:`PatchEndpointBudgetPolicyResponse`
1907
+ """
1908
+ body = {}
1909
+ if budget_policy_id is not None:
1910
+ body["budget_policy_id"] = budget_policy_id
1911
+ headers = {
1912
+ "Accept": "application/json",
1913
+ "Content-Type": "application/json",
1914
+ }
1915
+
1916
+ res = self._api.do(
1917
+ "PATCH", f"/api/2.0/vector-search/endpoints/{endpoint_name}/budget-policy", body=body, headers=headers
1918
+ )
1919
+ return PatchEndpointBudgetPolicyResponse.from_dict(res)
1920
+
1921
+ def update_endpoint_custom_tags(
1922
+ self, endpoint_name: str, custom_tags: List[CustomTag]
1923
+ ) -> UpdateEndpointCustomTagsResponse:
1924
+ """Update the custom tags of an endpoint.
1925
+
1926
+ :param endpoint_name: str
1927
+ Name of the vector search endpoint
1928
+ :param custom_tags: List[:class:`CustomTag`]
1929
+ The new custom tags for the vector search endpoint
1930
+
1931
+ :returns: :class:`UpdateEndpointCustomTagsResponse`
1932
+ """
1933
+ body = {}
1934
+ if custom_tags is not None:
1935
+ body["custom_tags"] = [v.as_dict() for v in custom_tags]
1936
+ headers = {
1937
+ "Accept": "application/json",
1938
+ "Content-Type": "application/json",
1939
+ }
1940
+
1941
+ res = self._api.do(
1942
+ "PATCH", f"/api/2.0/vector-search/endpoints/{endpoint_name}/tags", body=body, headers=headers
1943
+ )
1944
+ return UpdateEndpointCustomTagsResponse.from_dict(res)
1945
+
1754
1946
 
1755
1947
  class VectorSearchIndexesAPI:
1756
1948
  """**Index**: An efficient representation of your embedding vectors that supports real-time and efficient
1757
1949
  approximate nearest neighbor (ANN) search queries.
1758
1950
 
1759
- There are 2 types of Vector Search indexes: * **Delta Sync Index**: An index that automatically syncs with
1951
+ There are 2 types of Vector Search indexes: - **Delta Sync Index**: An index that automatically syncs with
1760
1952
  a source Delta Table, automatically and incrementally updating the index as the underlying data in the
1761
- Delta Table changes. * **Direct Vector Access Index**: An index that supports direct read and write of
1953
+ Delta Table changes. - **Direct Vector Access Index**: An index that supports direct read and write of
1762
1954
  vectors and metadata through our REST and SDK APIs. With this model, the user manages index updates."""
1763
1955
 
1764
1956
  def __init__(self, api_client):
@@ -1773,7 +1965,7 @@ class VectorSearchIndexesAPI:
1773
1965
  *,
1774
1966
  delta_sync_index_spec: Optional[DeltaSyncVectorIndexSpecRequest] = None,
1775
1967
  direct_access_index_spec: Optional[DirectAccessVectorIndexSpec] = None,
1776
- ) -> CreateVectorIndexResponse:
1968
+ ) -> VectorIndex:
1777
1969
  """Create an index.
1778
1970
 
1779
1971
  Create a new index.
@@ -1785,18 +1977,16 @@ class VectorSearchIndexesAPI:
1785
1977
  :param primary_key: str
1786
1978
  Primary key of the index
1787
1979
  :param index_type: :class:`VectorIndexType`
1788
- There are 2 types of Vector Search indexes:
1789
-
1790
- - `DELTA_SYNC`: An index that automatically syncs with a source Delta Table, automatically and
1791
- incrementally updating the index as the underlying data in the Delta Table changes. -
1792
- `DIRECT_ACCESS`: An index that supports direct read and write of vectors and metadata through our
1793
- REST and SDK APIs. With this model, the user manages index updates.
1980
+ There are 2 types of Vector Search indexes: - `DELTA_SYNC`: An index that automatically syncs with a
1981
+ source Delta Table, automatically and incrementally updating the index as the underlying data in the
1982
+ Delta Table changes. - `DIRECT_ACCESS`: An index that supports direct read and write of vectors and
1983
+ metadata through our REST and SDK APIs. With this model, the user manages index updates.
1794
1984
  :param delta_sync_index_spec: :class:`DeltaSyncVectorIndexSpecRequest` (optional)
1795
1985
  Specification for Delta Sync Index. Required if `index_type` is `DELTA_SYNC`.
1796
1986
  :param direct_access_index_spec: :class:`DirectAccessVectorIndexSpec` (optional)
1797
1987
  Specification for Direct Vector Access Index. Required if `index_type` is `DIRECT_ACCESS`.
1798
1988
 
1799
- :returns: :class:`CreateVectorIndexResponse`
1989
+ :returns: :class:`VectorIndex`
1800
1990
  """
1801
1991
  body = {}
1802
1992
  if delta_sync_index_spec is not None:
@@ -1817,7 +2007,7 @@ class VectorSearchIndexesAPI:
1817
2007
  }
1818
2008
 
1819
2009
  res = self._api.do("POST", "/api/2.0/vector-search/indexes", body=body, headers=headers)
1820
- return CreateVectorIndexResponse.from_dict(res)
2010
+ return VectorIndex.from_dict(res)
1821
2011
 
1822
2012
  def delete_data_vector_index(self, index_name: str, primary_keys: List[str]) -> DeleteDataVectorIndexResponse:
1823
2013
  """Delete data from index.
@@ -1831,16 +2021,16 @@ class VectorSearchIndexesAPI:
1831
2021
 
1832
2022
  :returns: :class:`DeleteDataVectorIndexResponse`
1833
2023
  """
1834
- body = {}
2024
+
2025
+ query = {}
1835
2026
  if primary_keys is not None:
1836
- body["primary_keys"] = [v for v in primary_keys]
2027
+ query["primary_keys"] = [v for v in primary_keys]
1837
2028
  headers = {
1838
2029
  "Accept": "application/json",
1839
- "Content-Type": "application/json",
1840
2030
  }
1841
2031
 
1842
2032
  res = self._api.do(
1843
- "POST", f"/api/2.0/vector-search/indexes/{index_name}/delete-data", body=body, headers=headers
2033
+ "DELETE", f"/api/2.0/vector-search/indexes/{index_name}/delete-data", query=query, headers=headers
1844
2034
  )
1845
2035
  return DeleteDataVectorIndexResponse.from_dict(res)
1846
2036
 
@@ -1855,7 +2045,9 @@ class VectorSearchIndexesAPI:
1855
2045
 
1856
2046
  """
1857
2047
 
1858
- headers = {}
2048
+ headers = {
2049
+ "Accept": "application/json",
2050
+ }
1859
2051
 
1860
2052
  self._api.do("DELETE", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers)
1861
2053
 
@@ -1934,9 +2126,11 @@ class VectorSearchIndexesAPI:
1934
2126
  :param filters_json: str (optional)
1935
2127
  JSON string representing query filters.
1936
2128
 
1937
- Example filters: - `{"id <": 5}`: Filter for id less than 5. - `{"id >": 5}`: Filter for id greater
1938
- than 5. - `{"id <=": 5}`: Filter for id less than equal to 5. - `{"id >=": 5}`: Filter for id
1939
- greater than equal to 5. - `{"id": 5}`: Filter for id equal to 5.
2129
+ Example filters:
2130
+
2131
+ - `{"id <": 5}`: Filter for id less than 5. - `{"id >": 5}`: Filter for id greater than 5. - `{"id
2132
+ <=": 5}`: Filter for id less than equal to 5. - `{"id >=": 5}`: Filter for id greater than equal to
2133
+ 5. - `{"id": 5}`: Filter for id equal to 5.
1940
2134
  :param num_results: int (optional)
1941
2135
  Number of results to return. Defaults to 10.
1942
2136
  :param query_text: str (optional)
@@ -2049,7 +2243,9 @@ class VectorSearchIndexesAPI:
2049
2243
 
2050
2244
  """
2051
2245
 
2052
- headers = {}
2246
+ headers = {
2247
+ "Accept": "application/json",
2248
+ }
2053
2249
 
2054
2250
  self._api.do("POST", f"/api/2.0/vector-search/indexes/{index_name}/sync", headers=headers)
2055
2251